## Task A-4.7.

Depending on the prime number $p$, determine all pairs $(m, n)$ of natural numbers that satisfy the equation

$$
m^{2}=n^{2}-4 n p+3 p^{2}
$$
## First Solution.

Let's write the initial equality in the following way

$$
p^{2}=\left(n^{2}-4 n p+4 p^{2}\right)-m^{2}=(n-2 p-m)(n-2 p+m)
$$

The only divisors of the number $p^{2}$ are $-p^{2},-p,-1,1, p$ and $p^{2}$. Since $n-2 p-m4 p-1$, the number $n=$ $\frac{4 p-1-p^{2}}{2}<0$ would not be a natural number.

Also, notice that in this case $p$ must be odd, so we conclude that for $p=3$ we have an additional solution $m=4, n=1$.

From all this, we conclude that

- for $p=2$ the equation has no solutions
- for $p=3$ the equation has two solutions $(m, n)=(4,1)$ and $(4,11)$
- for $p \geqslant 5$ the equation has one solution of the form $(m, n)=\left(\frac{p^{2}-1}{2}, \frac{p^{2}+4 p+1}{2}\right)$.