[go: up one dir, main page]

login
A352202
a(n) = binary weight of A115510(n).
0
1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 3, 4, 2, 1, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 1, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 1, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4
OFFSET
1,2
PROG
(Python 3.10+)
# if Python version < 3.10, replace i.bit_count() with bin(i).count('1')
from itertools import islice
def A352202_gen(): # generator of terms
yield 1
l1, s, b = 1, 2, set()
while True:
i = s
while True:
if i & l1 and not i in b:
yield i.bit_count()
l1 = i
b.add(i)
while s in b:
b.remove(s)
s += 1
break
i += 1
A352202_list = list(islice(A352202_gen(), 30)) # Chai Wah Wu, May 13 2022
CROSSREFS
Cf. A115510.
Sequence in context: A137866 A361200 A329888 * A266161 A072203 A345266
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Mar 27 2022
STATUS
approved