An expert question on remainders for P5–P6, with a step-by-step solution, diagrams and the answer. Common in the Hua Xia Cup's P3 to P6 papers; harder ones need several remainder conditions to hold at once.
The question
A computer challenge at maths camp: work out 1¹ + 2² + 3³ + 4⁴ + … + 1123¹¹²³ — each whole number from 1 to 1123 multiplied by itself that many times (3³ is three 3s multiplied, 4⁴ four 4s, and so on), all added up.
The answer is too long, so the computer shows only its last digit.
What digit does the computer show?
Show the hints (3)
💡Hint 1: The sum's last digit depends only on each term's last digit. Do 2² and 12¹² end alike? 3³ and 13¹³?
💡Hint 2: A number multiplied by itself again and again has last digits repeating every 4. So a term's last digit depends on the number's last digit and on its remainder on division by 4; only when both repeat does everything repeat.
💡Hint 3: Last digits repeat every 10 numbers and remainders on division by 4 every 4, so the terms' last digits repeat every 20. Add the last digits of the first 20 terms first.
Worked solution
Have a go first, then read the solution step by step.
1.Any number's powers end in digits that repeat every 4 (2, 4, 8, 6, 2, …). So the last digit of k multiplied by itself k times depends on k's last digit and on k's remainder on division by 4.
2.k's last digit repeats every 10 numbers and its remainder on division by 4 every 4; the LCM of 10 and 4 is 20, so the terms' last digits repeat every 20.
3.Last digits of 1¹ to 20²⁰: 1, 4, 7, 6, 5, 6, 3, 6, 9, 0, 1, 6, 3, 6, 5, 6, 7, 4, 9, 0, adding to 94.
4.1123 ÷ 20 = 56 remainder 3: after 56 groups come 3 more terms, ending like the first 3: 1 + 4 + 7 = 12. The last digits add to 56 × 94 + 12 = 5276.
5.So the sum ends in 6.
⚠️Common mistake: assuming the terms' last digits repeat every 10 (2² ends in 4, but 12¹² ends in 6).