TITLE: Show that there is exactly one element in $A$ congruent to $1$ modulo $p$ as follows.
QUESTION [2 upvotes]: Let $p$ be a prime. Let $A = \{a,2a,3a,\ldots,(p-1)a \}$, where $\gcd(a,p)=1$. Show that there is exactly one element in $A$ congruent to $1$ modulo $p$.
My attempt:
It is suffices to show that for each $a \in \{1,2,3,\ldots,p-1\}$, there is exist exactly one $b \in \{1,2,3,\ldots,p-1\}$ such that $ab \equiv 1 \pmod{p}$.
Suppose there is exist an element in $A$, say $c$, such that $ab \equiv ac \equiv 1 \pmod{p}$. Then,
\begin{equation*}
b \equiv 1\cdot b \equiv (ac)b \equiv (ab)c \equiv 1\cdot c \equiv c \pmod{p}
\end{equation*}
Hence, $b$ is unique and we're done.
Am i true? If not, how to show it?

REPLY [0 votes]: By Fermat's little theorem $a^{(p-1)} \equiv 1 (mod \ p)$ if $\gcd(a,p)=1$ therefore $a a^{(p-2)} \equiv 1 (mod \ p)$ thus by selecting the smallest positive integer congruent to $a^{(p-2)} (mod \ p)$ you have the solution.
{"set_name": "stack_exchange", "score": 2, "question_id": 3964050}