cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A065176 Site swap sequence associated with the permutation A065174 of Z.

Original entry on oeis.org

0, 2, 2, 4, 4, 2, 2, 8, 8, 2, 2, 4, 4, 2, 2, 16, 16, 2, 2, 4, 4, 2, 2, 8, 8, 2, 2, 4, 4, 2, 2, 32, 32, 2, 2, 4, 4, 2, 2, 8, 8, 2, 2, 4, 4, 2, 2, 16, 16, 2, 2, 4, 4, 2, 2, 8, 8, 2, 2, 4, 4, 2, 2, 64, 64, 2, 2, 4, 4, 2, 2, 8, 8, 2, 2, 4, 4, 2, 2, 16, 16, 2, 2, 4, 4, 2, 2, 8, 8, 2, 2, 4, 4, 2, 2, 32, 32, 2, 2
Offset: 1

Views

Author

Antti Karttunen, Oct 19 2001

Keywords

Comments

Here the site swap pattern ...,2,16,2,4,2,8,2,4,2,0,2,4,2,8,2,4,2,16,2,... that spans over the Z (zero throw is at t=0) has been folded to N by picking values at t=0, t=1, t=-1, t=2, t=-2, etc. successively.
This pattern is shown in the figure 7 of Buhler and Graham paper and uses infinitely many balls, with each ball at step t thrown always to constant "height" 2^A001511[abs(t)] (no balls in hands at step t=0).

Crossrefs

Bisection of this gives A171977 or 2*A006519 or 2^A001511.
Cf. A065174.

Programs

  • Maple
    [seq(TZ2(abs(N2Z(n))), n=1..120)];  # using TZ2 from A065174
    N2Z := n -> ((-1)^n)*floor(n/2); Z2N := z -> 2*abs(z)+`if`((z < 1),1,0);
    # Alternative:
    A065176 := n -> `if`(n = 1, 0, 2^padic:-ordp(n - 1 + irem(n-1, 2), 2)):
    seq(A065176(n), n = 1..99);  # Peter Luschny, Nov 14 2021
  • Mathematica
    a[n_] := 2^IntegerExponent[n - Mod[n, 2], 2]; a[1] = 0; Array[a, 100] (* Amiram Eldar, May 22 2025 *)
  • PARI
    a(n) = if(n==1,0, 1<Kevin Ryde, Jul 09 2021
    
  • Python
    def A065176(n):
        s, h = 1, n // 2
        if 0 == h: return 0
        while 0 == h % 2:
            h //= 2
            s += s
        return s + s
    print([A065176(n) for n in range(1, 100)])  # Peter Luschny, Nov 14 2021

Formula

G.f.: (1-x+x^2)/(1-x) + (1+x)*Sum(k>=1, 2^(k-1)*x^2^k/(1-x^2^k)). - Ralf Stephan, Apr 17 2003
a(n) = A171977(floor(n/2)) for n >= 2. - Georg Fischer, Nov 28 2022