I am trying to compute the remainder of the following division:
$$9^{123456789} \quad\textrm{by}\quad 17.$$
Any ideas on how to work this out?
I am trying to compute the remainder of the following division:
$$9^{123456789} \quad\textrm{by}\quad 17.$$
Any ideas on how to work this out?
$9^n$ is a periodic sequence modulo 17 (Fermat's little theorem says that $9^{17} \simeq 9 \mod 17$).
Thus take the reminder $r$ of 123456789 by 17.
$$r \simeq 123456789 \mod 17$$
Then, because $(9^n \mod 17)$ is 17-periodic, we have
$$9^{123456789} \simeq 9^r \mod 17$$