OFFSET
1,2
COMMENTS
For n >= 3, a(n) = smallest composite number m such that m - (n-2) is a prime. - Amarnath Murthy and Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Mar 08 2003
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n + pi(n) - pi(n-1). - Wesley Ivan Hurt, Jun 15 2013
a(n) = n + A010051(n). - Reinhard Zumkeller, Nov 01 2014
MATHEMATICA
Array[If[PrimeQ[#], #+1, #]&, 80] (* Harvey P. Dale, Jul 21 2013 *)
PROG
(PARI) a(n)=n+isprime(n)
(Haskell)
a014683 n = n + a010051' n -- Reinhard Zumkeller, Nov 01 2014
(Python)
from sympy import isprime
def A014683(n): return n+isprime(n) # Chai Wah Wu, Oct 03 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Erich Friedman.
STATUS
approved