Page 1 of 1

Α perfect square

Posted: Mon Dec 21, 2015 9:49 am
by Tolaso J Kos
Find the first integer $n>1$ such that the average of

$$1^2, 2^2, 3^2, \dots, n^2$$

is itself a perfect square.

Re: Α perfect square

Posted: Thu Dec 24, 2015 3:04 pm
by Demetres
We know that the sum of all terms is \[ \frac{n(n+1)(2n+1)}{6}\] and thus their average is \[ \frac{(n+1)(2n+1)}{6}\]
Since $2$ must divide $(n+1)(2n+1)$ we must have $n = 2m-1$ for some natural number $m$. So we need $\displaystyle{ \frac{m(4m-1)}{3}}$ to be a perfect square.

Since $m$ and $4m-1$ are relatively prime (we have $4 \cdot m - 1 \cdot(4m-1) = 1$) one of them must be equal to $a^2$ and the other must be equal to $3b^2$ for some natural numbers $a,b$. Since $4m-1 \equiv 3\bmod 4$ cannot be a perfect square, we must have $m = a^2$ and $4m-1 = 3b^2$. These give the equation $(2a)^2 - 3b^2 = 1$.

So we need to find the smallest natural number $a > 1$ for which $(2a)^2 - 3b^2=1$ has integer solutions. [We do not allow $a=1$ as it gives $n=1$.]

We now look at the Pell equation $x^2-3y^2 = 1$. Its fundamental solution is $(x_1,y_1) = (2,1)$. All the other positive solutions are given by the recursive formulae $x_{k+1} = 2x_k+3y_k$ and $y_{k+1} = 2y_k + x_k$. So the first few positive solutions of the equation are $(2,1),(7,4),(26,15)$.

Thus the smallest natural number $a$ for which $(2a)^2-3b^2=1$ has integer solutions is $a=13$. This gives $m=13^2 = 169$ and $n = 2 \cdot 169-1 = 337$.