OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A003714(n-1)*8 + 3.
EXAMPLE
In binary, 19 is 10011, while 2 * 19 = 38 is of course 100110. Since 010011 AND 100110 = 000010 (in decimal, 2), 19 is in the sequence.
20 is not in the sequence, since 010100 AND 101000 = 000000.
MAPLE
F:= combinat[fibonacci]:
b:= proc(n) local j;
if n=0 then 0
else for j from 2 while F(j+1)<=n do od;
b(n-F(j))+2^(j-2)
fi
end:
a:= n-> 8*b(n-1)+3:
seq(a(n), n=1..60); # Alois P. Heinz, Jun 17 2012
MATHEMATICA
Select[Range[1024], BitAnd[#, 2#] == 2 &] (* Alonso del Arte, Jun 18 2012 *)
PROG
(Python)
for n in range(1777):
a = 2*n & n
if a==2:
print(n, end=', ')
(PARI) is(n)=bitand(n, 2*n)==2 \\ Charles R Greathouse IV, Jun 18 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Jun 14 2012
STATUS
approved