The statement is equivalent to $\sqrt{\frac{n(n+1)(2n+1)}{6n}}=\sqrt{\frac{(n+1)(2n+1)}{6}}\in\mathbb{Z}$.
Since $(n+1,2n+1)=1$, we have four possible cases using the fact that $2(n+1)-(2n+1)=1$:
I) $n+1=x^2$, $2n+1=6x^2$, which implies $2x^2-6x^2=1$, a contradiction $\pmod{2}$.
II)$n+1=6x^2$, $2n+1=y^2$ which implies $12x^2-y^2=1$ which is a contradiction $\pmod{3}$
III)$n+1=3x^2$, $2n+1=2y^2$, which implies $6x^2-2y^2=1\pmod{2}$, once again a contradiction $\pmod{2}$
IV) $n+1=2x^2$, $2n+1=3y^2$, which implies $4x^2-3y^2=1\implies (2x)^2-3y^2$, which is a solution to the Pell's equation $t^2-3y^2=1$.
By standard Pell's equation theory, the fundamental solution is $(t,u)=(2,1)$, so the smallest solutions are $(2,1),(7,4),(26,15)$. The first one doesn't fit since it would lead to $n=2x^2-1=\frac{t^2}{2}-1=\frac{2^2}{2}-1=1$. The second one would lead to $n=\frac{7^2}{2}-1$ which isn't an integer. Finally, the third smallest solution leads to $n=\frac{26^2}{2}-1=338-1=337$ as wanted.