I was checking the following number theory exercise:
Find the digit of the units for the number
$(5)(7^{29})+(8)(9^{72})$
Here goes what I have:
$5 \equiv -5$ $(mod$ $10)$
$7^{29}\equiv $ $7(mod$ $10)$
$8 \equiv -2$ $(mod$ $10)$
$9^{72}\equiv $ $1(mod$ $10)$
Then $-5+7-2+1 = 1$. So $1$ should be the digit of the units, but the answer is three.
Any help will be really appreciated.
$9^n$ has a units digit of $9$ if $n$ is odd, and a units digit of $1$ if $n$ is even. This is pretty easy to prove/test. So, $8\cdot 9^{72}$ has a units digit of $8$.
We do a similar thing for $7$
$7^1$ = 7
$7^2$ = 49, so units digit is $9$
$7^3$ has units digit of $3$, since $7^2$ had a units digit of $9$ and $7*9 = 63$.
$7^4$ has a units digit of $1$, since $7*3 = 21$.
So, there is a pattern in the units digits of exponents of $7$. The pattern seems to be $1,7,9,3,1,7,...$. Then, since $29 \ \text{mod} 4 = 1$, we can say that $7^{29}$ has the same units digit as $7^1$, so it ends in $7$. Multiplied by $5$ gives us a units digit of $5$. We add the two units digits together to get $13$, so the number has a units digit of $3$.