OFFSET
1,2
COMMENTS
a(n) gives the one-based position of the first nonzero term on the row n-1 of A126441.
Sequence A016116 can be used to identify the extracted subsequence by computing the number of terms to alternately extract and skip. [This comment is from the original submitter. I don't understand it. - Antti Karttunen, Oct 12 2009]
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Alford Arnold, Jun 24 2009
EXTENSIONS
Edited and extended by Antti Karttunen, Oct 12 2009
STATUS
approved