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.

A157480 a(n) = least prime p such that p + prime(n) is a square.

Original entry on oeis.org

2, 13, 11, 2, 5, 3, 19, 17, 2, 7, 5, 107, 23, 101, 2, 11, 5, 3, 257, 29, 71, 2, 17, 11, 3, 43, 41, 37, 467, 31, 17, 13, 7, 5, 47, 173, 167, 1601, 2, 23, 17, 719, 5, 3, 59, 701, 113, 2, 29, 347, 23, 17, 83, 5, 67, 61, 131, 53, 47, 43, 41, 31, 17, 13, 11, 7, 569, 239, 53, 227, 47, 2
Offset: 1

Views

Author

Cino Hilliard, Mar 01 2009

Keywords

Examples

			The difference between prime 3 and the square 16 is 13 which is prime and in the sequence.
		

Programs

  • Mathematica
    Table[p=Prime[n];b=Ceiling[Sqrt[p]];While[!PrimeQ[x=b^2-p],b++];x,{n,72}]
  • PARI
    g(n)= c=0;forprime(x=2,n,for(k=1,n^2,if(issquare(x+k)&&isprime(k),
    print1(k",");c++;break)));c

Extensions

Better definition and Mma program from Zak Seidov, Mar 14 2013