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

%I #6 Nov 09 2017 08:46:34

%S 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,

%T 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,

%U 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

%N 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.

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

%t 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}]]]];

%t 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]];

%t Table[a[n], {n, 0, 80}] (* _Jean-Fran├žois Alcover_, Nov 09 2017 *)

%Y Cf. A151843-A151874.

%K nonn

%O 0,4

%A _N. J. A. Sloane_, Jul 17 2009

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 April 18 10:01 EDT 2024. Contains 371779 sequences. (Running on oeis4.)