OFFSET
0,5
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..16383
David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191. [There is a typo in Theorem 6: (13) should read u(n) = 4.3^(wt(n-1)-1) for n >= 2.]
N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS.
FORMULA
a(n) = 1 for 0 <= n <= 3; thereafter write n = 2^i + j, with 0 <= j < 2^i, then a(n) = a(j) + a(j+1), except that a(2^(i+1)-2) = a(2^(i+1)-1) = 1.
a(n) = Sum_{k>=0, n+k even} binomial(A000120(n+k),k); the sum may be restricted further to k <= A000523(n+1). - Hagen von Eitzen, May 20 2009 [corrected by Amiram Eldar, Jul 29 2023]
EXAMPLE
Written as a triangle:
1;
1;
1,1;
2,2,1,1;
2,2,2,3,4,3,1,1;
2,2,2,3,4,3,2,3,4,4,5,7,7,4,1,1;
2,2,2,3,4,3,2,3,4,4,5,7,7,4,2,3,4,4,5,7,7,5,5,7,8,9,12,14,11,5,1,1;
2,2,2,3,4,3,2,3,4,4,5,7,7,4,2,3,4,4,5,7,7,5,5,7,8,9,12,14,11,5,2,3,4,4,5,7,7,5,5,...
The rows converge to A151714.
MAPLE
G := mul( 1 + x^(2^n-1) + x^(2^n), n=1..20);
wt := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end:
f:=proc(n) local t1, k; global wt; t1:=0; for k from 0 to 20 do if n+k mod 2 = 0 then t1:=t1+binomial(wt(n+k), k); fi; od; t1; end;
MATHEMATICA
a[n_] := Sum[If[EvenQ[n + k], Binomial[DigitCount[n + k, 2, 1], k], 0], {k, 0, Floor[Log2[n + 1]]}]; Array[a, 100, 0] (* Amiram Eldar, Jul 29 2023 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
N. J. A. Sloane, May 19 2009, Dec 26 2009
STATUS
approved