login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A259232
Smallest prime q > p such that q + p is a square, where p is the n-th prime.
3
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,1
COMMENTS
Corresponding squares a(n)+prime(n): 9,16,16,36,64,36,36,576,64,100.
Also, a(n) >= A157480(n).
MATHEMATICA
Table[p=Prime[n]; x=1+Floor[Sqrt[2*p]]; While[!PrimeQ[q=x^2-p], x++]; q, {n, 100}]
PROG
(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
CROSSREFS
Sequence in context: A066003 A115858 A114389 * A329017 A243389 A242584
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 22 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 21 03:08 EDT 2024. Contains 376079 sequences. (Running on oeis4.)