OFFSET
1,2
COMMENTS
To reproduce the sequence through itself, use the following rule: if binary 1xyz is a term then so are 11xyz and 10xyz0 (except for 1 alone where 100 is not a term).
The number of terms with bit length k is equal to Fibonacci(k-1) for k > 1.
Conjecture: 2*A247648(n-1) + 1 with rewrite 1 -> 1, 01 -> 0 applied to binary expansion is the same as a(n) without trailing 0 bits in binary.
Odd terms are positive Mersenne numbers (A000225), because there is no 0 in their binary expansion. - Bernard Schott, Oct 12 2022
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = a(n-1) + A356385(n-1) for n > 1 with a(1) = 1.
Conjectured formulas: (Start)
a(n) = 2^g(n-1)*(h(n-1) + 2^A000523(h(n-1))*(2 - g(n-1))) for n > 2 with a(1) = 1, a(2) = 3 where f(n) = n - A130312(n), g(n) = [n > 2*f(n)] and where h(n) = a(f(n) + 1).
a(n) = 1 + 2^r(n-1) + Sum_{k=1..r(n-1)} (1 - g(s(n-1, k)))*2^(r(n-1) - k) for n > 1 with a(1) = 1 where r(n) = A072649(n) and where s(n, k) = f(s(n, k-1)) for n > 0, k > 1 with s(n, 1) = n.
a(A000045(n)) = 2^(n-1) - 1 for n > 1. (End)
MAPLE
N:= 10: # for terms <= 2^N
S:= {1};
for d from 1 to N do
for k from 0 to d/2-1 do
B:= combinat:-choose([$k+1..d-2], k);
S:= S union convert(map(proc(t) local s; 2^d - 2^k - add(2^(s), s=t) end proc, B), set);
od od:
sort(convert(S, list)); # Robert Israel, Sep 21 2023
MATHEMATICA
Join[{1}, Select[Range[2, 600], IntegerExponent[#, 2] == Floor[Log2[# - 1]] - DigitCount[# - 1, 2, 1] &]] (* Amiram Eldar, Jul 16 2022 *)
PROG
(PARI) isok(k) = if (k==1, 1, (logint(k-1, 2)-hammingweight(k-1) == valuation(k, 2))); \\ Michel Marcus, Jul 16 2022
(Python)
from itertools import islice, count
def A353654_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:(m:=(~n & n-1).bit_length()) == bin(n>>m)[2:].count('0'), count(max(startvalue, 1)))
CROSSREFS
Cf. A000045, A000120, A000523, A007814, A010056, A025480, A030109, A054429, A060142, A072649, A084471, A086784, A091892, A132665, A133512, A200650, A213911, A232559, A280514, A343152, A348366.
Cf. A356385 (first differences).
KEYWORD
nonn,base,easy
AUTHOR
Mikhail Kurkov, Jul 15 2022
STATUS
approved