A105593 Number of steps for n to join the main line of A003508.
0, 0, 0, 0, 2, 1, 0, 0, 3, 1, 0, 0, 2, 1, 1, 7, 1, 0, 6, 5, 7, 2, 1, 0, 8, 1, 8, 4, 1, 0, 7, 6, 5, 4, 5, 1, 4, 3, 5, 5, 0, 0, 12, 11, 4, 1, 5, 4, 11, 11, 1, 10, 4, 3, 0, 4, 10, 10, 3, 2, 10, 9, 2, 11, 2, 3, 10, 9, 9, 2, 1, 0, 2, 1, 2, 1, 9, 0, 10, 9, 2, 2, 2, 1, 1, 5, 7, 8, 10, 9, 23, 4, 7, 4, 7, 8, 0, 0, 1
Offset: 1
Keywords
Examples
a(5)=2 because 5=>6=>12 and 12 is the eighth term of A003508.
Crossrefs
Cf. A003508.
Programs
-
Mathematica
a[1] = 1; a[n_] := a[n] = a[n - 1] + 1 + Plus @@ Select[ Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[a[n - 1]]], # < a[n - 1] &]; Table[a[n], {n, 100}]; f[n_] := Module[{b, k = 1, t = Table[a[i], {i, 100}]}, b[1] = n; b[m_] := b[m] = b[m - 1] + 1 + Plus @@ Select[ Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[b[ m - 1]]], # < b[m - 1] &]; While[ Position[t, b[k]] == {}, k++ ]; k - 1]; Table[ f[n], {n, 105}]
Comments