JMC 2018 Q18
18. Between them, the two five-digit integers \(M\) and \(N\) contain all ten digits from 0 to 9.
What is the least possible difference between \(M\) and \(N\)?
- A 123
- B 247
- C 427
- D 472
- E 742
Junior Mathematical Challenge 2018, Question 18. © UK Mathematics Trust. Original paper on ukmt.org.uk
Answer: B 247
The first digits of the two numbers will need to be as close as possible to each other. Since they cannot be equal, they will have to differ by 1; say they are \(n\) and \(n + 1\). The difference between the two numbers will then be minimised by making the four digits after \(n + 1\) as small as possible and the four digits after \(n\) as large as possible. The smallest four-digit number available is 0123 and the largest is 9876. So we need to make \(n = 4\) and then the required diference is 50123 − 49876 = 247.
Solution © UK Mathematics Trust, from the JMC 2018 solutions. Longer versions with investigations: Solutions and investigations (PDF).