login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A330220
Numbers whose representation in base 2^w contains only the digit 2^k for some w and k such that 0 <= k < w
1
0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 21, 31, 32, 33, 34, 36, 42, 63, 64, 65, 66, 68, 73, 85, 127, 128, 129, 130, 132, 136, 146, 170, 255, 256, 257, 258, 260, 264, 273, 292, 341, 511, 512, 513, 514, 516, 520, 528, 546, 585, 682, 1023, 1024, 1025, 1026
OFFSET
1,3
COMMENTS
This is a subsequence of A295235.
For any k > 0, there are k nonzero terms with k binary digits.
Odd terms are A064896.
EXAMPLE
The representation of 546 in base 2^4 is "222", so 546 belongs to the sequence.
PROG
(PARI) is(n) = { for (w=1, max(1, #binary(n)), my (d=if (n, digits(n, 2^w), [0])); if (#Set(d)==1 && hammingweight(d[1])<=1, return (1))); return (0) }
CROSSREFS
Sequence in context: A129268 A271317 A374759 * A039169 A156068 A039263
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Dec 06 2019
STATUS
approved