# What is the smallest number n> 5 so that 5 ^ n ends with “3125”?

What is the smallest number n> 5 so that 5 ^ n ends with "3125"?

What other examples are there?

• What is your take on this? – ADITYA PRAKASH Mar 20 at 20:01
• Why not just list them out and find it? – Jair Taylor Mar 20 at 20:02
• Why not just do it? It's not $1$ because $5^1=5$. It's not $2$ because $5^2 = 25$. What's to keep you from just continuing? – fleablood Mar 20 at 20:20
• The answer to "What is the smallest such n>5?" is easy, so you might as well retitle the question "What are all n>5 such that...?" – smci Mar 20 at 23:55

Hint: $$5^n \equiv 5^5 \mod 10^4$$ if and only if $$5^n \equiv 5^5 \mod 2^4$$. What is the multiplicative order of $$5$$ mod $$16$$?

So, we are looking for all $$n>5$$ for which $$5^n\equiv 3125=5^5\mod 10000$$.

Note that the following equivalence holds for $$n>5$$:$$5^n\equiv 5^5\mod 10000\\\iff \\5^{n-4}\equiv 5\mod 16\\\iff\\5^{n-5}\equiv 1\mod 16$$Define $$m\triangleq n-5\ge 1$$. Then all the $$m$$s for which $$5^{m}\equiv 1\mod 16$$ holds are $$m=4k\quad,\quad k\in \Bbb N$$this is because $$5^4=625\equiv 1\mod 16$$ and therefore $$5^{4k}\equiv5^{4k-4}\equiv\cdots \equiv 5^{4}\equiv 1\mod 16$$

Conclusion

All $$n>5$$s for which $$5^n$$ ends up with $$3125$$ can be found from $$n=4k+5\quad,\quad k\in \Bbb N$$ and the smallest such $$n$$ is 9.

Well $$5^9=1953125$$ so the answer is $$9$$. In fact $$5^n\equiv 5^{n-4} \mod{10^4}$$ For $$n\ge 8$$, so any value of $$5^{5+4k}$$ where $$k\in\mathbb{N}$$ has the last four digits $$3125$$.

• Why not $5^5 = 3125$. – fleablood Mar 20 at 20:20
• The question states that $n\gt5$ – Peter Foreman Mar 20 at 20:22

Hint $$\,\ 5^{\large 5+N}\! \bmod 10^{\large 4} = 5^{\large 5}(5^{\large\color{#c00} N}\! \bmod 2^{\large 4}).\,$$ Now recall \, \begin{align} 5\, &\equiv 1\!\pmod{\! \color{#c00}4} \\ \Rightarrow\ 5^{\large\color{#c00} 4}\!&\equiv 1^{\large\color{#c00} 4}\!\!\!\! \pmod{\!\color{#c00}4^{\large 2}}\end{align}