Safe Safe Except for Mathematical Yeggs
To open a safe, Stu Dent knows that the combination is three single digits (0  9). for example, the digits 549 formed his old combination...that is until his clever sister Pepso Dent rekeyed the safe to a new combination.
But Pepso did leave the cryptic message: "To brother Stu who acts so wise!...The new combination is the last three digits of 9^{6!}."
Stu Dent asks for your help...What is the new combination?
Source: Adapted from D. Piele's 7th International Computer Problem Solving Contest, 1987
Hint: You could try every one of the 10x10x10 possible combinations, but that would be no fun and take a lot of time.
Look for possible patterns in powers of 9...
Solution Commentary: Some observed patterns in 9^{n}:
 If n is even, the 1's digit is 1, otherwise it is a 9
 The 10's digits cycle through the sequence 0826446280...some nice symmetry!
 No nice pattern seems evident in the 100's digits
Thus, since 6! = 720, we can conclude that the combination is X01, as 720 is even and a multiple of ten. Now, Stu would have to only test 10 combinations, 001, 101, ..., 901.
But that's no fun....Ignoring all of the "uninvolved" digits, focus on the patterns of the last three digits of 9^{n} for n a multiple of 10:
 9^{10} = ...401
 9^{20} = ...801
 9^{30} = ...201
 9^{40} = ...601
 9^{50} = ...001
BINGO! There was a pattern lurking in the 100's digits! Now, since 720 = 14*50 + 20, we know that the combination will be 801.
