Way to calculate exponent in congruent equation

701 Views Asked by At

I want to solve

$$ 5^{x} \equiv 21 \pmod {23} $$

Is there a way to get the $x$ without trial & error?

1

There are 1 best solutions below

0
On

We have $5^{11}\equiv -1\pmod {23}$, because $\left(\frac5{23}\right)=-1$, and also $5^2\equiv2\pmod{23}$ hence $$ 5^{13}\equiv 5^{11}5^2\equiv -2\equiv 21\pmod {23} $$ And the number $13$ is the smallest because the function $5^x$ is periodic modulo $23$ with period $\varphi(23)=22$.