Identify the last two digits of the given number:
98765432
Since we're concerned with the last two digits, we'll use mod-100 arithmetic.
Here's a table of powers of integers from 9 down to 2, mod 100:
power \ base number
1 9 8 7 6 5 4 3 2
2 81 64 49 36 25 16 9 4
3 29 12 43 16 25 64 27 8
4 61 96 1 96 25 56 81 16
5 49 68 7 76 25 24 43 32
6 41 44 49 56 25 96 29 64
7 69 52 43 36 25 84 87 28
8 21 16 1 16 25 36 61 56
9 89 28 7 96 25 44 83 12
10 1 24 49 76 25 76 49 24
11 9 92 43 56 25 4 47 48
12 81 36 1 36 25 16 41 96
13 29 88 7 16 25 64 23 92
14 61 4 49 96 25 56 69 84
15 49 32 43 76 25 24 7 68
16 41 56 1 56 25 96 21 36
17 69 48 7 36 25 84 63 72
18 21 84 49 16 25 36 89 44
19 89 72 43 96 25 44 67 88
20 1 76 1 76 25 76 1 76
21 9 8 7 56 25 4 3 52
22 81 64 49 36 25 16 9 4
23 29 12 43 16 25 64 27 8
24 61 96 1 96 25 56 81 16
25 49 68 7 76 25 24 43 32
26 41 44 49 56 25 96 29 64
27 69 52 43 36 25 84 87 28
28 21 16 1 16 25 36 61 56
29 89 28 7 96 25 44 83 12
30 1 24 49 76 25 76 49 24
31 9 92 43 56 25 4 47 48
32 81 36 1 36 25 16 41 96
33 29 88 7 16 25 64 23 92
34 61 4 49 96 25 56 69 84
35 49 32 43 76 25 24 7 68
36 41 56 1 56 25 96 21 36
37 69 48 7 36 25 84 63 72
38 21 84 49 16 25 36 89 44
39 89 72 43 96 25 44 67 88
40 1 76 1 76 25 76 1 76
41 9 8 7 56 25 4 3 52
42 81 64 49 36 25 16 9 4
43 29 12 43 16 25 64 27 8
44 61 96 1 96 25 56 81 16
Clearly the 4^(3^2) doesn't matter as a power of 5: all powers of 5 higher than 1 end in 25, and we can ignore the last three columns.
6^25=76 mod 100
Powers of 7 are in a cycle of 4 and 76 is divisible by 4, so 7 raised to its power ends in 01.
8 has a cycle of 20 and every power of 8 where the exponent is 1 mod 20 ends in 08.
9^08 = 21 mod 100
Thus 21 is the answer.
By the way,
10 N=2
20 for B=3 to 9
30 N=modpow(B,N,10^100)
40 next
50 print N
finds that the last 100 digits of the number are
3566949280962919105723762106797763143495565517047216793598832637327585156823502301057525148779806721
|
Posted by Charlie
on 2013-02-08 17:10:54 |