OFFSET
1,2
COMMENTS
a(n) = 0 when n == 0 (mod 3) since such an n has no odd predecessor (only n*2^x). But n !== 0 (mod 3) always has some odd predecessor > n.
LINKS
EXAMPLE
a(2) = 3, because 3 is the smallest odd number > 2 that has 2 as a successor: 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2.
a(3) = 0 because 3 is not a successor of anything. A060565 contains no 3, nor multiples of 3.
a(11) = 19, because the trajectories of 13, 15, 17 don't contain 11, and 11 is a successor of 19:
13 -> 40..5 -> 16..1;
15 -> 46..23 -> 70..35 -> 106..53 -> 160..5 -> 16..1;
17 -> 52..13;
19 -> 58..29 -> 88..11.
PROG
(PARI) a(n)= if(1==n, return(1)); if(!(n%3), return(0)); my(v0=if(n%2, n+2, n+1)); while(1, my(v=v0); while(v>1 && v!=n, v=if(v%2, 3*v+1, v/2)); if(v==n, return(v0)); v0+=2)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ruud H.G. van Tol, Jan 22 2022
STATUS
approved