OFFSET
1,1
LINKS
Winston de Greef, Table of n, a(n) for n = 1..10000
MATHEMATICA
2 + Accumulate[1 + ThueMorse /@ Range[0, 120]]
PROG
(Python)
from itertools import islice, accumulate
def A360392_gen(): # generator of terms
yield 3
blist, s = [1], 3
while True:
c = [3-d for d in blist]
blist += c
yield from (s+d for d in accumulate(c))
s += sum(c)
(Python)
def A360392(n): return n+2+(n-1>>1)+(n-1&1|(n.bit_count()&1^1)) # Chai Wah Wu, Mar 01 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 05 2023
STATUS
approved