Figuring the Last Digit of x^x^x^x

  • Context: Undergrad 
  • Thread starter Thread starter bob j
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around determining the last digit of the expression x^x^x^x, where x is an integer. Participants explore various mathematical techniques, including modular arithmetic and Euler's theorem, to simplify the problem.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant suggests reducing x modulo 10 and the exponents by successive applications of phi functions to simplify the calculation of the last digit.
  • Another participant requests a simple example to clarify the proposed method.
  • A participant explains the use of Euler's theorem, stating that a^phi(n) = 1 mod n if gcd(a,n) = 1, and provides an example using 13^13^13^13 to illustrate the reduction process.
  • The same participant notes that if x is not relatively prime to 10, different methods must be employed, providing the example of 5^5^5^5 to demonstrate that it simplifies directly to 5 mod 10.
  • Participants are encouraged to reduce the expression as much as possible, suggesting that finding the last digit is generally straightforward.

Areas of Agreement / Disagreement

Participants present various methods and examples, but there is no consensus on a single approach, particularly regarding cases where x is not relatively prime to 10.

Contextual Notes

The discussion does not resolve the complexities involved when x is not relatively prime to 10, and the applicability of different methods remains unclear in those cases.

bob j
Messages
22
Reaction score
0
Hi All,
suppose I have something like x^x^x^x where x is an integer. Is there any trick to figure the last digit of the result?

Thank you
 
Physics news on Phys.org
You can reduce x modulo 10, the exponent of x by modulo phi(10) = 4, the next exponent by phi(phi(10))=3, and the last by phi(phi(phi(10))=2, can you see why?
 
not really.. could you possibly give me a simple example?
 
I was a bit quick, but basically you make repeated use of Eulers theorem that says a^phi(n) = 1 mod n if gcd(a,n) = 1.

What you want is x^x^x^x mod 10. Say, 13^13^13^13. We can by elementary modulo arithmetic reduce the base mod 10, giving 3^13^13^13. By eulers theorem, we can reduce the exponent by phi(10) = 4 (do you understand this?). Thus we need to find 13^13^13 mod 4. Reducing base: 1^13^13=1, hence giving 13^13^13^13=3^1=3 mod 10.

But, if x is not relatively prime to 10, or phi(10), etc.. you must do some other tricks. Say you want to find 5^5^5^5 mod 10. You can however in this case use that 5^n = 5 mod 10 for all n, hence 5^5^5^5 = 5. This works for any multiple of 5. You can do the even numbers for yourself.

Just try to reduce as much as you can. Finding the last digit is almost always very easy.
 

Similar threads

Replies
48
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 26 ·
Replies
26
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K