|
|
A295559
|
|
Same as A161645 except that triangles must always grow outwards.
|
|
5
|
|
|
0, 1, 3, 6, 6, 6, 12, 18, 12, 6, 12, 18, 18, 18, 30, 42, 24, 6, 12, 18, 18, 18, 30, 42, 30, 18, 30, 42, 42, 42, 66, 90, 48, 6, 12, 18, 18, 18, 30, 42, 30, 18, 30, 42, 42, 42, 66, 90, 54, 18, 30, 42, 42, 42, 66, 90, 66, 42, 66, 90, 90, 90, 138, 186, 96, 6, 12
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Note that Reed's version has errors (see A295558).
|
|
REFERENCES
|
R. Reed, The Lemming Simulation Problem, Mathematics in School, 3 (#6, Nov. 1974), front cover and pp. 5-6. [Describes the dual structure where new triangles are joined at vertices rather than edges.]
|
|
LINKS
|
R. Reed, The Lemming Simulation Problem, Mathematics in School, 3 (#6, Nov. 1974), front cover and pp. 5-6. [Scanned photocopy of pages 5, 6 only, with annotations by R. K. Guy and N. J. A. Sloane]
|
|
FORMULA
|
Empirically (correct to 3*10^6 terms):
Convert n+1 to binary and view it as 1a1b or 1a1b1,
where a is zero or more digits, let "ones" be the number of 1's in a,
and b is zero or more 0's, let "zeros" be the number of 0's.
Let "len" be the total number of binary digits.
Then r=A295559(n) is determined by ones, zeros, len, and the parity of n+1, as follows:
if (n==0,1,2) r=0,1,3
else if (n+1 is odd)
if (len==zeros+2) r=BVal(1, zeros-1) else if (zeros==0) r=BVal(ones+1, ones+1) else r=BVal(ones+2, ones+zeros)
else
if (len==zeros+1) r=AVal(zeros-2) else r=AVal(ones+zeros-1)
and
AVal(k)=6*(2^(k+1)-1)
BVal(k, kk)=3*2^k + sum(j=0,kk-1, 6 * 2^j) (End)
|
|
PROG
|
(PARI) \\ Empirically discovered algorithm.
AVal(k)=6*(2^(k+1)-1)
BVal(k, kk)={ local v; v = 3 * 2^k; for (j=0, kk-1, v += 6 * 2^j); v}
A295559(n)={ local (len, zeros, ones, r);
if(n==0, return(0));
if(n==1, return(1));
if(n==2, return(3));
n++; len=length(binary(n));
zeros=ones=0; i=bittest(n, 0); \\ Skip trailing 1
while(bittest(n, i)==0, zeros++; i++);
for(j=i+1, len-2, ones+=bittest(n, j));
if (bittest(n, 0)==1,
if (len==zeros+2, r=BVal(1, zeros-1), if (zeros==0, r=BVal(ones+1, ones+1), r=BVal(ones+2, ones+zeros))),
if (len==zeros+1, r=AVal(zeros-2), r=AVal(ones+zeros-1)));
r; }
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|