## Teaser 2950: Ten digits

**From The Sunday Times, 7th April 2019** [link]

Without repeating a digit I have written down three numbers, all greater than one. Each number contains a different number of digits. If I also write down the product of all three numbers, then the total number of digits I have used is ten. The product contains two pairs of different digits, neither of which appear in the three original numbers.

What is the product?

[teaser2950]

## Jim Randell 9:26 am

on5 April 2019 Permalink |The product has to be long enough to accommodate two pairs of different digits in, so it must be at least 4 digits long.

But the total multiplication sum only uses 10 digits, so the three original numbers can use at most 6 digits, and as the number of digits in each multiplicand is different they must use at least 6 digits, so the sum looks like one of these:

We can solve these using the [[

`SubstitutedExpression()`

]] solver from theenigma.pylibrary (although it is not especially quick). The following run file executes in 619ms.Run:[ @repl.it ]Solution:The product is 8778.The full sum is:

The solution uses the

`XYYX`

pattern for the product, and is the only solution using that pattern.However, without the restriction that

Ais greater than 1 we can find a further solution using the`XXYY`

pattern:And there are no solutions that use the remaining

`XYXY`

pattern. (This can be seen by observing that the product has a prime factor of 101, and we cannot have a three digit multiple of 101 that does not have repeated digits).LikeLike

## Jim Randell 10:35 am

on5 April 2019 Permalink |Here is a faster solution in Python. It considers possible values for the result of the multiplication, and then factors the result into 1-,2-,3-digit numbers.

It runs in 96ms.

LikeLike

## GeoffR 11:28 am

on11 April 2019 Permalink |LikeLike