OFFSET
2,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..10000
EXAMPLE
6^2=36 is immediately preceded and followed by 31 and 37, of which 6 is the difference.
MAPLE
[seq(nextprime(i^2)-prevprime(i^2), i=2..1000)];
MATHEMATICA
Table[n2=n^2; (NextPrime[n2]-NextPrime[n2, -1]), {n, 2, 100}] (* Vladimir Joseph Stephan Orlovsky, Mar 09 2011 *)
PROG
(PARI) A058043(n) = nextprime(n^2)-prime(primepi(n^2)) \\ Michael B. Porter, Feb 09 2010
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 17 2000
STATUS
approved