OFFSET
1,5
COMMENTS
a(n)=0 if n is a member of A003508. First term whose value is in question is 393.
EXAMPLE
a(5)=2 because 5=>6=>12 and 12 is the eighth term of A003508.
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}]
CROSSREFS
KEYWORD
nonn
AUTHOR
R. K. Guy and Robert G. Wilson v, Apr 13 2005
STATUS
approved