Đặt \(n^2+n+1=k^2\left(k\in Z^+\right)\)
\(\Leftrightarrow4n^2+4n+4=4k^2\)
\(\Leftrightarrow4k^2=4n^2+4n+1+3\)
\(\Leftrightarrow4k^2-\left(2n+1\right)^2=3\)
\(\Leftrightarrow\left(2k-2n-1\right)\left(2k+2n+1\right)=3\)
Vì \(n,k\in Z\Rightarrow2k-2n-1,2k+2n+1\inƯ\left(3\right)\)
*lập bảng
2k-2n-1 | -3 | -1 | 1 | 3 |
2k+2n+1 | -1 | -3 | 3 | 1 |
2k-2n | -2 | 0 | 2 | 4 |
2k+2n | -2 | -4 | 2 | 0 |
k | -1 | -1 | 1 | 1 |
n | 0 | -1 | 0 | -1 |
Vậy \(n\in\){-1; 0} thì n2+n+1 là số cp