International Kangaroo maths contest puzzle: finding the four-digit number equal to the sum of its digits raised to their own powers
The Guardian has published the solution to a puzzle from the Kangaroo international maths competition, which more than seven million children enter each year. The answer is 3435, so the first digit is 3.

The British newspaper The Guardian published on 9 November the solution to a puzzle from the Kangaroo, an international multiple-choice maths competition taken by more than seven million children every year. The puzzle appears in the paper's puzzle column, which runs every other Monday.
The problem
The task was to find a four-digit number abcd equal to a^a + b^b + c^c + d^d, where each digit is raised to the power of itself. Readers were asked for the first digit a, with the options 2, 3, 4, 5 or 6. Digits may repeat. As an extra challenge, the puzzle also asked for b, c and d.
The solution
The author first calculated the relevant powers: 1^1 = 1, 2^2 = 4, 3^3 = 27, 4^4 = 256 and 5^5 = 3125. Since 6^6 is larger than any four-digit number, no digit can be 6 or more.
He then showed that at least one digit must be 5. If every digit were 4 or lower, the sum could not exceed 1024, which would not satisfy the equation. Two or three fives would force the first digit to be 6 or 9, which is not allowed, and four fives give a sum that does not match 5555. So exactly one digit is 5, the total is below 4000, and a = 3.
Checking the remaining combinations leaves a single valid number: 3435 = 3^3 + 4^4 + 3^3 + 5^5. Therefore b = 4, c = 3 and d = 5.
The article ends by noting that UK entries to the Kangaroo go through UKMT, and that earlier problems are available in the World Olympiads Bank, an archive of almost 100,000 problems from international competitions.

