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

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

The discussion focuses on determining the last digit of the expression x^x^x^x, where x is an integer. The key method involves reducing x modulo 10 and applying Euler's theorem, specifically using phi(10) = 4 for exponent reduction. For example, to compute 13^13^13^13 mod 10, the base is reduced to 3, and the exponent is simplified using phi(10), resulting in 3^1 = 3 mod 10. Special cases are addressed, such as when x is not relatively prime to 10, where specific rules apply, like 5^n = 5 mod 10 for multiples of 5.

PREREQUISITES
  • Understanding of modular arithmetic
  • Familiarity with Euler's theorem
  • Knowledge of the Euler totient function, phi(n)
  • Basic exponentiation rules
NEXT STEPS
  • Study Euler's theorem applications in modular arithmetic
  • Learn about the Euler totient function and its properties
  • Explore advanced modular exponentiation techniques
  • Investigate cases where bases are not coprime to the modulus
USEFUL FOR

Mathematicians, computer scientists, and students interested in number theory and modular arithmetic techniques.

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
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 6 ·
Replies
6
Views
1K
  • · 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