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.

A112970 A generalized Stern sequence.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 4, 2, 2, 1, 5, 3, 3, 2, 5, 2, 3, 1, 6, 4, 3, 2, 6, 2, 3, 1, 7, 5, 4, 3, 8, 3, 5, 2, 8, 5, 4, 2, 8, 3, 3, 1, 9, 6, 5, 4, 9, 3, 6, 2, 9, 6, 4, 2, 9, 3, 3, 1, 10, 7, 6, 5, 11, 4, 8, 3, 12, 8, 6, 3, 13, 5, 5, 2, 13, 8, 7, 5, 12, 4, 7, 2, 12, 8, 5, 3, 11, 3, 4, 1, 12, 9, 7, 6
Offset: 0

Views

Author

Paul Barry, Oct 07 2005

Keywords

Comments

Conjectures: a(2^n)=a(2^(n+1)+1)=A033638(n); a(2^n-1)=a(3*2^n-1)=1.
The Gi1 and Gi2 triangle sums, see A180662 for their definitions, of Sierpinski's triangle A047999 equal this sequence. The Gi1 and Gi2 sums can also be interpreted as (i + 4*j = n) and (4*i + j = n) sums, see the Northshield reference. Some A112970(2^n-p) sequences, 0<=p<=32, lead to known sequences, see the crossrefs. - Johannes W. Meijer, Jun 05 2011

Crossrefs

Cf. A120562 (Northshield).
Cf. A033638 (p=0), A000012 (p=1), A004526 (p=2, p=3, p=5, p=9, p=17), A002620 (p=4, p=7, p=13, p=25), A000027 (p=6, p=11, p=21), A004116 (p=8, p=15, p=29), A035106 (p=10, p=19), A024206 (p=14, p=27), A007494 (p=18), A014616 (p=22), A179207 (p=26). - Johannes W. Meijer, Jun 05 2011

Programs

  • Maple
    A112970:=proc(n) option remember; if n <0 then A112970(n):=0 fi: if (n=0 or n=1) then 1 elif n mod 2 = 0 then A112970(n/2) + A112970((n/2)-2) else A112970((n-1)/2); fi; end: seq(A112970(n),n=0..99); # Johannes W. Meijer, Jun 05 2011
  • Mathematica
    a[n_] := a[n] = Which[n<0, 0, n==0 || n==1, 1, Mod[n, 2]==0, a[n/2] + a[n/2-2], True, a[(n-1)/2]];
    Table[a[n], {n, 0, 99}] (* Jean-François Alcover, Aug 02 2022 *)

Formula

a(n) = Sum_{k=0..n} mod(sum{j=0..n, (-1)^(n-k)*C(j, n-j)*C(k, j-k)}, 2).
From Johannes W. Meijer, Jun 05 2011: (Start)
a(2*n+1) = a(n) and a(2*n) = a(n) + a(n-2) with a(0) = 1, a(1) = 1 and a(n)=0 for n<=-1.
G.f.: Product_{n>=0} (1 + x^(2^n) + x^(4*2^n)). (End)
G.f. A(x) satisfies: A(x) = (1 + x + x^4) * A(x^2). - Ilya Gutkovskiy, Jul 09 2019