A259232 Smallest prime q > p such that q + p is a square, where p is the n-th prime.
7, 13, 11, 29, 53, 23, 19, 557, 41, 71, 113, 107, 59, 101, 53, 271, 137, 83, 257, 73, 251, 821, 113, 107, 227, 223, 797, 149, 467, 211, 197, 193, 263, 761, 251, 173, 167, 1601, 233, 227, 397, 719, 293, 383, 379, 701, 1553, 353, 257, 347, 251, 337, 659, 773, 419, 313, 307, 1493, 1019, 503, 293
Offset: 1
Keywords
Links
- Zak Seidov, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[p=Prime[n];x=1+Floor[Sqrt[2*p]];While[!PrimeQ[q=x^2-p],x++];q,{n,100}]
-
PARI
a(n)=p = prime(n); k = nextprime(p+1); while(!issquare(p+k), k = nextprime(k+1)); k; \\ Michel Marcus, Jun 22 2015
-
PARI
a(n,p=prime(n))=my(s=sqrtint(2*p)); while(!isprime(s++^2-p),); s^2-p \\ Charles R Greathouse IV, May 06 2016
Comments