The value of the expression $\mathrm{13^{99}(mod 17)}$, in the range $0$ to $16$, is_______?
My attempt :
Somewhere it explain as:
Note:
for remainder cycle $\mathrm{13^1mod17=13, 13^2mod17=16, 13^3mod17=4, 13^4mod17=1}$
So, the remainder cycle is $13,16,4,1$.
Therefore, $\mathrm{13^{99}mod17=13^3mod17=4}$ Answer.
Can you explain in formal way or alternative way, please?
$13^2\equiv-1\pmod{17}$
$13^{99}=(13^2)^{49}\cdot13\equiv(-1)^{49}\cdot13\equiv-1\cdot13\equiv-13+17\pmod{17}$