A139251 First differences of toothpicks numbers A139250.
0, 1, 2, 4, 4, 4, 8, 12, 8, 4, 8, 12, 12, 16, 28, 32, 16, 4, 8, 12, 12, 16, 28, 32, 20, 16, 28, 36, 40, 60, 88, 80, 32, 4, 8, 12, 12, 16, 28, 32, 20, 16, 28, 36, 40, 60, 88, 80, 36, 16, 28, 36, 40, 60, 88, 84, 56, 60, 92, 112, 140, 208, 256, 192, 64, 4, 8, 12, 12, 16, 28, 32, 20, 16, 28
Offset: 0
Examples
From _Omar E. Pol_, Dec 16 2008: (Start) Triangle begins: 1; 2; 4,4; 4,8,12,8; 4,8,12,12,16,28,32,16; 4,8,12,12,16,28,32,20,16,28,36,40,60,88,20,32; (End) From _David Applegate_, Apr 29 2009: (Start) The layout of the triangle was adjusted to reveal that the columns become constant as shown below: . 0; . 1; . 2,4; . 4,4,8,12; . 8,4,8,12,12,16,28,32; .16,4,8,12,12,16,28,32,20,16,28,36,40,60,88,80; .32,4,8,12,12,16,28,32,20,16,28,36,40,60,88,80,36,16,28,36,40,60,88,84,56,... ... The row sums give A006516. (End) From _Omar E. Pol_, Feb 28 2018: (Start) Also the nonzero terms can write as an irregular triangle in which the row lengths are the terms of A011782 multiplied by 2 as shown below: 1,2; 4,4; 4,8,12,8; 4,8,12,12,16,28,32,16; 4,8,12,12,16,28,32,20,16,28,36,40,60,88,20,32; ... (End)
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..65535
- 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.], 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.]
- David Applegate, The movie version
- Omar E. Pol, Illustration of initial terms of A139251, A160121, A147582 (Overlapping figures) [From _Omar E. Pol_, Nov 02 2009]
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS
Crossrefs
Row lengths in A011782.
Programs
-
Maple
G := (x/(1+2*x)) * (1 + 2*x*mul(1+x^(2^k-1)+2*x^(2^k),k=0..20)); # N. J. A. Sloane, May 20 2009, Jun 05 2009 # A139250 is T, A139251 is a. a:=[0,1,2,4]; T:=[0,1,3,7]; M:=10; for k from 1 to M do a:=[op(a),2^(k+1)]; T:=[op(T),T[nops(T)]+a[nops(a)]]; for j from 1 to 2^(k+1)-1 do a:=[op(a), 2*a[j+1]+a[j+2]]; T:=[op(T),T[nops(T)]+a[nops(a)]]; od: od: a; T; # N. J. A. Sloane, Dec 25 2009
-
Mathematica
CoefficientList[Series[((x - x^2)/((1 - x) (1 + 2 x))) (1 + 2 x Product[1 + x^(2^k - 1) + 2 x^(2^k), {k, 0, 20}]), {x, 0, 60}], x] (* Vincenzo Librandi, Aug 22 2014 *)
Formula
Recurrence from N. J. A. Sloane, Jul 20 2009: a(0) = 0; a(2^i)=2^i for all i; otherwise write n=2^i+j, 0 < j < 2^i, then a(n) = 2a(j)+a(j+1). Proof: This is a simplification of the following recurrence of David Applegate. QED
Recurrence from David Applegate, Apr 29 2009: (Start)
Write n=2^(i+1)+j, where 0 <= j < 2^(i+1). Then, for n > 3:
for j=0, a(n) = 2*a(n-2^i) (= n = 2^(i+1))
for 1 <= j <= 2^i - 1, a(n) = a(n-2^i)
for j=2^i, a(n) = a(n-2^i)+4 (= 2^(i+1)+4)
for 2^i+1 <= j <= 2^(i+1)-2, a(n) = 2*a(n-2^i) + a(n-2^i+1)
for j=2^(i+1)-1, a(n) = 2*a(n-2^i) + a(n-2^i+1)-4
and a(n) = 2^(n-1) for n=1,2,3. (End)
G.f.: (x/(1+2*x)) * (1 + 2*x*Product_{k>=0} (1 + x^(2^k-1) + 2*x^(2^k))). - N. J. A. Sloane, May 20 2009, Jun 05 2009
With offset 0 (which would be more natural, but offset 1 is now entrenched): a(0) = 1, a(1) = 2; for i >= 1, a(2^i) = 4; otherwise write n = 2^i +j, 0 < j < 2^i, then a(n) = 2 * Sum_{ k >= 0 } 2^(wt(j+k)-k)*binomial(wt(j+k),k). - N. J. A. Sloane, Jun 03 2009
It appears that a(n) = A187221(n+1)/2. - Omar E. Pol, Mar 08 2011
Extensions
Partially edited by Omar E. Pol, Feb 28 2019
Comments