OFFSET
1,1
COMMENTS
Let S(n,k) = (n+1)^2 + (n+2)^2 +... + (n+k)^2, n>=0, k>=2. S(n,k) is always composite for k=4 (2 | S), k=5 (5 | S), and k >= 7 (see A256503). So a(n) is the sum of 2, 3, or 6 consecutive squares. The smallest a(n) that cannot be written as a sum of fewer than 6 consecutive squares is a(7)=139. - Vladimir Shevelev, Apr 08 2015
LINKS
Donovan Johnson, Table of n, a(n) for n = 1..1000
EXAMPLE
5 = 1^2 + 2^2.
13 = 2^2 + 3^2.
29 = 2^2 + 3^2 + 4^2.
MATHEMATICA
lst = {}; Do[p = m^2; Do[p += n^2; If[PrimeQ[p] && p <= 101701, AppendTo[lst, p]], {n, m + 1, 6!, 1}], {m, 6!}]; Take[Union@lst, 5! (* Vladimir Joseph Stephan Orlovsky, Sep 15 2009 *)
Select[Union[Flatten[Table[Total/@Partition[Range[100]^2, n, 1], {n, 2, 10}]]], PrimeQ] (* Harvey P. Dale, Mar 12 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gaurav Kumar, Jul 23 2009
EXTENSIONS
Offset corrected by Donovan Johnson, Nov 05 2012
STATUS
approved