OFFSET
2,1
COMMENTS
This sequence is a permutation of the composite numbers (A002808).
a(p) = p^2 for any prime p (see A001248).
a(2*k) = 2*k + 2 for any k > 1.
For any prime p and n >= 0, a^n(p)/p is the (n+1)-th p-rough number (where a^n denotes the n-th iterate of a).
See also A071830 for the largest prime factor equivalent.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 2..10000
MATHEMATICA
lpf[n_] := FactorInteger[n][[1, 1]]; a[n_] := Block[{k, p = lpf[n]}, k=n+p; While[lpf[k] != p, k += p]; k]; Array[a, 61, 2] (* Giovanni Resta, Jun 04 2017 *)
PROG
(PARI) a(n) = my (l=factor(n)[1, 1]); forstep (v=n+l, oo, l, if (factor(v)[1, 1]==l, return (v)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jun 03 2017
STATUS
approved