<s>[INST] Find all triples $(p,x,y)$ such that $ p^x=y^4+4$ Find all triples $(p,x,y)$ such that $ p^x=y^4+4$, where $ p$ is a prime and $ x$ and $ y$ are natural numbers.
I know that this question has already been asked on another forum, but I want to ask different questions about it.
$ p^x=y^4+4$
$ p^x=(y^2+2)^2 - (2y)^2$
$p^x = (y^2+2y+2)(y^2-2y+2)$
Then: $p^k = y^2+2y+2$ and $p^j= y^2-2y+2$
The solutions I saw were different from here and they just wanted to prove that $(5,1,1)$ was the only solution. I´ll just ask what I didn't understand:
1)
Therefore, $p^k = (y+1)^2+1$ and $p^j= (y-1)^2+1$
And then: $(y+1)^2 \equiv (y-1)^2 \equiv -1 \pmod p$
So here $-1$ is a quadratic residue, and therefore $p= 4n+1$. I understood his solution until this part. 


*

*I know that $p= 4n+1$ because I saw that was one of the properties of quadratic residues, but would like to see a proof of it if possible.

*He then says that by$\mod 8$ , $ k$ and $j$ had different parity, so $x$ was odd.
Then he assumes that $p, k >1$ and says:


*

*If $k=2m$, then: $(y+1)^2= (p^m+1)(p^m -1)$ or if $j= 2m$: then $(y-1)^2= (p^m+1)(p^m -1)$ and affirms those equations have no solution, that might be a property but want to know about it anyway.


Then he says there are no solution for $x>1$, then $p = (y^2+2y+2)(y^2-2y+2)$, so $1=y^2-2y+2$ and that was the triple $(5,1,1)$, therefore that is the only solution.
2) 
He started off by saying: if $y$ is even then $ p^k \equiv  p^j \equiv 2 \pmod 4$ then $a = b =1$ and that is not possible, therefore $y$ is odd.


*

*Since $ 4y = p^{b} - p^{a}$, therefore $ p^{b-a}=5$, $ p^{a}=y$

*$ 2y^{2}+4=p^{b}+p^{a}$, if $ a\neq 0$, then $ y^2 \equiv 3\mod 5$, which is impossible.


I don´t know how you can deduce those things. After that he affirmed that $(5,1,1)$ was the only solution.
3) He showed that $y$ was odd and said:


*

*$gcd (y^2+2y+2, y^2-2y+2) = gcd (y^2+2y+2, 4y) = 1$ (I think this is also a property but I don´t even know it).


And since $y^2+2y+2 >  y^2-2y+2$, then $y^2+2y+2=p^x$ and $y^2-2y+2 =1$, so $y=1$ and $(5,1,1)$ was the only solution.
Sorry if I asked many things, I just thought those things may be useful for other problems. I pointed out the things I didn´t understood so that it was easy to see them. Thanks in advance.
 [/INST] Let $p$ be a prime number, and $x$ and $y$ natural numbers, such that $p^x=y^4+4$. Then as you note
$$p^x=(y^2+2y+2)(y^2-2y+2),$$
and hence both factors are powers of $p$, say
\begin{eqnarray*}
y^2+2y+2&=&p^u,\\
y^2-2y+2&=&p^v.
\end{eqnarray*}
First note that if $v=0$ then $y=1$, and we find that $p=5$ and $x=1$, the solution you already found.
Now suppose $v>0$. Because $y>0$ we have $p^u>p^v$ and so $u>v$, so $p^{u-v}-1$ is an integer. Then from
$$4y=(y^2+2y+2)-(y^2-2y+2)=p^u-p^v=p^v(p^{u-v}-1).$$
we see that $p$ divides $4y$ because $v>0$. So either $p$ divides $4$ or $p$ divides $y$. If $p$ divides $y$ then from
$$p^x=y^4+4,$$
it follows that $p$ also divides $4$, so either way we find that $p=2$. Then clearly $x>2$ because $y>0$, and reducing mod $2$ shows that $y$ is even, say $y=2z$. Plugging this in shows that
$$2^x=p^x=y^4+4=(2z)^4+4=2^4z^4+4,$$
and dividing by $4$ shows that
$$2^{x-2}=4z^4+1.$$
In particular $2^{x-2}$ is odd, so $x=3$. But then $4z^4+1=1$ and so $z=0$, which implies $y=0$, a contradiction.
This shows that the unique solution is indeed $(p,x,y)=(5,1,1)$.
</s>