A377957 The number of iterations of the map x -> x + A001065(x) if A009194(x) = 1, x -> x / A009194(x) otherwise, starting from n, until reaching 1.
0, 8, 7, 6, 2, 1, 5, 4, 8, 3, 9, 8, 7, 6, 3, 14, 3, 2, 5, 4, 13, 10, 10, 9, 14, 8, 8, 1, 4, 3, 13, 12, 10, 4, 10, 9, 7, 6, 7, 7, 7, 6, 11, 10, 4, 11, 10, 9, 10, 14, 4, 9, 10, 9, 11, 6, 9, 5, 4, 3, 15, 14, 11, 14, 9, 10, 6, 5, 11, 11, 11, 10, 9, 8, 15, 6, 6, 8, 9, 8, 12, 8, 9, 8, 10, 12, 5
Offset: 1
Keywords
Examples
For n = 2 there are a(2) = 8 iterations to reach 1: 2 -> 3 -> 4 -> 7 -> 8 -> 15 -> 5 -> 6 -> 1. For n = 9 there are a(9) = 8 iterations to reach 1: 9 -> 13 -> 14 -> 7 -> 8 -> 15 -> 5 -> 6 -> 1.
Programs
-
Mathematica
f[n_] := Module[{s = DivisorSigma[1, n], g}, g = GCD[n, s]; If[g == 1, s, n/g]]; a[n_] := -1 + Length@ NestWhileList[f, n, # > 1 &]; Array[a, 100] (* Amiram Eldar, Nov 12 2024 *)