[Math] Find the last Digit of $237^{1002}$

decimal-expansiondiscrete mathematicselementary-number-theoryexponentiation

I looked at alot of examples online and alot of videos on how to find the last digit But the thing with their videos/examples was that the base wasn't a huge number. What I mean by that is you can actually do the calculations in your head. But let's say we are dealing with a $3$ digit base Number… then how would I find the last digit.

Q: $237^{1002}$

EDIT: UNIVERSITY LEVEL QUESTION.

It would be more appreciated if you can help answer in different ways.

Since the Last digit is 7 –>

  • $7^1 = 7$
  • $7^2 = 49 = 9$
  • $7^3 = 343 = 3$
  • $7^4 = 2401 = 1$

    $…….$

    $……..$

  • $7^9 = 40353607 = 7$

  • $7^{10} = 282475249 = 9$

Notice the Pattern of the last digit. $7,9,3,1,7,9,3,1…$The last digit repeats in pattern that is 4 digits long.

  • Remainder is 1 –> 7
  • Remainder is 2 –> 9
  • Remainder is 3 –> 3
  • Remainder is 0 –> 1

So, $237/4 = 59$ with the remainder of $1$ which refers to $7$. So the last digit has to be $7$.

Best Answer

$$ 237^{1002} = (23*10 + 7)^{1002} = \sum_{i=0}^{1001}23^{1002-i}10^{1002-i}\;7^i{1002 \choose i} + 7^{1002} =\\ [\textit{some huge honking multiple of }10] + 7^{1002} = \\ [\textit{some huge honking multiple of } 10] + 49^{501} = \\ [\textit{some huge honking multiple of }10] + (50 - 1)^{501} =\\ [\textit{some huge honking multiple of }10] + [\textit{some other gorfurshlugging multiple of }10] + (-1)^{501} =\\ [\textit{some huge honking multiple of }10] + [\textit{some other gorfurshlugging multiple of }10] - 1 = \\ [\textit{some huge honking multiple of }10] + [\textit{one less than some other gorfurshlugging multiple of }10] + 9 $$

So the last digit is $9$. Thing is only the last digits matter, and the last digits will cycle between $1, 7, 9, 3, 1, 7, 9, 3$. So you just need the last digit and the remainder of $1002$ divided by $4$.

=====

Crash course in modular arithmetic:

If you have some integer $N$ and we have two integers $a$ and $b$ so that $a = b \pm kN$ for some integer $k$ we say $a \equiv b \mod N$. We are basically considering an arithmetic system where we consider numbers by how much more than a multiple of $N$ they are.

Ex: If $4732895738927 \equiv 8647 \mod 10$ because $4732895738927 = 8647 + 10k$. Basically if $a \equiv b \mod 10$ then $a$ and $b$ have same last digit as $a = b + 10k$ for some $k$.

Lemma: if $a \equiv b \mod N$ and $c \equiv d \mod N$ then:

i) $a + c \equiv b+d \mod N$

ii) $ac \equiv bd \mod N$

iii) $a^n \equiv b^n \mod N$.

Pf: i) $a = b + kN$, $c = d + jN$ so $a+c = b + d + (j+k)N$ so $a+c \equiv b+d \mod N$.

ii) $a = b + kN$, $c = d + jN$ so $ac = (b+kN)(d+jN) = bd + (dk + bj)N + jkN^2 = bd + (dk + bj + jkN)N$. so $ac \equiv bd \mod N$.

iii) by induction $a^1 \equiv b^1 \mod N$ and if $a^n \equiv b^n \mod N$ then $a^{n+1} = a^na \equiv b^nb \mod N \equiv b^{n+1} \mod N$.

So we can apply this to your problem: $237 \equiv 7 \mod 10$ so $237^{1002} \equiv 7^{1002}$.

Notice: If you consider $0, 1,.....,N -1, N, 1 + N, ......, 2N-1, 2N, 2N + 1....$ there are at most $0,1,.....,N-1$ distinct values that can be equivalent $\mod N$ so for all the $a^k$ there must only a finite number of distinct things for $a^k$ to be equivalent $\mod N$ so there must be some $a^k \equiv a^j \mod N$ where $k \ne j$.

And if $a^k \equiv 1 \mod N$ then $a^{nk} = (a^k)^n \equiv 1^n \mod N \equiv 1 \mod N$.

So for example $7^2 \equiv 49 \equiv 9 \mod 10$

$7^3 = 7^2*7 \equiv \mod 10 \equiv 9*7 \equiv 63 \equiv 3 \mod 10$

$7^4 = 7^3*7 \equiv 3*7 \equiv 21 \equiv 1 \mod 10$.

So $7^{1000} = (7^4)^{250} \equiv 1^250 \equiv 1 \mod 10$.

Putting this all together:

$237^{1002} \equiv 7^{1002} = 7^{1000}*7^2 \equiv (7^4)^{250}*49 \equiv 1^{250}*49 \equiv 1*49 \equiv 9 \mod 10$

So $237^{1002}$ and $9$ have the same last digit; $9$.

====

A theorem that is beyond this crash course is Euler's Thereom. If $N$ and $a$ have not common factors, and if $\phi(N) = $ the number of numbers $1,2, ....,N$ that have no common factors with $n$... then $a^{\phi(N)} \equiv 1 \mod N$.

So in your problem $\phi(10) = 4$ because $1,3,7, 9$ have no factors in common with $10$ while $2,4,5,6,8,10$ do. And $7$ and $10$ have no common factors... So $7^4 \equiv 1 \mod 10$. (And we can test that and $7^4 = 49*49 = 40^2 + 2*9*40 + 9^2 \equiv 81 \equiv 1 \mod 10$.)

So $237^{1002} \equiv 7^{1002} \equiv (7^4)^{250}7^2 \equiv 1^{250}49 \equiv 9 \mod 10$.