Profile photo for Divanshu Garg

Answer: [math]1[/math]

There are two ways to visualize this:

1. The easier one being that every number follows a repetition pattern in the units place which you can easily notice. If you write down the first few powers of 3:

[math]1, 3, 9, 27, 81, 243, 729...[/math]

Now you can see that the pattern is: 1-3-9-7
or for every
[math]3^x[/math], the answer is:

  • [math]1[/math], if [math]x\pmod{4} = 0[/math]
  • [math]3[/math], if [math]x\pmod{4} = 1[/math]
  • [math]9[/math], if [math]x\pmod{4} = 2[/math]
  • [math]7[/math], if [math]x\pmod{4} = 3[/math]


2. The second more general way is computing
[math]a^b\pmod{10}[/math] which would work for any [math]a[/math] and [math]b[/math].

It exploits the fact that [math]a^b\pmod {m}[/math] can be rewritten as [math](a\pmod{m})^{b\pmod{\phi(m)}}[/math], where [math]\phi(m)[/math] is the Euler's totient function of [math]m[/math].

Since, [math]\phi(10) = 4[/math], your problem becomes, [math](3\pmod{10})^{460\pmod{4}}[/math],
or more simply,
[math]3^0[/math], which is [math]1[/math].

View 13 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025