OFFSET
1,3
COMMENTS
The trajectory length a(n) to (the first occurrence of) 1 is a(n) = r + 1 - n mod 2 + T, where r is the least number such that r! >= n and T is a sum of coefficients c_i in (r! - n - 2 + n mod 2) = c_1*2! + c_2*3! + ... + c_(r-1)*(r-1)!, where 1 <= c_i <= c_(i+1). It resembles the "sum of digits in the factorial base".
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n!) = n - 1.
EXAMPLE
n = 9: k = 2, 9 --> 10 --> 5 --> 6 --> 2 --> 3 --> 4 --> 1, thus a(9) = 7.
n = 24: k = 2, 24 --> 12 --> 4 --> 1, thus a(24) = 3.
MATHEMATICA
a[n_] := Module[{x = n, k = 2, c = 0}, While[x > 1, x = If[Divisible[x, k], x/k++, x + 1]; c++]; c]; Array[a, 100] (* Amiram Eldar, Aug 11 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Aug 11 2024
STATUS
approved