A161920 a(n) = A161511(A004760(n)).
1, 2, 4, 3, 6, 5, 6, 4, 8, 7, 8, 6, 9, 7, 8, 5, 10, 9, 10, 8, 11, 9, 10, 7, 12, 10, 11, 8, 12, 9, 10, 6, 12, 11, 12, 10, 13, 11, 12, 9, 14, 12, 13, 10, 14, 11, 12, 8, 15, 13, 14, 11, 15, 12, 13, 9, 16, 13, 14, 10, 15, 11, 12, 7, 14, 13, 14, 12, 15, 13, 14, 11, 16, 14, 15, 12, 16
Offset: 1
Keywords
Programs
-
Python
def A161920(n): a, b = 1+(m:=n-1).bit_length(), 1 for i, j in enumerate(bin(m)[:1:-1], 1): if int(j): a += i-b b += 1 return a # Chai Wah Wu, Jul 26 2023
Extensions
Edited and extended by Antti Karttunen, Oct 12 2009
Comments