3

This is a conversion someone on SE made:

$$77777\equiv1\pmod{4}\implies77777^{77777}\equiv77777^1\equiv7\pmod{10}$$

But I don't understand how this is done?

Lebes
  • 1,736
  • 2
  • 14
  • 31

2 Answers2

5

What was actually used is Euler's theorem: $$a^{\varphi(n)} \equiv 1 \pmod n$$ Where $\varphi$ is the totient function. $\varphi(10) = 4$ so $$77777^{a + 4k} \equiv 77777^a \pmod{10}\\ \Rightarrow 77777^{77777} \equiv 77777^{77777 \bmod 4} = 77777^1 \pmod{10}$$

AlexR
  • 25,110
4

Hint: $7^2\equiv -1\pmod{10}$.

No base change actually happens.

  • The person uses $\pmod{4}$ though – Lebes Feb 19 '15 at 10:04
  • Yes, I used $\pmod 2$ to give a little bit less away - and then I added the second sentence to hint at how the first might be used. – Henrik supports the community Feb 19 '15 at 10:05
  • 1
    ,Can you show me a full explanation? It isnt homework, I am just trying to under modular arithemtic? +1 – Lebes Feb 19 '15 at 10:06
  • I like Henrik's style (+1). @Lebes, why don't you continue this and calculate the remainders mod $10$ for the next few powers of $7$?! – Jyrki Lahtonen Feb 19 '15 at 10:07
  • 1
    @JyrkiLahtonen, I did and got: $$77777^{n} \equiv 77777^{n + 4} \pmod{10}$$ but I dont know what to do next/ – Lebes Feb 19 '15 at 10:13
  • @JyrkiLahtonen: Thank you. That actually made me feel really good about my answer. – Henrik supports the community Feb 19 '15 at 10:14
  • Rinse and repeat. $$7777^0\equiv 7777^4\equiv7777^8\ldots$$ All modulo 10. – Jyrki Lahtonen Feb 19 '15 at 10:15
  • @Lebes: When you've realised that $77777^n\equiv 77777^{n+4}$ it should be easy to find a $k$ such that $77777^n\equiv 77777^m$ where $n\equiv m\pmod{k}$. – Henrik supports the community Feb 19 '15 at 10:17
  • 1
    @JyrkiLahtonen, so: $$77777^{n} \equiv 77777^{n + 4k}$$ for integer $k$. Let $n = 1$. $$77777 \equiv 77777^{1 + 4k}$$

    Let $$77777 = 1 + 4k \rightarrow k = 19444$$

    $$77777 \equiv 77777^{77777} \equiv 7$$ Then?

    – Lebes Feb 19 '15 at 10:18
  • @Lebes: That's correct. To summarize: You noticed that the last digits of the sequence $7777^n$ repeats in a cycle of length four. Therefore the members with $n=7777$ and $n=1$ share the last digit. With $n=1$ the task of calculating it is trivial :-) – Jyrki Lahtonen Feb 19 '15 at 11:49