Ta có :\(S_n=1^2+2^2+3^2+...+n^2=\dfrac{n\left(n+1\right)\left(2n+1\right)}{6}\left(n\in N^{\cdot}\right)\)
\(\Rightarrow S_{n-1}=1^2+2^2+3^2+...+\left(n-1\right)^2=\dfrac{\left(n-1\right)\left(n-1+1\right)\left(2n-2+1\right)}{6}=\dfrac{n\left(n-1\right)\left(2n-1\right)}{6}\)