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!)
A221158 Fibonacci numbers with two 1's in the binary representation. 3

%I #29 Dec 07 2019 12:18:26

%S 3,5,34,144

%N Fibonacci numbers with two 1's in the binary representation.

%C Fibonacci numbers of the form 2^a + 2^b, a>b.

%C Elkies (2014) proved that there are no other terms.

%C This sequence is one row of A222296. - _T. D. Noe_, Mar 08 2013

%H Noam D. Elkies, <a href="http://mathoverflow.net/questions/159142/hamming-weight-of-fibonacci-numbers/159144#159144">Fibonacci numbers with Hamming weight 2</a>, Mathoverflow, 2014.

%e 144 = 128 + 16 = 2^7 + 2^4, thus it is in the sequence.

%t Select[Fibonacci[Range[1000]], DigitCount[#, 2, 1] == 2 &] (* _Alonso del Arte_, Feb 21 2013 *)

%o (Python)

%o prev = 0

%o curr = 1

%o for n in range(3000000):

%o c = 0 # count 1's

%o p = 1

%o while p<=prev:

%o c += ((prev & p) > 0)

%o if c>2:

%o break

%o p += p

%o if n&1023==0:

%o print '.',

%o if c==2:

%o print prev,

%o prev, curr = curr, prev+curr

%Y Cf. A000045, A004685, A222296.

%K nonn,full,fini

%O 1,1

%A _Alex Ratushnyak_, Feb 20 2013

%E full, fini keywords added by _Max Alekseyev_, May 13 2014

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 May 19 00:35 EDT 2024. Contains 372666 sequences. (Running on oeis4.)