đặt \(k^2=n^2+n+6\Rightarrow4k^2=4n^2+4n+24\Rightarrow\left(2k\right)^2=\left(2n+1\right)^2+23\)
\(\Rightarrow\left(2k\right)^2-\left(2n+1\right)^2=23\Rightarrow\left(2k+2n+1\right)\left(2k-2n-1\right)=23\Rightarrow\left\{{}\begin{matrix}2k+2n+1=23\\2k-2n-1=1\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}2k+2n=22\\2k-2n=2\end{matrix}\right.\Rightarrow\left\{{}\begin{matrix}k+n=11\\k-n=1\end{matrix}\right.\Rightarrow}\left\{{}\begin{matrix}k=6\\n=5\end{matrix}\right.\)
vậy n=5