The Locker Code
Laura has forgotten the three-digit code to her locker, but she remembers these clues:
1) The three digits add up to 15.
2) The middle digit is exactly the mean (the average) of the other two.
3) If the code is written backwards (reading the digits from right to left), the resulting number is 198 more than the original code.
What is the locker code?
See solution
The code is 456.
Call the hundreds, tens and units digits a, b and c. By clue 2, b = (a + c)/2, so a + c = 2b. Combined with clue 1, a + b + c = 3b = 15, which gives b = 5 and a + c = 10.
The original number is 100a + 10b + c and the reversed one is 100c + 10b + a. Their difference is 99(c − a), which must equal 198, so c − a = 2.
From a + c = 10 and c − a = 2 we get c = 6 and a = 4. The code is 456, and it checks out: 4 + 5 + 6 = 15, 5 is the mean of 4 and 6, and 654 − 456 = 198. There is no other solution, since each step pins down the values uniquely.