login
a(n) = binary weight of A115510(n).
0

%I #10 May 14 2022 11:26:31

%S 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,

%T 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,

%U 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

%N a(n) = binary weight of A115510(n).

%o (Python 3.10+)

%o # if Python version < 3.10, replace i.bit_count() with bin(i).count('1')

%o from itertools import islice

%o def A352202_gen(): # generator of terms

%o yield 1

%o l1, s, b = 1, 2, set()

%o while True:

%o i = s

%o while True:

%o if i & l1 and not i in b:

%o yield i.bit_count()

%o l1 = i

%o b.add(i)

%o while s in b:

%o b.remove(s)

%o s += 1

%o break

%o i += 1

%o A352202_list = list(islice(A352202_gen(),30)) # _Chai Wah Wu_, May 13 2022

%Y Cf. A115510.

%K nonn,base

%O 1,2

%A _N. J. A. Sloane_, Mar 27 2022