OFFSET
1,2
COMMENTS
Here we number positions starting with the most significant digit as position 1, and continue to the right down to the least significant digit.
From David A. Corneth, Jul 29 2018: (Start)
1 is in the sequence.
If k is in the sequence then so is 2k+1.
(End)
If A070939(k) is odd and k is in the sequence then so is 2*k. - Robert Israel, Jul 31 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
23 is in the sequence because its binary representation is 10111, and it has ones in positions 1,3,5.
MAPLE
S[1]:= [1]:
for n from 2 to 10 do
if n::odd then S[n]:= map(t -> 2*t+1, S[n-1])
else S[n]:= map(t -> (2*t, 2*t+1), S[n-1])
fi
od;
map(op, [seq(S[i], i=1..10)]); # Robert Israel, Jul 31 2018
PROG
(PARI) isok(n) = {my(b=binary(n)); forstep (i=1, #b, 2, if (!b[i], return (0)); ); return (1); } \\ Michel Marcus, Jul 29 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, Jul 28 2018
STATUS
approved