OFFSET
1,2
EXAMPLE
A002487(33) = 6 and this is the first time 6 appears, so a(6) = 33-1 = 32.
PROG
(Python)
from itertools import count
from functools import reduce
def A020950(n): return next(filter(lambda k:sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(k)[-1:2:-1], (1, 0)))==n, count(1)))-1 # Chai Wah Wu, May 05 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected and extended by David W. Wilson
STATUS
approved