login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A166267 Number of 1's in the binary representation of A000129(n). 1

%I

%S 0,1,1,2,2,4,3,4,4,7,5,8,6,7,10,11,10,8,13,12,12,14,16,17,11,14,17,20,

%T 16,17,19,21,23,17,17,19,24,24,25,18,29,26,29,26,26,29,35,29,26,40,29,

%U 33,33,38,36,34,28,38,42,40,37,34,40,27,45,35,37,41,40,44,48,45,41,45

%N Number of 1's in the binary representation of A000129(n).

%F a(n) = A000120(A000129(n)). - _R. J. Mathar_, Oct 28 2009

%t Clear[a,b,c,f,n,lst] f[n_]:=Plus@@IntegerDigits[n,2]; a=1;b=0;c=0;lst={b}; Do[c=a+b+c;AppendTo[lst,f[c]];a=b;b=c,{n,5!}];lst

%o (Python)

%o def A000129(n):

%o if n <=1:

%o return n

%o else:

%o return 2*A000129(n-1)+A000129(n-2)

%o def A000120(n):

%o a=0

%o sh=n

%o while sh > 0:

%o a += sh & 1

%o sh >>= 1

%o return a

%o def A166267(n):

%o return A000120(A000129(n))

%o print([A166267(n) for n in range(30)])

%o # _R. J. Mathar_, Oct 18 2009

%K nonn,base,easy

%O 0,4

%A _Vladimir Joseph Stephan Orlovsky_, Oct 10 2009

%E Keyword:base added by _R. J. Mathar_, Oct 28 2009

%E Offset changed to 0 by _Georg Fischer_, Dec 19 2020

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 2 09:23 EST 2021. Contains 341746 sequences. (Running on oeis4.)