login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A014683
In the sequence of positive integers add 1 to each prime number.
10
1, 3, 4, 4, 6, 6, 8, 8, 9, 10, 12, 12, 14, 14, 15, 16, 18, 18, 20, 20, 21, 22, 24, 24, 25, 26, 27, 28, 30, 30, 32, 32, 33, 34, 35, 36, 38, 38, 39, 40, 42, 42, 44, 44, 45, 46, 48, 48, 49, 50, 51, 52, 54, 54, 55, 56, 57, 58, 60, 60, 62, 62, 63, 64, 65, 66, 68, 68, 69, 70, 72, 72
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
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
Sequence in context: A215250 A354154 A229022 * A213222 A166737 A088847
KEYWORD
nonn,easy
EXTENSIONS
More terms from Erich Friedman.
STATUS
approved