OFFSET
1,1
COMMENTS
A subsequence of A354798.
The first differences begin 4, 16, 12, 12, 18, 6, 18, 6, 48, 48, 96, 96, 192, 192, 384, 384, 768, 768, 1536, ..., which suggests that from the 9th term on, the differences have g.f. 48*(1+x)/(1-2*x^2), with an analogous conjecture for the sequence itself.
LINKS
Rémy Sigrist, C++ program
PROG
(C++) See Links section.
(Python)
from itertools import count, islice
from collections import deque
from functools import reduce
from operator import or_
def A354775_gen(): # generator of terms
aset, aqueue, b, f, i = {0, 1, 2}, deque([2]), 2, False, 2
while True:
for k in count(1):
m, j, j2, r, s = 0, 0, 1, b, k
while r > 0:
r, q = divmod(r, 2)
if not q:
s, y = divmod(s, 2)
m += y*j2
j += 1
j2 *= 2
if s > 0:
m += s*2**b.bit_length()
if m not in aset:
i += 1
if '11' in (s := bin(m)[2:]) and s.count('1') == 2:
yield i
aset.add(m)
aqueue.append(m)
if f: aqueue.popleft()
b = reduce(or_, aqueue)
f = not f
break
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 26 2022
EXTENSIONS
More terms from Rémy Sigrist, Jun 27 2022
STATUS
approved