Sunday Times Teaser 2786 – Out of Order
by Victor Bryant
Published: 14 February 2016 (link)
I have written down five positive whole numbers whose sum is less than 100. If you wrote the numbers in words, then you would find that each of them begins with a different letter of the alphabet. (Surprisingly, the same is true of the five numbers obtained by increasing each of my five numbers by one.) If you write my five numbers in words and put them in alphabetical order, then they will be in decreasing order.
What (in decreasing order) are my five numbers?
2 Comments
Leave one →
Not very elegant but it gets the job done.
I wrote a recursive solution (using some routines from the enigma.py library). I wasn’t that worried about speed, so I generate sequences of 5 numbers in decreasing numerical order, but increasing alphabetical order, and then apply the condition that the initials are all different if the numbers are increased by one. It runs in 77ms.
I note that the the initial letters are also all different when the numbers are increased by 2, but this condition isn’t sufficiently strong to replace the additional condition in the question and still arrive at a unique solution.