OFFSET
0,3
COMMENTS
In other words, after a(0) = 0, if n is the k-th lucky number [i.e., n = A000959(k)], a(n) = 1 + 2*a(k-1); otherwise, when n is the k-th unlucky number [i.e., n = A050505(k)], a(n) = 2*a(k).
Because all lucky numbers are odd, it means that odd numbers occur in odd positions only (together with some even numbers, for each one of which there is a separate infinite cycle), while the even positions contain only even numbers.
LINKS
FORMULA
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 06 2015
EXTENSIONS
Formula in name corrected by Antti Karttunen, Jan 10 2016
STATUS
approved