The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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^i-1. 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]];
Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Nov 09 2017 *)
CROSSREFS
Sequence in context: A256243 A190479 A074813 * A210583 A200171 A109531
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 17 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 6 00:30 EDT 2024. Contains 373110 sequences. (Running on oeis4.)