By Euler's theorem, x4 ≡ 1 mod 10 and therefore x5 ≡ x mod 10.
This means that we can deduce the one's digit of x just by looking at the one's digit of x5.
To get the ten's digit, we have to guess by the size of x5. We ignore the last 5 digits and fins the largest 5th power that is not larger than the remaining digits. This power's fifth root will be the ten's digit of x.
This means that we can deduce the one's digit of x just by looking at the one's digit of x5.
To get the ten's digit, we have to guess by the size of x5. We ignore the last 5 digits and fins the largest 5th power that is not larger than the remaining digits. This power's fifth root will be the ten's digit of x.
Here's a useful table
15 = 1
25 = 32
35 = 243
45 = 1,024
55 = 3,125
65 = 7,776
75 = 16,807
85 = 32,768
95 = 59,049
105 = 100,000