A214853 Fibonacci numbers with only one 0 in the binary representation.
0, 2, 5, 13, 55
Offset: 1
Examples
55 is 110111 in binary, thus 55 is in the sequence.
Programs
-
Mathematica
Select[Fibonacci@ Range[0, 120], Last@ DigitCount[#, 2] == 1 &] (* Michael De Vlieger, Sep 07 2015 *)
-
Python
def count0(x): c = 0 while x: c+= 1 - (x&1) if c>1: return 2 x>>=1 return c prpr, prev = 0,1 TOP = 1<<12 print(0, end=',') for i in range(1,TOP): if count0(prpr)==1: print(prpr, end=',') if (i&4095)==0: print('.', end=',') prpr, prev = prev, prpr+prev
Comments