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
(Python)
from sympy import nextprime
def a(n): return nextprime(nextprime(n)) - n
print([a(n) for n in range(97)]) # Michael S. Branicky, Mar 02 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Apr 29 2005
STATUS
approved