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.

A073887 Smallest prime p such that sum of p and the next n-1 primes is a perfect square, or 1 if no such prime exists.

Original entry on oeis.org

1, 17, 13, 5, 181, 587, 13, 163, 2, 13789, 1013, 163, 653, 11, 3931, 397, 2039, 439, 4447, 1217, 269, 1733, 3, 5, 2239, 197, 3, 1061, 14563, 1901, 3, 149, 359, 2137, 67, 433, 11, 907, 2339, 673, 19181, 11593, 89, 6883, 3, 28571, 997, 43, 3559, 2287, 1931
Offset: 1

Views

Author

Amarnath Murthy, Aug 17 2002

Keywords

Examples

			a(5) = prime(42) = 181 because 181+191+193+197+199 = 961 = (31)^2.
		

Programs

  • PARI
    a(n) = {if (n==1, return (1)); forprime(p=2, , k = primepi(p); if (issquare(sum(i=k, k+n-1, prime(i))), return (p)););} \\ Michel Marcus, Dec 13 2014

Formula

Let p(k) be the k-th prime: p(1)=2, p(2)=3 etc. Define a(1)=1 and a(n)=p(k) such that p(k)+p(k+1)+...+p(k+n-1)=m^2 and there is no prime

Extensions

Edited and extended by Bruce Corrigan (scentman(AT)myfamily.com), Oct 20 2002
a(10) and a(21)-a(51) from Donovan Johnson, May 08 2010
Obsolete comment deleted by Zak Seidov, Dec 13 2014
Typo in Name fixed by Zak Seidov, Jul 07 2015