Find all triplets of positive integers $(p, n, m)$ such that $p$ is prime and $p^{n}+144=m^{2}$
We can factorize the equation in the form $p^{n}=(m-12)(m+12)$. Thus, $m-12$ and $m+12$ are both divisors of $p^{n}$, and therefore are also powers of $p$. We call $a$ and $b$ the exponents, so that $p^{a}=m-12$ and $p^{b}=m+12$ (we know that $b>a$ and that $a+b=n$). By subtracting the second equation from the first, we get $p^{b}-p^{a}=24$. If $a>0$, we know that $p$ divides $p^{b}-p^{a}$, so $p$ divides 24, hence $p=2$ or $p=3$ unless $a=0$. Therefore, we distinguish three cases:

If $a=0$, the first equation gives $1=m-12$, so $m=13$. Substituting into the second equation, we get $p^{b}=13+12=25$, so $p$ is 5, and we find the solution $(5,2,13)$.

If $p=2$, we get $2^{b}-2^{a}=24$. We note that $2^{b}>24>2^{4}$, so $b \geqslant 5$. Thus, we find that $-2^{a} \equiv 8[16]$, in other words $a=3$. We then find $b=5$, so $n=3+5=8$, and finally the solution $(2,8,20)$.

If $p=3$, we get $3^{b}-3^{a}=24$. By a similar reasoning, we find $a=1$ and $b=3$, hence the solution $(3,4,15)$.

We verify reciprocally that these three solutions are valid, so these are the only ones.