Find the first number such that the average of the sum of the squares from $1$ to $n$ (where $n > 1$) equals $k^2$.
Here is what I have done so far:
The sentence is equivalent to saying that $\frac{\sum_{r=1}^{n}r^2}{n} = k^2$. Knowing the sum of the squares formula, the average of the sum of the squares is $\frac{(n+1)(2n+1)}{6}$. Equating it to $k^2$ and simplifying leads to $2n^2 + 3n + 1 = 6k^2$. This is where I am stuck at. I have tried everything in regards to algebraic tricks and manipulation. Does anybody know any methods or techniques from https://archive.ukmt.org.uk/docs/BMO%20Preparation%20Sheet.pdf that would help?
Multiply your last equation by 8 and write it as $(4n+3)^2 - 48k^2 = 1$.
If $(X,Y)$ is a positive solution of the Brahmagupta equation $X^2 - 48Y^2 = 1$, then $X+4Y\sqrt{3} = (7+4\sqrt{3})^k$ for some positive integer $k$. The smallest is for $k=1$, when you would get $n=1$; the next smallest solution where $X$ is 3 mod 4 corresponds to $k=3$: $(7+4\sqrt{3})^3 = 1351+780\sqrt{3}$ and from $4n+3 = 1351$ you get $n = 337$.