When is the sum of consecutive squares a prime? For what integers $x$ do there exist $x$ consecutives integers, the sum of whose squares is prime?
I tried use $$1^2+2^2+...+n^2=\frac {n(n+1)(2n+1)}{6}$$

Let our numbers be $a^2,(a+1)^2,\dots,(a+x-1)^2$. The sum of the squares is $a^2 x+2a(1+\cdots+(x-1))+(1^2+\cdots+(x-1)^2)$.
Note that $a^2 x$ is divisible by $x$, as is $2a(1+\cdots+(x-1))$. So we concentrate on the term $1^2+2^2+\cdots+x^2$. Call this number $N$. By the formula quoted in the post, we have 
$$6N=(x-1)(x)(2x-1).$$
Suppose that $x\gt 6$. Then $N$ has a factor $d\gt 1$ such that $d\mid x$. We show that $d$ is a proper divisor of $a^2+(a+1)^2+\cdots +(a+x-1)^2$. This is because 
$$a^2+(a+1)^2 +\cdots +(a+x-1)^2 \gt \left(\frac{x-1}{2}\right)^2,$$
and $\left(\frac{x-1}{2}\right)^2\gt x$ if $x\gt 6$. Thus all candidate $x$ are in the interval from $1$ to $6$. 
We can rule out $x=4$, since in that case our sum of squares is even, and clearly cannot be $2$. 
We can also rule out $x=5$, because if $x=5$ then $5$ divides $N$, and it is easy to verify that a sum of $5$ consecutive squares must be greater than $5$.
That leaves $x=1$ (no good), $x=2$, $x=3$, and $x=6$. For each of $x=2$, $x=3$, and $x=6$, we can produce examples of a sum of squares of $x$ consecutive integers which is prime. The simplest example for $x=3$ uses the consecutive integers $-1$, $0$, and $1$. The simplest example for $x=6$ uses $-2,-1,0,1,2,3$. There are also examples with all entries positive.
It is not known whether there are infinitely many solutions. 
