**From New Scientist #2440, 27th March 2004**

Janet was trying to invent one of those puzzles where every letter stands for a different digit (0 to 9).

She looked at the sum of the two-figure numbers SO + BE = IT and found that there were several possible answers, such as 21 + 37 = 58. John studied the puzzle and also found several answers, such as 5 × 0 + 3 × 6 = 2 × 9. But he had misunderstood and had treated the expression as being algebraic. When they compared answers they discovered there were a few sets of the 6 letter-values which they agreed about.

Which digits do not appear in any of their common answers?

**Note:** I am still waiting for a phone line to be connected at my new house, so I only have sporadic access to the internet at the moment. The current estimate is that I should have a connection in early November.

[enigma1282]

### Like this:

Like Loading...

This Python program uses the [[

`SubstitutedSum()`

]] solver from theenigma.pylibrary. It runs in 54ms, about twice as fast as using [[`itertools.permutations()`

]].Solution:The digits 0 and 4 do not appear in any of the common solutions.The terms SO and BE are interchangeable, so there are essentially three different solutions.

19 + 37 = 56; 1×9 + 3×7 = 5×6.

29 + 38 = 67; 2×9 + 3×8 = 6×7.

39 + 18 = 57; 3×9 + 1×8 = 5×7.

Hi Geoff, I was wondering about the restriction that all s,o,b,e,i,t are non-zero.

s,b,i have to be non-zero to make two figure numbers, but I can’t see why o,e,t necessarily have to be non-zero.

Hi Arthur, you are right, but result not affected. Your solution is neat.

Any reason not to use Python 3 ?

I started using 2.7 a few years ago as I wanted to use bitarray for some prime number sieves. I think it was only available for 2.7 at the time, and I have never got round to upgrading. The other factor is that if I write code in 2.7, it works on Python 2 and 3 (with a few minor exceptions)

The set of options can be reduced by noting that either:

t=o+e ; i=s+b

t=o+e-10 ; i=s+b+1

depending on whether there is a carry in the non-algebraic interpretation.

The number of options can be reduced even further: