login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A105161 Difference between n and the second-smallest prime larger than n. 1
3, 2, 3, 4, 3, 6, 5, 6, 5, 4, 3, 6, 5, 6, 5, 4, 3, 6, 5, 10, 9, 8, 7, 8, 7, 6, 5, 4, 3, 8, 7, 10, 9, 8, 7, 6, 5, 6, 5, 4, 3, 6, 5, 10, 9, 8, 7, 12, 11, 10, 9, 8, 7, 8, 7, 6, 5, 4, 3, 8, 7, 10, 9, 8, 7, 6, 5, 6, 5, 4, 3, 8, 7, 10, 9, 8, 7, 6, 5, 10, 9, 8, 7, 14, 13, 12, 11, 10, 9, 12, 11, 10, 9, 8, 7, 6, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

LINKS

Charles R Greathouse IV, Table of n, a(n) for n = 0..10000

FORMULA

a(n) = prime(pi(n)+2) - n.

MAPLE

with(numtheory); A105161:=n->ithprime(pi(n) + 2); seq(A105161(n), n=0..100); # Wesley Ivan Hurt, Feb 26 2014

MATHEMATICA

Table[Prime[PrimePi[n] + 2], {n, 0, 100}] (* Wesley Ivan Hurt, Feb 26 2014 *)

PROG

(PARI) a(n) = prime(primepi(n)+2) - n; \\ Michel Marcus, Oct 09 2013

(PARI) a(n)=nextprime(nextprime(n+1)+1)-n \\ Charles R Greathouse IV, Oct 09 2013

CROSSREFS

Cf. A101300.

Sequence in context: A093407 A147658 A221529 * A275769 A094365 A272886

Adjacent sequences:  A105158 A105159 A105160 * A105162 A105163 A105164

KEYWORD

nonn,easy

AUTHOR

Zak Seidov, Apr 29 2005

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 30 16:16 EDT 2020. Contains 333127 sequences. (Running on oeis4.)