[tex]\text{Conform primei ipoteze:}\\
n+8m+8=mn+m\\
8m-m+8=mn-n\\
7m+8=n(m-1)\Rightarrow n=\frac{7m+8}{m-1}\in \mathbb{N}\\
\Rightarrow m-1|7m+8\\
\text{ Dar }m-1|m-1\Rightarrow m-1|7m-7
\\
\text{Rezulta din ultimele doua relatii }m-1|(7m+8-7m+7) \Rightarrow m-1|15\\
\Rightarrow m-1\in\{1,3,5,15\}\Rightarrow m\in\{2,4,6,16\}
\\ m=2\Rightarrow n=22
\\ m+n=24,\ n^2+2n=n(n+2)=22\cdot24
\\ cmmdc=24[/tex]
[tex]\\ m=4\Rightarrow n=12
\\ m+n=16,\ n^2+2n=n(n+2)=12\cdot14
\\ cmmdc=8
\\ m=6\Rightarrow n=10
\\ m+n=16,\ n^2+2n=n(n+2)=10\cdot12
\\ cmmdc=8
\\ m=16\Rightarrow n=8
\\ m+n=24,\ n^2+2n=n(n+2)=8\cdot10
\\ cmmdc=8[/tex]
Asadar m=2,n=22