Same number of solutions to $ax^m+by^n\equiv c\pmod{p}$ and $ax^{m'}+by^{n'}\equiv c\pmod{p}$. I'm having trouble with the last problem of Chapter 4 in Ireland and Rosen's Number Theory.

Show that $ax^m+by^n\equiv c\pmod{p}$ has the same number of solutions as $ax^{m'}+by^{n'}\equiv c\pmod{p}$ where $m'=(m,p-1)$ and $n'=(n,p-1)$.

I let $g$ be a primitive root, and $m=m'i'$ and $n=n'j'$ for some $i'$ and $j'$. Then if $(g^i,g^j)$ is a solution to the first equation, $(g^{ii'},g^{jj'})$ is a solution to the second.
I also tried working out an example. I considered the equations
$$
2x^3+3y^2\equiv 1\pmod{5},\qquad 2x+3y^2\equiv 1\pmod{5}.
$$
The first has five solutions $(2,0),(3,2),(3,3),(4,1),(4,4)$ and the second has five solutions $(2,2),(2,3),(3,0),(4,1),(4,4)$. The only relation I could see between the solutions is that $0,1,4$ are fixed, and it seems $2$ and $3$ swap places.
However, I don't know how to apply this to a general proof of the statement. How could one do that? Thanks.
 A: This follows from the fact that the non-zero residue classes modulo $p$ form a cyclic group of order $p-1$. Combine that with the (hopefully known to you) bit that in a cyclic group $C_k$ of order $k$ an element is an $r^{th}$ power if and only if it is a $d^{th}$ power, where $d=\gcd(r,k)$. Moreover, the number of times you get the same element as a power will be the same in both cases. [Edit] This is because the solutions of the equation $x^d=1$ form the kernel $K$ of the homomorphism $g\mapsto g^t$ from $C_k$ to itself with both $t=r$ and $t=d$. The solutions of $x^t=y$ (for some $y\in C_k$) then are either the empty set or a coset of $K$. In the latter case the number of solutions is $|K|$. [/Edit]

In your example case of $2x^3$ modulo $5$ we have $p-1=4$. As $\gcd(3,4)=1$, an element is a third power if and only if it is a first power. The latter is obviously always true, so in this cubing should be a bijection of the residue classes. Indeed,
$$
1^3\equiv1, 2^3=8\equiv3, 3^3=27\equiv 2, 4^3=64\equiv 4,
$$
all the congruences where $\pmod 5$.
Modulo $7$ it will be more interesting. Let's try fourth powers this time. Now $p-1=6$ and
$\gcd(4,p-1)=2$, so the theory tells us that any (non-zero) residue class occurs as a square as often as as a fourth power. This time, all congruences $\pmod 7$,
$$
\begin{aligned}
1\equiv1^2\equiv6^2\equiv 1^4\equiv6^4,\\
2\equiv3^2\equiv4^2\equiv 2^4\equiv5^4,\\
4\equiv2^2\equiv5^2\equiv 3^4\equiv4^4.
\end{aligned}
$$
A: You are on the right track with your initial attempt.  Find an inverse to your map $(g^i, g^j) \mapsto (g^{ii'}, g^{jj'})$.
