OFFSET
1,1
COMMENTS
For m >= 4, there are A000217(m-3) terms with m digits.
MATHEMATICA
FromDigits[IntegerDigits[#, 2]] & /@ Select[Range[1, 250, 2], DigitCount[#, 2, 0] == 2 &] (* Amiram Eldar, Oct 19 2022 *)
PROG
(Python)
from itertools import combinations, count, islice
def agen(): # generator of terms
for d in count(4):
b, c = 2**d - 1, 2**(d-1)
for i, j in combinations(range(1, d-1), 2):
yield int(bin(b - (c >> i) - (c >> j))[2:])
print(list(islice(agen(), 30))) # Michael S. Branicky, Oct 19 2022
(Python)
from itertools import count, islice
def A357774_gen(): # generator of terms
for l in count(2):
m = (10**(l+2)-1)//9
for i in range(l, 0, -1):
k = m-10**i
yield from (k-10**j for j in range(i-1, 0, -1))
(PARI) isok(k) = (k%2) && (#binary(k) == hammingweight(k)+2); \\ A357773
f(n) = fromdigits(binary(n), 10); \\ A007088
lista(nn) = apply(f, select(isok, [1..nn])); \\ Michel Marcus, Oct 19 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 19 2022
STATUS
approved