

A151861


a(0)=0; a(1)=1; a(2)=1; for n>=3 if n=2^i + j with 0<=j<2^i then a(n)=2*a(j) + a(j + 1) except we add 1 if j=2^i1.


1



0, 1, 1, 4, 1, 3, 6, 10, 1, 3, 6, 9, 5, 12, 22, 22, 1, 3, 6, 9, 5, 12, 22, 21, 5, 12, 21, 23, 22, 46, 66, 46, 1, 3, 6, 9, 5, 12, 22, 21, 5, 12, 21, 23, 22, 46, 66, 45, 5, 12, 21, 23, 22, 46, 65, 47, 22, 45, 65, 68, 90, 158, 178, 94, 1, 3, 6, 9, 5, 12, 22, 21, 5, 12, 21, 23, 22, 46, 66, 45, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,4


LINKS



FORMULA

I would very much like a g.f. for this sequence!


MATHEMATICA

ij[n_] := Module[{i, j}, For[i = 1, True, i++, j = n  2^i; If[n == 2^i + j && 0 <= j < 2^i, Return[{i, j}]]]];
a[0] = 0; a[1] = 1; a[2] = 1; a[n_] := a[n] = Module[{i, j}, {i, j} = ij[n]; 2*a[j] + a[j + 1] + If[j == 2^i  1, 1, 0]];


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



