A là số chính phương nên: \(A=n^2+n+6=k^2\)
\(\Rightarrow4n^2+4n+24=4k^2\)
\(\Rightarrow4n^2+4n+1+23=4k^2\)
\(\Rightarrow\left(2n+1\right)^2+23=4k^2\)
\(\Rightarrow4k^2-\left(2n+1\right)^2=23\)
\(\Rightarrow\left(2k-2n-1\right)\left(2k+2n+1\right)=23\)
Do \(k,n\in N\) nên: \(2k+2n+1>2k-2n-1\)
Ta có hệ:
\(\left\{{}\begin{matrix}2k+2n+1=23\\2k+2n+1=1\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}2k+2n+1=23\\4k=24\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}12+2n+1=23\\k=6\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}2n+13=23\\k=6\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}2n=10\\k=6\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}n=5\\k=6\end{matrix}\right.\)
Vậy: n=5