A367627 a(n) = log_2(A367626(n)).
0, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 4, 3, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 4, 3, 2, 1, 1, 3, 2, 1, 1, 2
Offset: 1
Keywords
Links
- Hugo Pfoertner, Table of n, a(n) for n = 1..10000
Programs
-
Python
from itertools import count, islice def A367627_gen(): # generator of terms a = 0 yield 0 for n in count(1): s = bin(n)[2:] c, l = 2, len(s) for i in range(1,l+1): if (c:=c+(2 if s[l-i]=='1' else 0)) <= i: break else: yield (n-a).bit_length() a = n A367627_list = list(islice(A367627_gen(),30)) # Chai Wah Wu, Nov 28 2023
Comments