THeo đề bài ta có
\(n+18=p^2\)
\(n-41=q^2\)
\(\Rightarrow p>q\)
\(\Rightarrow n+18-\left(n-41\right)=59=p^2-q^2\)
\(\Rightarrow\left(p-q\right)\left(p+q\right)=59=1.59\)
TH1
\(\Rightarrow\left\{{}\begin{matrix}p-q=1\\p+q=59\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}p=30\\q=29\end{matrix}\right.\)
Thay p=30 vào \(n+18=p^2\)
\(\Rightarrow n+18=900\Rightarrow n=900-18=882\)
TH2
\(\left\{{}\begin{matrix}p-q=59\\p+q=1\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}p=30\\q=-29\end{matrix}\right.\)
Giống TH1 có n=882