# Sunday Times Teaser 2812 – Sum Card Trick

*by Bob Walker*

#### Published: 14 August 2016 (link)

Joe has nine cards, white on one side and grey on the other, with a single digit written on each side of each card. He gave them to Penny to arrange white-side-up to form three 3-figure numbers with the sum of the first two equaling the third. This was her attempt:

**2 1 9 6 5 4 8 7 3**

Then Joe turned the cards over one at a time to reveal

**9 8 7 1 4 2 3 6 5**

where the total of the first two did not equal the third. So he challenged Penny to arrange the cards so that both white-side-up and grey-side-up the third number was the sum of the first two, which she did.

What was her third grey number?

2 Comments
Leave one →

This is rough and ready but it gets the job done – I might improve it when I have more time.

Here’s the solution I came up with on Sunday morning.

It uses the SubstitutedSum() solver from the

enigma.pylibrary to find possible sums for the white side of the cards, and then checks to see if the corresponding digits on the grey side of the cards also forms a valid sum.It runs in 99ms.

The

enigma.pylibrary is available from [ https://www.magwag.plus.com/jim/enigma.html ].