

A160125


Number of squares and rectangles that are created at the nth stage in the toothpick structure (see A139250).


9



0, 0, 2, 2, 0, 4, 10, 6, 0, 4, 8, 4, 4, 20, 30, 14, 0, 4, 8, 4, 4, 20, 28, 12, 4, 16, 20, 12, 28, 72, 78, 30, 0, 4, 8, 4, 4, 20, 28, 12, 4, 16, 20, 12, 28, 72, 76, 28, 4, 16, 20, 12, 28, 68, 68, 28, 24, 52, 52, 52, 128, 224, 190, 62, 0, 4, 8, 4, 4, 20, 28, 12, 4, 16, 20, 12, 28, 72
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


LINKS

Table of n, a(n) for n=1..78.
David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata
N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS


FORMULA

See Maple program for recurrence.


MAPLE

Maple program from N. J. A. Sloane, Feb 01 2010:
# First construct A168131:
w := proc(n) option remember; local k, i;
if (n=0) then RETURN(0)
elif (n <= 3) then RETURN(n1)
else
k:=floor(log(n)/log(2)); i:=n2^k;
if (i=0) then RETURN(2^(k1)1)
elif (i<2^k2) then RETURN(2*w(i)+w(i+1));
elif (i=2^k2) then RETURN(2*w(i)+w(i+1)+1);
else RETURN(2*w(i)+w(i+1)+2);
fi; fi; end;
# Then construct A160125:
r := proc(n) option remember; local k, i;
if (n<=2) then RETURN(0)
elif (n <= 4) then RETURN(2)
else
k:=floor(log(n)/log(2)); i:=n2^k;
if (i=0) then RETURN(2^k2)
elif (i<=2^k2) then RETURN(4*w(i));
else RETURN(4*w(i)+2);
fi; fi; end;
[seq(r(n), n=0..200)];


CROSSREFS

First differences of A160124.
Cf. toothpick sequence A139250.
Cf. A159786, A159787, A159788, A159789, A160124, A160126, A160127.
Sequence in context: A009545 A084102 A221609 * A151868 A052079 A291483
Adjacent sequences: A160122 A160123 A160124 * A160126 A160127 A160128


KEYWORD

nonn


AUTHOR

Omar E. Pol, May 03 2009


EXTENSIONS

Terms beyond a(10) from R. J. Mathar, Jan 21 2010


STATUS

approved



