OFFSET
1,1
COMMENTS
a(14) > 16*10^6. - David A. Corneth, Jun 12 2017
LINKS
David A. Corneth, Table of n, a(n) for n = 1..213
David A. Corneth, Table of n, a(n) for n = 1..302 where a(n) <= (about) 16*10^6
EXAMPLE
n=5: a(5)=12 because the primes closest to 12^2 = 144 are {139,149} whose difference 149 - 139 = 10 = 2n and 144 is the smallest square with this property;
n=1: a(1)=2 because 2^2=4 is surrounded by primes {3,5} with difference 5 - 3 = 2 = 2n.
MATHEMATICA
de[x_ := Prime[PrimePi[x]+1]-Prime[PrimePi[x]] t=Table[de[w^2], {w, 1, 50000}]; mt=Table[Min[Flatten[Position[t, 2*j]]], {j, 1, 100}]
PROG
(PARI) first(n) = my(todo = n, res = vector(n), p, x = 2); while(todo > 0, m = nextprime(x^2) - precprime(x^2); if(m <= 2*n, if(res[m/2]==0, res[m/2] = x; todo--)); x++); res \\ David A. Corneth, Jun 12 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jan 09 2004
STATUS
approved