OFFSET
1,2
COMMENTS
The number of terms less than 2^n is the n-th Fibonacci number F(n), A000045.
The number of terms between 2^(n-1) and 2^n in the sequence is the Fibonacci number F(n-2), A000045.
If 2^(n-1) <= x < 2^n, then x is in the sequence if and only if x is not divisible by 3 and x - 2^(n-1) is in the sequence. - Robert Israel, Apr 25 2019
EXAMPLE
29 is 11101_2 and none of 11101_2, 1101_2, 101_2, 1_2 are divisible by 3.
MAPLE
f := n-> if(n != 0, add(2^(k-1)*`if`((n mod 2^k) mod 3 = 0, 1, 0), k = 1 .. ceil(log(n)/log(2))), 0);
ker := []; for n from 1 to 1024 do if f(n) = 0 then ker := [op(ker), n] end if end do; ker;
# Alternative:
A1:= {1}: A2:= {}:
for d from 1 to 12 do
if d::odd then A1:= A1 union map(`+`, A2, 2^d)
else A2:= A2 union map(`+`, A1, 2^d)
fi
od:
sort(convert(A1 union A2, list)); # Robert Israel, Apr 25 2019
MATHEMATICA
Select[Range[10^3], Function[s, NoneTrue[Array[FromDigits[Take[s, -#], 2] &, Length@ s], Mod[#, 3] == 0 &]]@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Mar 24 2019 *)
PROG
(PARI) isok(n) = {if (n % 3, my(b=binary(n)); for (k=1, #b-1, b[k] = 0; if ((fromdigits(b, 2) % 3) == 0, return (0)); ); return (1); ); return (0); } \\ Michel Marcus, Apr 24 2019
CROSSREFS
KEYWORD
easy,base,nonn
AUTHOR
John Rickert, Mar 24 2019
STATUS
approved