# Reducing modulo 5 does not make the equations equivalent?

Edit 2: I was trying to solve $$2^{n} + 5^{n} - 65 = p^{2}$$ for positive integer solutions

$$2^{n} + 5^{n} - 65 \equiv p^{2} \mod 5$$
has different solutions from
$$2^n \equiv p^2 \mod 5$$

Why is this so? Does this mean that both equations are not equivalent? Is reducing modulo $$5$$ a bad idea for finding integer solutions of $$n$$ and $$p$$?

Note: There are more solutions (including the solutions for the previous equation) not shown for $$2^n \equiv p^2 \mod 5$$, but it still stands that there are suddenly more solutions.

Edit: Equation 2 has too many solutions, including solutions where $$n$$ is not $$0$$. Here are some of them:

• $5^n$ is not equal to $0 \mod 5$ if $n=0$. You have to separate the two cases, $n = 0$ and $n \ne 0$ Feb 17, 2021 at 14:03
• Ah I should've clarified it better. I obtained too many solutions for the second equation that I couldn't fit in 1 page. I'll edit it in. There are no values of $n$ above 18. Feb 17, 2021 at 14:08
• Wolframalpha decided to make the solutions for the second equation modulo 20, but there are still too many solutions Feb 17, 2021 at 14:11
• I don't understand the $\mod 20$ issue. If $p$ is a solution $\mod 5$, $p+5$ is a solution $\mod 5$ ... You only need to consider $p$ from $0$ to $4$ Feb 17, 2021 at 14:16
• @Damien To illustrate, what about the $n \equiv 12, p\equiv 6$ solution? That doesn't reduce to one of the four solutions in the small modulo 5 list. Feb 17, 2021 at 14:18

Here, $$5^n \equiv 0 \mod 5$$, except for $$n = 0$$.

Therefore, we have to make a distinction between $$n = 0$$ and $$n \ne 0$$.

Moreover, $$\phi(5) = 4$$.

Therefore,

$$2^n \mod 5 \equiv 2^{n \mod 4} \mod 5$$.

As $$n = 0$$ is a special case, we have to consider $$n = 0, 1, 2, 3, 4$$.

Concerning $$p$$: if $$p$$ is a solution, then $$p+5$$ is a solution too. Then, for $$p$$, we have only to consider its value modulo 5.

At this point, it is easy to consider the different cases.

If $$n = 0$$:

$$p^2 = 2 \mod 5$$

It is easy to check that $$p^2$$ is equal to $$0, 1, 4$$ modulo 5. So, no solution

If $$n \ne 0$$:

$$p^2 \equiv 2^n \mod 5$$

$$n = 1 \implies p^2=2 \mod 5 \implies no\,solution\,in\,p$$ $$n = 2 \implies p^2=4 \mod 5 \implies p=2\,or\,p=3$$ $$n = 3 \implies p^2=3 \mod 5 \implies no\,solution\,in\,p$$ $$n = 4 \implies p^2=1 \mod 5 \implies p=1\,or\,p=4$$

• Yup, I understand how to obtain solutions from $2^n=p^2$. What concerns me is that reducing modulo $5$ created so many solutions, and separating $n$ into $2$ cases does not seem to resolve this. Feb 18, 2021 at 10:51
• When I provide a solution with $n = 4$, in fact it corresponds to all $n = 4 \lambda$ solutions, with $\lambda \ne 0$. So for example, $n = 8$ is included. Feb 18, 2021 at 11:01