OFFSET
1,4
COMMENTS
If n > 1, then locate the node which contains n in binary tree A245612 (or in its mirror-image A244154) and traverse from that node towards the root [by iterating the map n -> A285712(n)], at the same time counting all numbers of the form 3k+1 that occur on the path, down to the final 1. This count includes also n itself if it is of the form 3k+1, with k > 0 (thus a(1) = 0).
LINKS
FORMULA
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 20 2017
STATUS
approved