OFFSET
1,2
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
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 <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+n-1, prime(i))), return (p)); ); } \\ Michel Marcus, Dec 13 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 17 2002
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
STATUS
approved