

A073887


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


2



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS



FORMULA

Let p(k) be the kth 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+n1)=m^2 and there is no prime <p(k) such that this is true; or set a(n) = 0 if no such p(k) exists.


EXAMPLE

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


PROG

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


CROSSREFS



KEYWORD

nonn


AUTHOR



EXTENSIONS

Edited and extended by Bruce Corrigan (scentman(AT)myfamily.com), Oct 20 2002
Obsolete comment deleted by Zak Seidov, Dec 13 2014


STATUS

approved



