Example 9 Find the smallest positive integer $n(n>1)$, such that $\sqrt{\frac{1}{n} \sum_{i=1}^{n} i^{2}}$ is an integer.
(2017, Singapore Mathematical Olympiad)
Let $\sqrt{\frac{1}{n} \sum_{i=1}^{n} i^{2}}=m$. Then $(n+1)(2 n+1)=6 m^{2}$.
It is easy to see that $n$ is odd.
Let $n=2 k-1$. Then $k(4 k-1)=3 m^{2} \Rightarrow 3 \mid k$ or $3 \mid(4 k-1)$.
(1) If $3 \mid k$, let $k=3 t$, then $m^{2}=t(12 t-1)$.
Since $(t, 12 t-1)=1$, $t$ and $12 t-1$ are both perfect squares.

But $12 t-1 \equiv-1(\bmod 4)$ contradicts $12 t-1$ being a perfect square.
(2) If $3 \mid(4 k-1)$, then
$k \equiv 1(\bmod 3)$.
Let $k=3 t+1$, we get $m^{2}=(3 t+1)(4 t+1)$.
Since $(3 t+1,4 t+1)=1$, $3 t+1$ and $4 t+1$ are both perfect squares, and $4 t+1$ is the square of an odd number.
Let $4 t+1=(2 s+1)^{2}$. Then $t=s(s+1)$.
Let $3 t+1=3 s(s+1)+1=r^{2}$. Then $r$ is odd and not a multiple of 3.
Let $r=6 p \pm 1$. Then $s(s+1)=4 p(3 p \pm 1)$.
By testing $p=0,1,2$, we find that $p=2$ gives the smallest value of $s$, which is 7, at this time, $n=337$.

[Analysis] First, repeatedly use the congruence properties of perfect squares to derive the necessary conditions that $n$ must satisfy, then obtain the minimum value through "individual verification". This is a common strategy for solving extremal problems in number theory.