Example 1 Find the smallest positive integer $n(n \geqslant 2)$, such that $\sqrt{\frac{1^{2}+2^{2}+\cdots+n^{2}}{n}}$ is an integer.
Let $\sqrt{\frac{1^{2}+2^{2}+\cdots+n^{2}}{n}} = \sqrt{\frac{(n+1)(2 n+1)}{6}} = x$, i.e., $6 x^{2} = (n+1)(2 n+1)$. Considering modulo 6, we have $n \equiv \pm 1 \pmod{6}$.

If $6 \mid n+1$, then let $n = 6m - 1$, we get $x^{2} = m(12m - 1)$. Since $(m, 12m - 1) = 1$, both $m$ and $12m - 1$ must be perfect squares. However, $12m - 1 \equiv 3 \pmod{4}$, which is a contradiction!

If $6 \mid n-1$, then let $n = 6m + 1$, we get $x^{2} = (3m + 1)(4m + 1)$. Since $(3m + 1, 4m + 1) = 1$, both $3m + 1$ and $4m + 1$ must be perfect squares. Let $3m + 1 = v^{2}$ and $4m + 1 = u^{2}$. Eliminating $m$ gives $4v^{2} - 3u^{2} = 1$. When $v = u = 1$, $n = 1$ is not a valid solution.

Since $v$ is odd, checking shows that the smallest $v = 13$, at which point $u = 15$, $m = 56$, and $n = 337$.