# The last digit for 3^(2019)

Which would be the last digit for $$3^{2019}$$ ?

You can

check last digits for $$3^x$$ with $$x=\{0,1,2,3,4,5,6\}$$ and see if something is repeated.

And afterwards

think about modulus for the exponent number and the pattern found.

• No need to include hints, this is easy enough already for someone who knows maths :-) – Rand al'Thor Apr 9 '20 at 9:34
• Should I remove the hints? Just new to this Stackexchange site and not sure when and whether should I include hints when knowing the answer. – Cedric Zoppolo Apr 9 '20 at 10:06
• Hints are usually added after posting the puzzle, as a way to point people in the right direction if nobody gets the answer for a while. I'd say you can remove them. And yes, LaTeX format is also possible in titles, but it makes questions ineligible for the Hot Network Questions list. – Rand al'Thor Apr 9 '20 at 10:11
• This looks more like a math problem, not puzzle. – trolley813 Apr 9 '20 at 10:36
• @trolley813 I disagree. It's easy for those of us who've studied some number theory, sure, but the method of solution would be very interesting and "aha"-ish for someone who hasn't seen it before. I could easily imagine this as an olympiad problem, for example (not IMO but maybe a subnational olympiad). Sometimes we forget that what's second nature to us may be a fascinating innovation for non-mathematicians :-) – Rand al'Thor Apr 9 '20 at 11:10

Because

$$3^4=81\equiv1 \:(\text{mod}\;10)$$,

and

$$2019=(4\times504)+3\equiv3\:(\text{mod}\;4)$$,

we have

$$3^{2019}=(3^4)^{504}\times3^3\equiv(1)^{504}\times3^3=27\equiv7\:(\text{mod}\;10)$$,

$$7$$.

• Equally interesting is: "what is the first digit of $3^{2019}$?". – WhatsUp Apr 13 '20 at 22:48

As we know,

Powers of 3 are numbers ending in $$\{1,3,9,7\}$$ sequentially.

As

$$MOD(2019,4)=3$$

So we know that

The last digit for $$3^{2019}$$ will be the forth in the sequence stated in the beginning. As if result was 0 it would have been the first element.

So the result is that the last digit for $$3^{2019}$$ is:

$$7$$

• Well, the first spoilerblock ("As we know ...") is really the key point. Rather than assuming such a pattern (even though I do know it's always going to be like that), in my answer I gave an argument which anyone could follow even knowing nothing about modular arithmetic, as long as they know what $\equiv\:(\text{mod}\;n)$ actually means. – Rand al'Thor Apr 9 '20 at 10:29
• The list in the first spoilerblock isn’t in the correct order, although it’s not specified if it’s 0-indexed or 1-indexed – Charlie Harding Apr 16 '20 at 19:45
• @CharlieHarding, you are right. Just corrected the answer. Thanks. – Cedric Zoppolo Apr 16 '20 at 23:13