Skip to content

Range of five-digit numbers with distinct digit-pair sums

Question

Call a five-digit integer good if no two different pairs of its digits have the same sum (for example, the three-digit 174174 would qualify). If xx and yy are the smallest and largest good five-digit integers, what is y−xy-x?

Short answer

88505. Build greedily. Largest: 9,8,79,8,7 are fine, 66 fails (6+9=7+86+9=7+8), 55 works, then 44 and 33 fail and 22 works, so y=98752y=98752. Smallest: 1,0,21,0,2, then 33 fails, 44 works, 55 and 66 fail, 77 works, so x=10247x=10247 and y−x=88505y-x=88505.

Adapted from QuantQuestions.io; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution