Solution (source code)

= Solution

For $N$ equal intervals, the <composite trapezoidal rule> is
$$
T_N=\frac1N\left[\frac12+\sum_{n=1}^{N-1}\left(\frac nN\right)^2\right]
=\frac1{N^3}\sum_{n=1}^{N-1}n^2+\frac1{2N}.
$$
Adding the missing $N^2/N^3$ term therefore gives the exact relation
$$
\frac1{N^3}\sum_{n=1}^N n^2=T_N+\frac1{2N}.
$$
Since $x^2$ is continuous, its <Riemann sums>, and hence its endpoint-averaged trapezoidal sums, converge to its <definite integral>. Thus $T_N\to1/3$ and $1/(2N)\to0$, giving
$$
\boxed{\lim_{N\to\infty}\frac1{N^3}\sum_{n=1}^N n^2=\frac13.}
$$
No pre-existing formula for the sum of squares is needed.