Problem with square number I have a doubt with this problem :
"Show that there exist an infinite number of integers $n$ such that $$P(n)=\frac{\sum_{k=0}^{n}k^{2}}{n}=\frac{1^{2}+2^{2}+\cdots+n^{2}}{n}$$ is square number."
I find that $P(n)$ is integer if $n$ is prime number.
Sincerely,

The formula for the sum of the first $n$ square numbers is given by
$$1^2+2^2+...+n^2=\frac{n(n+1)(2n+1)}{6}$$
Meaning that
$$P(n)=\frac{\frac{n(n+1)(2n+1)}{6}}{n}$$
$$P(n)=\frac{(n+1)(2n+1)}{6}$$
So now you just need to find out when 
$$\frac{(n+1)(2n+1)}{6}$$
is a perfect square. Now let $a$ and $b$ be some two numbers (not necessarily integers) so that $ab=6$. Then $P(n)$ is a perfect square whenenver
$$\frac{n+1}{a}=\frac{2n+1}{b}$$
which can be solved for $n$ to get
$$n=\frac{b-a}{2a-b}$$
Now, by substitution, since $ab=6$, we have that
$$n=\frac{\frac{6}{a}-a}{2a-\frac{6}{a}}$$
$$n=\frac{6-a^2}{2a^2-6a}$$
Now all you need to do is show that there are an infinite number of numbers (not necessarily integers) $a$ so that
$$n=\frac{6-a^2}{2a^2-6}$$
is an integer. 
