login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A013632 a(n) = nextprime(n)-n. 29
2, 1, 1, 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 2, 1, 6, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 2, 1, 6, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 6, 5, 4, 3, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

Alternatively, a(n) = smallest k such that n+k is prime. - N. J. A. Sloane, Nov 18 2015

Except for a(0) and a(1), a(n) is the least k such that the GCD( n!, n+k) = 1. - Robert G. Wilson v, Nov 05 2010

This sequence uses the "strictly larger" variant A151800 of the nextprime function, rather than A007918. Therefore all terms are positive and a(n)=1 iff n+1 is a prime. - M. F. Hasler, Sep 09 2015

LINKS

Table of n, a(n) for n=0..104.

Brăduţ Apostol, Laurenţiu Panaitopol, Lucian Petrescu, László Tóth, Some properties of a sequence defined with the aid of prime numbers, arXiv:1503.01086 [math.NT], 2015.

MAPLE

[ seq(nextprime(i)-i, i=0..100) ];

MATHEMATICA

f[n_] := NextPrime@n - n; Array[f, 105, 0] (* Robert G. Wilson v, Nov 05 2010 *)

PROG

(PARI) a(n) = nextprime(n+1) - n; \\ Michel Marcus, Mar 04 2015

CROSSREFS

Cf. A007918, A151800.

Sequence in context: A049843 A131374 A207409 * A080121 A122901 A001917

Adjacent sequences:  A013629 A013630 A013631 * A013633 A013634 A013635

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane.

EXTENSIONS

Incorrect comment removed by Charles R Greathouse IV, Mar 18 2010

More terms from Robert G. Wilson v, Nov 05 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified November 19 01:27 EST 2017. Contains 294912 sequences.