login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A367627
a(n) = log_2(A367626(n)).
4
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,5
COMMENTS
First differences of A036991 are powers of 2 (see A036991 and A367626).
LINKS
PROG
(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
CROSSREFS
Sequence in context: A230404 A378725 A082647 * A214018 A304869 A161071
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 25 2023
STATUS
approved