login
A359226
a(n) is the least k >= 0 such that A006370^k(A070167(n)) = n (where A006370^k denotes the k-th iterate of A006370).
2
0, 0, 0, 5, 2, 0, 0, 4, 0, 1, 2, 0, 7, 2, 0, 3, 4, 0, 0, 9, 0, 1, 2, 0, 0, 6, 0, 1, 2, 0, 5, 2, 0, 3, 4, 0, 0, 2, 0, 8, 2, 0, 0, 4, 0, 1, 7, 0, 5, 2, 0, 5, 6, 0, 0, 2, 0, 1, 2, 0, 92, 4, 0, 1, 2, 0, 7, 2, 0, 3, 9, 0, 0, 7, 0, 1, 2, 0, 0, 8, 0, 1, 2, 0, 5, 2, 0
OFFSET
1,4
COMMENTS
If we travel the Collatz tree backwards, we will observe no further branching, whenever we have reached a number divisible by three. This is the reason why a(n) will be zero in all cases where n is divisible by three, because in this case no smaller number can exist further upward in the Collatz tree, as the actual branch will progress in numbers of the form 3*m*2^k. - Thomas Scheuerle, Dec 22 2022
FORMULA
a(n) = 0 iff n belongs to A177729.
If a(n) > 0 and n is odd, then a(n*3+1) - a(n) = 1. If a(n) > 0 and n is even, then a(n*3+1) - a(n*6+2) = 1. - Thomas Scheuerle, Dec 22 2022
EXAMPLE
The Collatz sequence starting from 1 is: 1.
So a(1) = 0.
The Collatz sequence starting from 2 is: 2, 1.
So a(2) = 0.
The Collatz sequence starting from 3 is: 3, 10, 5, 16, 8, 4, 2, 1.
So a(3) = 0, a(10) = 1, a(5) = 2, a(16) = 3, a(8) = 4, a(4) = 5.
MATHEMATICA
nn = 87; c[_] = -1; c[0] = 0; Do[(MapIndexed[If[c[#1] == -1, Set[c[#1], First[#2] - 1]] &, #]; -1 + Length[#]) &@ NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, c[#] == -1 && # > 1 &], {n, 0, nn}]; Array[c, nn] (* Michael De Vlieger, Dec 23 2022 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Dec 22 2022
STATUS
approved