Show that $a^{(p-1)!+1} \equiv a \mod p$

modular arithmeticnumber theory

I'm working in the following excercise:

Show that $a^{(p-1)!+1} \equiv a \mod p$

By Wilson's theorem I have:

$$a^{(p-1)!} \equiv -1 \mod p$$
$$a^{(p-1)!} * a \equiv -1 * a\mod p$$
$$a^{(p-1)!+1} \equiv -a \mod p$$
$$a^{(p-1)!+1} \equiv a \mod p$$

I'm not sure about my proof, is that correct? any help will be really appreciated.

Best Answer

Actually it is $a^{(p-1)!} \equiv 1$ mod $p$ (not $-1$). Indeed, $a^{k(p-1)} \equiv 1$ for any integer $k$, as $|(\mathbb{F}_p)^{\times}| = p-1.$

[In general, let $G$ be any group. Then for every element $g \in G$, the equation $g^{k|G|} = e$ holds for any positive integer $k$, where $e$ is the identity element. Here set $G = (\mathbb{F}_p)^{\times}$ where the operation is multiplcation.]