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”).

A332894
a(1) = 0, a(2n) = 1 + a(n), a(2n+1) = 1 + a(A332819(2n+1)); also binary width of terms of A332816.
5
0, 1, 2, 2, 3, 3, 4, 3, 3, 4, 6, 4, 5, 5, 4, 4, 7, 4, 8, 5, 5, 7, 10, 5, 4, 6, 4, 6, 9, 5, 12, 5, 7, 8, 5, 5, 11, 9, 6, 6, 13, 6, 14, 8, 5, 11, 16, 6, 5, 5, 8, 7, 15, 5, 7, 7, 9, 10, 18, 6, 17, 13, 6, 6, 6, 8, 20, 9, 11, 6, 22, 6, 19, 12, 5, 10, 7, 7, 24, 7, 5, 14, 26, 7, 8, 15, 10, 9, 21, 6, 6, 12, 13, 17, 9, 7, 23, 6, 8, 6, 25, 9, 28, 8, 6
OFFSET
1,3
COMMENTS
a(n) tells how many iterations of A332893 are needed before 1 is reached, i.e., the distance of n from 1 in binary trees like A332815.
Each n > 0 occurs 2^(n-1) times in total.
LINKS
FORMULA
a(n) = A252464(A332808(n)).
a(1) = 0, and for n > 1, a(n) = 1 + a(A332893(n)).
For n >= 1, a(A108546(n)) = n; for all n >= 0, a(2^n) = n.
For n > 1: (Start)
a(n) = 1 + a(n/2) if n is even, and a(n) = 1 + a(A332819(n)), if n is odd.
a(n) = A070939(A332816(n)).
a(n) >= A332899(n).
(End)
PROG
(PARI) A332894(n) = if(1==n, 0, if(!(n%2), 1+A332894(n/2), 1+A332894(A332819(n))));
(PARI) A332894(n) = if(1==n, 0, 1+A332894(A332893(n)));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 04 2020
STATUS
approved