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.
 A: There is a MUCH easier way to finish.
Starting from $p^k=y^2+2y+2$; $p^j=y^2-2y+2$ we note on the one hand, the following inequality $y^2+2y+2 > y^2-2y+2$ (for natural numbers $y$) and so $j<k$, and therefore
$y^2+2y+2$ must be of the form $p^i(y^2-2y+2)$ for some prime and some positive integer $i$.
On the other hand, we note the following: $y^2+2y+2 < 2(y^2-2y+2)$ for all $y \geq 6$.
So we conclude e.g., $y \le 5$ and $p^x \le 5^4+4$. Furthermore using the above reasoning you can conclude $p \le 5$ if $y \in \{2,3,4,5\}$. This leaves us only a very small set of triples to check via brute force.
A: Alternative Solution:
First, assume that $'y'$ is even , this case can be rejected easily.
Hence, $y$ is odd.
Note that if:
$p^{a}=(k^{2}+1)$  $,$  $k∈ℕ$
As $(k^{2}+1)$ can't be a perfect square , it clearly implies that $'a'$ is odd.(unless $k=0$ )
Now, $p^{i}=(y-1)^{2}+1$ ; $p^{j}=(y+1)^{2}+1$
(if $(y-1)=0$, we get the case $(5,1,1)$ )
(if $(y-1),(y+1)∈ℕ$ , then both $i,j$ are odd )
$p^{x}=p^{i}p^{j}=p^{i+j}$
(As $i,j$ are both odd , $(i+j)=x$ is even )
Putting $x=2k$ in original equation,
$p^{2k}=y^{4}+4$
$(p^{k}-y^{2})(p^{k}+y^{2})=4$
using the fact that $(p^{k}-y^{2})$ and $(p^{k}+y^{2})$ are natural number factors of $4$, and,
$(p^{k}+y^{2})>(p^{k}-y^{2})$
$(p^{k}+y^{2})=4$ ; $(p^{k}-y^{2})=1$
we can see that this is not possible as  $ y^{2}≠1.5 $
Hence no possible solutions when $y≠1$
The only possible solution:
$(p,x,y)=(5,1,1)$
A: 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)$.
