I would like to know how to find all prime factors of $p_1^{p_2}-1$, where $p_1$ and $p_2$ are both primes.
Can you please give an example where $p_1=7$ and $p_2=19$?
What I have is that all the factors of $p_1-1$ should be included and the order of elements should be used.
Thanks!
Caution: you really do need to check the prime factors of $p-1.$ Your number $7^{19} - 1$ is divisible by both $2$ and $3$
I think the hint you were given amounts to Fermat's Little Theorem. If we have primes $p,q,r,$ also $\gcd(r, p-1) = 1$ and $$ p^q \equiv 1 \pmod r, $$ we use the fact that $$ p^{r-1} \equiv 1 \pmod r $$ to conclude that $r-1$ is divisible by $q.$ For some $t$ we have $r-1=qt,$ or $r = qt+1,$ or $r \equiv 1 \pmod q$
Here are the first fifty useful primes:
As Robert says, there is also a very large prime factor. It is also $1 \pmod {19}$