A377403 For n >= 2, a(n) is the number of iterations needed for the map: x -> x / A085392(x) if A085392(x) > 1, otherwise x -> x + A151800(x), to (the first occurrence of) 2.
0, 3, 1, 3, 1, 3, 2, 4, 1, 4, 2, 3, 1, 4, 3, 4, 2, 3, 2, 4, 1, 3, 3, 4, 1, 5, 2, 4, 2, 3, 4, 4, 1, 4, 3, 3, 1, 4, 3, 4, 2, 4, 2, 5, 1, 4, 4, 4, 2, 4, 2, 5, 3, 4, 3, 4, 1, 5, 3, 7, 1, 5, 5, 4, 2, 3, 2, 4, 2, 6, 4, 4, 1, 5, 2, 4, 2, 5, 4, 6, 1, 3, 3, 4, 1, 4, 3, 3, 3, 4, 2, 4, 1, 4, 5, 4, 2, 5, 3, 4, 2, 4, 3, 5, 1, 6, 4, 3, 2, 4, 4, 6, 2, 4, 2, 5, 1, 4, 4, 5
Offset: 2
Keywords
Examples
n = 3: 3 -> 8 -> 4 -> 2, 3 iterations needed to reach 2, thus a(3) = 3. n = 9: 9 -> 3 -> 8 -> 4 -> 2, 4 iterations needed to reach 2, thus a(9) = 4. n = 11: 11 -> 24 -> 8 -> 4 - > 2, 4 iterations needed to reach 2, thus a(11) = 4.
Programs
-
Mathematica
a[2] = 0; a[n_] := -1 + Length@ NestWhileList[If[CompositeQ[#], #/FactorInteger[#][[-1, 1]], # + NextPrime[#]] &, n, # > 2 &]; Array[a, 120, 2] (* Amiram Eldar, Oct 27 2024 *)
Comments