OFFSET

1,2

EXAMPLE

a(22) = 29 because the smallest prime number not a divisor of 22 is 3, and 22+3=25, and 25 is composite, and the smallest prime number not a divisor of 25 is 2, and 25+2=27, and 27 is composite, and the smallest prime number not a divisor of 27 is 2, and 27+2=29, a prime number.

PROG

(PARI) a(n) = {if ((n==1) || isprime(n), return(n)); k = n; while (! isprime(k), p = 2; while (! (k % p), p = nextprime(p+1)); k += p; ); k; } \\ Michel Marcus, Apr 27 2014

CROSSREFS

KEYWORD

nonn

AUTHOR

J. Lowell, Apr 15 2014

EXTENSIONS

More terms from Michel Marcus, Apr 27 2014

STATUS

approved