Find the remainder when $5^{5555}$ is divided by $10000$.
A step by step guide with explanation for a beginner student in modular arithmetic is needed.
Find the remainder when $5^{5555}$ is divided by $10000$.
A step by step guide with explanation for a beginner student in modular arithmetic is needed.
Since $10000=2^4\times5^4$, we can use the Chinese Remainder Theorem after evaluating $5^{5555}$ modulo $2^4$ and modulo $5^4$. The latter is easy: $$5^{5555}\bmod 5^4=0\ .$$ For the former, start evaluating powers of $5$ modulo $2^4=16$: we have $$5^1\equiv5\ ,\quad 5^2\equiv9\ ,\quad 5^3\equiv13\ ,\quad5^4\equiv 1\ .$$ It's not hard to see that $4$ is a factor of $5556$. Hence $$5^{5555}\equiv5^{4q+3}\equiv 1^q\times5^3\equiv13\ .$$ So if $x=5^{5555}$ we have $$x\equiv13\pmod{2^4}\ ,\quad x\equiv0\pmod{5^4}$$ and the Chinese Remainder Theorem gives $$x\equiv8125\pmod{10000}\ .$$
We can use Exponentiation by Squaring: $$ \begin{align} &&&\text{operation}&&\text{exponent of $5$ in base two}\\ 5^1&\equiv5\pmod{10000}&&&&1_\text{two}\\ 5^2&\equiv25\pmod{10000}&&\text{square}&&10_\text{two}\\ 5^4&\equiv625\pmod{10000}&&\text{square}&&100_\text{two}\\ 5^5&\equiv3125\pmod{10000}&&\text{multiply by }5&&101_\text{two}\\ 5^{10}&\equiv5625\pmod{10000}&&\text{square}&&1010_\text{two}\\ 5^{20}&\equiv625\pmod{10000}&&\text{square}&&10100_\text{two}\\ 5^{21}&\equiv3125\pmod{10000}&&\text{multiply by }5&&10101_\text{two}\\ 5^{42}&\equiv5625\pmod{10000}&&\text{square}&&101010_\text{two}\\ 5^{43}&\equiv8125\pmod{10000}&&\text{multiply by }5&&101011_\text{two}\\ 5^{86}&\equiv5625\pmod{10000}&&\text{square}&&1010110_\text{two}\\ 5^{172}&\equiv625\pmod{10000}&&\text{square}&&10101100_\text{two}\\ 5^{173}&\equiv3125\pmod{10000}&&\text{multiply by }5&&10101101_\text{two}\\ 5^{346}&\equiv5625\pmod{10000}&&\text{square}&&101011010_\text{two}\\ 5^{347}&\equiv8125\pmod{10000}&&\text{multiply by }5&&101011011_\text{two}\\ 5^{694}&\equiv5625\pmod{10000}&&\text{square}&&1010110110_\text{two}\\ 5^{1388}&\equiv625\pmod{10000}&&\text{square}&&10101101100_\text{two}\\ 5^{2776}&\equiv625\pmod{10000}&&\text{square}&&101011011000_\text{two}\\ 5^{2777}&\equiv3125\pmod{10000}&&\text{multiply by }5&&101011011001_\text{two}\\ 5^{5554}&\equiv5625\pmod{10000}&&\text{square}&&1010110110010_\text{two}\\ 5^{5555}&\equiv8125\pmod{10000}&&\text{multiply by }5&&1010110110011_\text{two}\\ \end{align} $$
Find the remainder when $5^{5555}$ is divided by $10000$.
Also known as "find the last 4 digits of $5^{5555}$". Essentially this depends on the cycle length of 5 in $2^4$, which is $4$. So we're only interested in what $5555 \pmod 4$ is: $3$. In order to saturate the $4$-fold multiplicity of $5$ in $10000$, we'll look at $5^7 \pmod {10000}$ instead, which is our answer: $8125$
Start by factoring $10000 = 10^4 = 2^4 \times 5^4$.
So we want to know the results mod $2^4$ and mod $5^4$.
The second is easiest: $5555 > 4$ so $5^{5555} \equiv 0 \mod 5^4$.
Now mod $2^4 = 16$: $\gcd(2^4, 5) = 1$ and $\phi(16) = 8$, so $5^8 \equiv 1 \mod 2^4$. $5555 \equiv 3 \mod 8$, so $5^{5555} \equiv 5^3 \equiv 13 \mod 2^4$.
You want a number $x \in [0,1,\ldots, 9999]$ with $x \equiv 0 \mod 5^4$ and $x \equiv 13 \mod 2^4$. The $0$ makes it especially easy. You'll have $x = 5^4 y$, and $5^4 \equiv 1 \mod 2^4$, so $y \equiv x \equiv 13 \mod 2^4$. You can take $y = 13$ and thus $x = 8125$.
Just to show you an interesting pattern-
Powers of five Value
$5^2 = 25$
$5^3 = 125$
$5^4 = 625$
$5^5 = 3125$
$5^6 = 15625$
$5^7 = 78125$
$5^8 = 390625$
$5^9 = 1953125$
$5^{10} = 9765625$
$5^{11} = 48828125$
$5^{12} = 244140625$
$5^{13} = 1220703125$
$5^{14} = 6103515625$
$5^{15} = 3 0517578125$
$5^{16} = 15 2587890625$
$5^{17} = 76 2939453125$
$5^{18} = 381 4697265625$
$5^{19} = 1907 3486328125$
$5^{20} = 9536 7431640625$
Note that your question can be written as -"Write the last four digits of $5^{5555}$".
Now,note same interesting features of the series of power of $5$.
Calculating we find the last four digits are-$8125$
Hint $\,\ 2^{\large 4}\mid 5^{\large 4}\!-1 = 25^{\large 2}\!-1 = 24\cdot 26,\,$ so $\ 10^{\large 4}\mid 5^{\large 4}(5^{\large 4}\!-1) = 5^{\large 8}-5^{\large 4}\ $ so
${\rm mod}\ 10^{\large 4}\!:\,\ 5^{\large 8} \equiv 5^{\large 4}\,\overset{\large \times 5^4}\Rightarrow\, 5^{12} \equiv 5^{\large 4}\overset{\large \times 5^4}\Rightarrow\, 5^{\large 16} \equiv 5^{\large 4}\,\ldots \Rightarrow\, 5^{\large 4N} \equiv 5^{\large 4} $