# Find the value of the prime $p$ knowing that $p>5$ and $p│(3^{p+1} +5^{p-1} + 1)$

I am trying to find the value of $$p$$, a prime number of which we only know that $$p>5$$ and:

$$p│(3^{p+1} +5^{p-1} + 1)$$

This is part of a collection of exercises regarding divisibility, Fermat's little theorem and congruences (among others).

Seeing that the second term has $$5^{p-1}$$, I imagine Fermat's little theorem could be used on that, but I don't know how to advance from there.

Any help/hints are welcome!

(currently stuck trying to take the value from the main expression knowing that $$3^{p-1}\equiv 1\bmod p$$ and $$3^{p-1}*3^2\equiv 3^2\bmod p$$, so $$3^{p+1}\equiv 3^2\bmod p$$, also $$5^{p-1}\equiv 1\bmod p$$)

• Hint: $3^{p+1}=3^{p-1}\cdot 3^2$. – metamorphy May 4 at 16:58

Hint: If $$p│3^{p+1}+5^{p-1}+1$$, that is the same as saying that $$3^{p+1}+5^{p-1}+1\equiv 0\bmod p$$. But you know the values of $$3^{p+1}\bmod p$$ and $$5^{p-1}\bmod p$$.
• thanks, so $3^{p-1}\equiv 1\bmod p$ and $3^{p-1}*3^2\equiv 3^2\bmod p$, so $3^{p+1}\equiv 3^2\bmod p$, also $5^{p-1}\equiv 1\bmod p$, but I am not sure how to go from there in the "main" congruence – Lightsong May 5 at 6:58
• $3^{p+1}+5^{p-1}+1\equiv 0\bmod p$ – TonyK May 5 at 11:32
• Yes, but I am not sure how to manipulate the congruence so that I can "substract" terms (I assume it has to be done like that), in order to get the value of $p$ – Lightsong May 5 at 14:38