login
A354757
a(n) = Sum_{k = ceiling(n/2)..n-1} A354169(k).
6
0, 0, 1, 2, 6, 12, 15, 27, 59, 115, 127, 252, 508, 1004, 1021, 2013, 2047, 4031, 8127, 16307, 16375, 32631, 32767, 65279, 130815, 261375, 262143, 524270, 1048558, 2096110, 2097135, 4194253, 4194271, 8386527, 8388607, 16773119, 33550335, 67096575, 67108863
OFFSET
0,4
COMMENTS
The 1's in the binary expansion of a(n) are forbidden in that of A354169(n). In other words, a(n) AND A354169(n) = 0 (where AND denotes the bitwise AND operator).
EXAMPLE
a(5) = A354169(3) + A354169(4) = 4 + 8 = 12.
a(7) = A354169(4) + A354169(5) + A354169(6) = 8 + 3 + 16 = 27.
PROG
(PARI) See Links section.
(Python)
from itertools import count, islice
from collections import deque
from functools import reduce
from operator import or_
def A354757_gen(): # generator of terms
aset, aqueue, b, f = {0, 1, 2}, deque([2]), 2, False
yield from (0, 0, 1)
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:
yield sum(aqueue)
aset.add(m)
aqueue.append(m)
if f: aqueue.popleft()
b = reduce(or_, aqueue)
f = not f
break
A354757_list = list(islice(A354757_gen(), 40)) # Chai Wah Wu, Jun 06 2022
CROSSREFS
A354780 is a bisection.
Sequence in context: A242336 A285312 A065154 * A230482 A263546 A143408
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 06 2022
STATUS
approved