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!)
A166267 Number of 1's in the binary representation of A000129(n). 1

%I #17 Jul 29 2023 03:16:51

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

%H Amiram Eldar, <a href="/A166267/b166267.txt">Table of n, a(n) for n = 0..10000</a>

%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

%t DigitCount[LinearRecurrence[{2, 1}, {0, 1}, 100], 2, 1] (* _Amiram Eldar_, Jul 29 2023 *)

%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

%Y Cf. A000120, A000129.

%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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 11:39 EDT 2024. Contains 371969 sequences. (Running on oeis4.)