# What is the remainder when 17^(100000000…), with n zeroes is divided by 20? I.e.: 17^(10^n)mod20= ?

What is the remainder when ${17}^{100000000\dots }$, with $n$ zeroes is divided by 20? I.e.:

My approach: I can solve it by Euler's totient function ; ${17}^{8}=1\phantom{\rule{0.667em}{0ex}}\mathrm{mod}\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{thinmathspace}{0ex}}20$, so remainder is 1.
But I want to know if the following method will fetch the result: 17 divided by 20 gives −3 as remainder and −3 raised to any multiple of $10\phantom{\rule{0.667em}{0ex}}\mathrm{mod}\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{thinmathspace}{0ex}}20$ gives 1?
Is this logic correct? I think it works only for positive remainder.
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Simon Zhang
Modular arithmetic doesn't care about positive or negative. 17 and −3 behave in exactly the same way modulo 20. They are both representatives of the modulo 20 conjugacy class
$\left\{\dots ,-23,-3,17,37,\dots \right\}$
and thus one might even say they are equal, under some interpretations of modular arithmetic (they are equal "in ${\mathbb{Z}}_{20}$", for those who know what that means). So yes, that would work.
Note that $\left(-3{\right)}^{2}=9=10-1$, so
$\left(-3{\right)}^{4}=\left(10-1{\right)}^{2}=100-20+1\equiv 1\phantom{\rule{1em}{0ex}}\left(\mathrm{mod}\phantom{\rule{0.333em}{0ex}}20\right)$
###### Did you like this example?
maredilunavy
Hint being true mod 4 and 5.
Thus if $\phantom{\rule{thinmathspace}{0ex}}{f}_{n}={a}^{{10}^{n}}$ then by $\phantom{\rule{thinmathspace}{0ex}}{f}_{n+1}={{f}_{n}}^{10}\equiv \left({{f}_{n}}^{2}{\right)}^{4}{{f}_{n}}^{2}\equiv {{f}_{n}}^{2}$
So $\phantom{\rule{thinmathspace}{0ex}}\begin{array}{cccccc}n& 0& 1& 2& 3& \cdots \\ {f}_{n}& a& {a}^{2}& 1& 1& \cdots \end{array}\phantom{\rule{thinmathspace}{0ex}}$ by $\phantom{\rule{thinmathspace}{0ex}}\mathrm{s}\mathrm{q}\mathrm{u}\mathrm{a}\mathrm{r}\mathrm{i}\mathrm{n}\mathrm{g}\phantom{\rule{thinmathspace}{0ex}}$ repeatedly.