login
A375311
a(1) = 0; for n >= 2, a(n) is the number of iterations needed for the map: x -> x / k if x is divisible by k, x -> x + 1 otherwise, to (the first occurrence of) 1. Divisor k starts at 2 and its value is increased by 1 after each division.
1
0, 1, 4, 3, 3, 2, 8, 7, 7, 6, 6, 5, 7, 6, 6, 5, 5, 4, 6, 5, 5, 4, 4, 3, 13, 12, 12, 11, 11, 10, 12, 11, 11, 10, 10, 9, 11, 10, 10, 9, 9, 8, 10, 9, 9, 8, 8, 7, 12, 11, 11, 10, 10, 9, 11, 10, 10, 9, 9, 8, 10, 9, 9, 8, 8, 7, 9, 8, 8, 7, 7, 6, 11, 10, 10, 9, 9, 8
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
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
Cf. A000142.
Sequence in context: A016502 A305743 A117691 * A243564 A358329 A171627
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Aug 11 2024
STATUS
approved