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.

Showing 1-2 of 2 results.

A052992 Expansion of 1/((1 - x)*(1 - 2*x)*(1 + 2*x)).

Original entry on oeis.org

1, 1, 5, 5, 21, 21, 85, 85, 341, 341, 1365, 1365, 5461, 5461, 21845, 21845, 87381, 87381, 349525, 349525, 1398101, 1398101, 5592405, 5592405, 22369621, 22369621, 89478485, 89478485, 357913941, 357913941, 1431655765, 1431655765, 5726623061, 5726623061
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

a(n) is the sum of square divisors of 2^n. - Paul Barry, Oct 13 2005
Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 131", based on the 5-celled von Neumann neighborhood. See A279053 for references and links. - Robert Price, Dec 05 2016

Crossrefs

Programs

  • GAP
    Flat(List([1..17],n->[(4^n-1)/3,(4^n-1)/3])); # Muniru A Asiru, Oct 21 2018
    
  • Magma
    [&+[2^k*(1 + (-1)^k)/2: k in [0..n]]: n in [0..50]]; // Vincenzo Librandi, Oct 21 2018
  • Maple
    spec := [S,{S=Prod(Sequence(Prod(Union(Z,Z),Union(Z,Z))),Sequence(Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
  • Mathematica
    CoefficientList[Series[1/((1-x)(1-2x)(1+2x)),{x,0,40}],x] (* or *) LinearRecurrence[{1,4,-4},{1,1,5},40] (* or *) With[{c= LinearRecurrence[ {5,-4},{1,5},20]},Riffle[c,c]] (* Harvey P. Dale, Sep 12 2015 *)
    (4^(1 + Floor[(Range@40-1)/2])-1)/3 (* Federico Provvedi, Oct 19 2018 *)
  • Python
    for n in range(0,40): print((int(4**(1+int((n+2)/2)-1)/3)), end=', ') # Stefano Spezia, Oct 19 2018
    
  • Python
    [4**(1+(n+2)//2-1)//3 for n in range(40)] # Pascal Bisson, Feb 03 2022
    

Formula

G.f.: 1/(-1+4*x^2)/(-1+x).
Recurrence: {a(1)=1, a(0)=1, -4*a(n) - 1 + a(n+2) = 0}.
a(n) = -1/3 + Sum((1/6)*(1+4*_alpha)*_alpha^(-1-n), where _alpha=RootOf(-1+4*_Z^2))
a(n) = Sum_{k=0..n} 2^k(1+(-1)^k)/2. - Paul Barry, Nov 24 2003
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3). - Paul Curtz, Apr 27 2011
a(n) = (4^(1 + floor(n/2)) - 1)/3. - Federico Provvedi, Oct 19 2018
a(n)-a(n-1) = A199572(n). - R. J. Mathar, Feb 27 2019
a(n) = A263053(n)/2. - Pascal Bisson, Feb 03 2022

Extensions

More terms from James Sellers, Jun 08 2000

A339694 Triangle read by rows: A(n, k) = Sum_{i=0..n-1} x(i, k)*2^i, where x(i, k) = A014682^(i)(k) (mod 2) using the i-th iteration of A014682.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 0, 5, 2, 3, 4, 1, 6, 7, 0, 5, 10, 3, 4, 1, 6, 7, 8, 13, 2, 11, 12, 9, 14, 15, 0, 21, 10, 3, 20, 17, 6, 23, 8, 29, 2, 11, 12, 9, 14, 15, 16, 5, 26, 19, 4, 1, 22, 7, 24, 13, 18, 27, 28, 25, 30, 31, 0, 21, 42, 35, 20, 17, 6, 23, 40, 29, 34, 11
Offset: 1

Views

Author

Sebastian Karlsson, Dec 13 2020

Keywords

Comments

A(n, k) is periodic with period 2^n, i.e., A(n, k) = A(n, k + 2^n). Each row in the triangle is therefore [A(n, 0), A(n, 1), ..., A(n, 2^n-1)].
The binary modular Collatz graph C(n) is the graph representing the dynamics of the Collatz function (A014682) modulo 2^n. For example, in C(3), there is an arrow from 3 to 5 and from 3 to 1 because any number that is 3 modulo 8 either gets mapped to 5 modulo 8 or 1 modulo 8. The vertices of the de Bruijn graph B(2,n) are words of length n consisting of the two symbols 0 and 1. If one represents these vertices as integers, b_0 b_1 ... b_{n-1} -> Sum_{i=0..n-1} b_i*2^i, then A(n) : C(n) -> B(2,n) is a graph isomorphism [Laarhoven, de Weger].
The n-th row is a permutation on the set {0..2^n-1}. For n > 5, the order of this permutation is 2^(n-4) [Bernstein, Lagarias]. - Sebastian Karlsson, Jan 17 2021

Examples

			Triangle begins:
n=1 : 0 1;
n=2 : 0 1  2 3;
n=3 : 0 5  2 3 4 1 6 7;
n=4 : 0 5 10 3 4 1 6 7 8 13 2 11 12 9 14 15;
...
A(3, 4) = Sum_{i=0..2} x(i, 4)*2^i = 0*2^0 + 0*2^1 + 1*2^2 = 4.
A(4, 1) = Sum_{i=0..3} x(i, 1)*2^i = 1*2^0 + 0*2^1 + 1*2^2 + 0*2^3 = 5.
		

Crossrefs

Cf. A000004 (column 0), A052992 (column 1), A263053 (column 2).

Programs

  • Mathematica
    A339694row[n_]:=Table[Sum[Mod[Nest[If[OddQ[#],(3#+1)/2,#/2]&,k,i],2]2^i,{i,0,n-1}],{k,0,2^n-1}];Array[A339694row,6] (* Paolo Xausa, Aug 08 2023 *)
  • PARI
    f(n) = if(n%2, 3*n+1, n)/2 \\ A014682
    x(i, n) = my(x=n); for (k=1, i, x = f(x)); x % 2;
    A(n, k) = sum(i=0, k-1, x(i, n)*2^i);
    row(n) = vector(2^n, i, A(i-1, n));
    tabf(nn) = for (n=1, nn, print(row(n))); \\ Michel Marcus, Dec 21 2020
  • Python
    def A014682(k):
        if k % 2 == 0:
            return k // 2
        else:
            return (3*k + 1) // 2
    def x(i, k):
        while i > 0:
            k = A014682(k)
            i = i - 1
        return k % 2
    def A(n, k):
        L = [x(i, k) * 2**i for i in range(0, n)]
        return sum(L)
    

Formula

A000120( T(n, (m + 1) mod 2^n) ) = log_3( A014682^n(m + 1 + 2^n) - A014682^n(m + 1) ), m = 0..2^n-1. (A000120 is the binary weight.) - Thomas Scheuerle, Aug 23 2021
Showing 1-2 of 2 results.