OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
For n = prime 7, nextprime(7+1) = 11 = a(7).
MATHEMATICA
Table[If[PrimeQ[n], NextPrime[n], n], {n, 80}] (* Harvey P. Dale, Jul 05 2019 *)
PROG
(PARI) f(n) = for(x=1, n, if(isprime(x), y=nextprime(x+1), y=x); print1(y", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Cino Hilliard, Aug 11 2004
STATUS
approved