Đặt \(n^2+n+6=a^2\)
\(\Leftrightarrow4n^2+4n+24=4a^2\)
\(\Leftrightarrow4n^2+4n+1+23=4a^2\)
\(\Leftrightarrow\left(2n+1\right)^2+23=4a^2\)
\(\Leftrightarrow4a^2-\left(2n+1\right)^2=23\)
\(\Leftrightarrow\left(2a-2n-1\right)\left(2a+2n+1\right)=23\)
\(\forall n\in N\)thì \(2a+2n+1>2a-2n-1>0\)
\(\Rightarrow\left\{{}\begin{matrix}2a+2n+1=23\\2a-2n-1=1\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}a=6\\n=5\end{matrix}\right.\)
Vậy n = 5