cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A259232 Smallest prime q > p such that q + p is a square, where p is the n-th prime.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Jun 22 2015

Keywords

Comments

Corresponding squares a(n)+prime(n): 9,16,16,36,64,36,36,576,64,100.
Also, a(n) >= A157480(n).

Crossrefs

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