## Exercise 7

Find all triplets of positive integers $(p, n, m)$ such that $p$ is prime and $p^{n}+144=m^{2}$.
## Corrected

The relation rewrites as $p^{n}=m^{2}-144=(m-12)(m+12)$. Since $p$ is prime, there exists $k \in\{0, \ldots, n\}$ such that $m-12=p^{k}$ and thus $m+12=p^{n-k}$ (consequently $n-k>k$ or $2 k<n$). Let's discuss according to the value of $k$.

$\triangleright$ If $k=0$, then $m=13$ and thus $p^{n}=13^{2}-12^{2}=25$ which implies $p=5$ and $n=2$. The only solution corresponding to this case is

$$
(p, n, m)=(5,2,13)
$$

$\triangleright$ Otherwise, $24=p^{k}-p^{n-k}$ is divisible by $p^{k}$, so $p \in\{2,3\}$.

- If $p=2, k \in\{1,2,3\}$ (since $2^{k}$ divides 24) and the corresponding values of $m$ are $m=\{14,16,20\}$. Only the value $m=20$ ensures that $m^{2}-144$ is a power of 2 (and it is $2^{8}$). The only solution corresponding to this case is

$$
(p, n, m)=(2,8,20)
$$

- If $p=3, k=1$ (since $3^{k}$ divides 24) and thus $m=15$ and $n=4$ (since $15^{2}-144=81=3^{4}$). The only solution corresponding to this case is

$$
(p, n, m)=(3,4,15)
$$

In conclusion, the solutions are $(5,2,13),(2,8,20)$ and $(3,4,15)$