0

$9^{123456789} \pmod{100}$

I tried to do this in a simpler way:

$$9 \equiv 9 \pmod{100}$$

$$9^1 \equiv 09 \\ 9^2 \equiv 81 \\ 9^3 \equiv 29 \\ 9^4 \equiv 61 \\ 9^5 \equiv 49 \\ 9^6 \equiv 41 \\ 9^7 \equiv 69 \\ 9^8 \equiv 21 \\ 9^9 \equiv 89 \\ 9^{10} \equiv 01$$

I noticed that the odd powers always end in 9 and the even ones in $1$. The leftmost digit follows the sequence $0,2,4,6,8,$... in this order for odd numbers and the other way around for even ones. The sequence has $5$ numbers.

$123456789$ is an odd number. $123456789 \equiv 4 \pmod 5$ so the answer should be $69,$ which is the $4$th of the sequence... but it's $89.$ Close enough, but not quite. What did I do wrong and how can I solve this in this way?

Simon Fraser
  • 2,528
  • 1
    because $123456789\equiv 9\pmod {10}$. – Simon Fraser Jan 01 '20 at 20:23
  • https://math.stackexchange.com/questions/1342046/9123456789-pmod100-retrace-calculation-operation – PinkyWay Jan 01 '20 at 20:34
  • 1
    @VerkhovtsevaKatya thats where I got the question from. I was trying to go about it differently – Segmentation fault Jan 01 '20 at 20:35
  • $$9^{2a + b} = ({9^a})^2 \cdot 9^b\quad\quad b \in {0, 1}$$ – DanielV Jan 01 '20 at 20:42
  • 1
    By modular order reduction $\bmod 100!:,\ 9^{\large\color{#c00}{10}}\equiv 1,\Rightarrow,9^{\large N}\equiv 9^{\large N\bmod \color{#c00}{10}}\equiv 9^{\large 9}\equiv 89,$ by your table. – Bill Dubuque Jan 01 '20 at 20:53
  • What's wrong: $,n\equiv 4\pmod{!5}!\iff! n\equiv 4,9\pmod{!10},,$ so $,n,$ odd $,\Rightarrow,n\equiv 9\ $ (not $7)\ \pmod{!10}\ \ \ $ – Bill Dubuque Jan 01 '20 at 21:10
  • @BillDubuque Sorry I dont follow. – Segmentation fault Jan 01 '20 at 21:12
  • My prior comment explains the correct way to do your final paragraph. What precisely don't you follow? But it is obvious that $N\bmod 10$ is the units digits $9$ so their is no need for that. But you wanted an explanation.... – Bill Dubuque Jan 01 '20 at 21:14
  • 1
    OP, your approach is an issue of mapping/indexing. You need odd exponents ending in $1, 3, 5, 7, 9$ to map to leading digits $0, 2, 4, 6, 8$ and even exponents ending in $0, 2, 4, 6, 8$ to map to leading digits $0, 8, 6, 4, 2$. Taking the exponent mod $5$ won't get you what you need here -- in other words just because you get $4$ mod $5$ that doesn't mean it's the same as the $4$th element of your odd sequence. – Marcus Andrews Jan 01 '20 at 21:15
  • @MarcusAndrews My idea was that if you have a sequence that goes 0,2,4,6,8 (5 numbers) the order shouldn't really matter... in other words, you get a sequence for even exponents and one for odd ones and I am trying to use them separately. – Segmentation fault Jan 01 '20 at 21:18
  • Taking $1, 3, 5, 7, 9$ mod $5$ each gets you $1, 3, 0, 2, 4$ which you could use as indices ($0$-indexed) in the list $[4, 0, 6, 2, 8]$ but you see that the order is no longer $[0, 2, 4, 6, 8]$ as you may want. – Marcus Andrews Jan 01 '20 at 21:28
  • In other words, if you are dead set on using mod $5$: For odd exponent $n$, the result is equal to $[4, 0, 6, 2, 8][n \bmod 5] \cdot 10 + 9$, and for even exponent $n$, the result is equal to $[0, 4, 8, 2, 6][n \bmod 5] \cdot 10 + 1$. – Marcus Andrews Jan 01 '20 at 21:38
  • The odds $!\bmod 10, $ are $\equiv 1,3,5,7,\color{#c00}9.,$ Here $,\color{#c00}9\equiv 4\pmod{!5},$ is the $\color{#0a0}5$'th elt (with $1$-based indexing) of the odd subsequence in your table. But there's no need to break down $\color{#c00}9$ mod $5$ & $2$ when you can simply look up the value of $,9^{\large \color{#c00}{9}}!\pmod{!100},$ in your table (penultimate row) - independent of any indexing scheme! – Bill Dubuque Jan 01 '20 at 22:00
  • @BillDubuque Hold on, why mod 10? – Segmentation fault Jan 01 '20 at 23:43
  • Because, by my first comment above, we can reduce the exponent $\bmod 10\ \ $ – Bill Dubuque Jan 01 '20 at 23:52
  • You missed that You'd have to mod ${123456790\over 2}=61728395$ by 5 to get where it lands in the odd sequence labelling it with $9=2(5)-1$ being 0 instead of 5. then you get you should be looking at the exponent 9, not 7. It's a tedious way though. –  Jan 02 '20 at 00:49
  • @SilenceOnTheWire, that's okay, just write that in the post. (: – PinkyWay Jan 02 '20 at 11:44

3 Answers3

1

Given your column of results, \begin{align*} 9^{123456789} &= 9^{12345678 \cdot 10 + 9} \\ &= (9^{10})^{12345678}9^9 \\ &\cong 1^{12345678} \cdot{89} \pmod{100} \\ &\cong 89 \pmod{100} \text{.} \end{align*}

Eric Towers
  • 67,037
0

$$ 9^{10} \equiv 1 \pmod {25} $$

Will Jagy
  • 139,541
0

Using Binomial Theorem, we get

$$9^{123456789}=(-1+10)^{123456789}\equiv(-1)^{123456789}+123456789\cdot10^1\cdot(-1)^{123456789-1}\equiv-1+90\equiv89 \pmod{100}$$

ThomasL
  • 405