## Teaser 2937: Long division

**From The Sunday Times, 6th January 2019** [link]

I wrote down a 2-digit number and a 5-digit number and then carried out a long division.

I then erased all of the digits in the calculation, other than the 1’s, and so finished up with the image above.

If I told you how many different digits I had erased, then you should be able to work out my two original numbers.

What were my two original numbers?

[teaser2937]

## Jim Randell 6:52 am

on11 March 2019 Permalink |Here’s a solution using the [[

`SubstitutedDivision()`

]] and [[`filter_unique()`

]] functions from theenigma.pylibrary.This program runs in 100ms.

Run:[ @repl.it ]Solution:The two original numbers were 37 and 58571.The diagram can describe 3 possible divisions:

The first and third of these have 8 different digits in the long division sum, the second one uses 9 different digits and so gives the solution.

Although the puzzle states that the erased digits are not 1 (and the program ensures this), there are no further solutions to the more general problem where the erased digits may be 1. We can see this by adding [[

`1`

]] in the [[`digits`

]] specification on line 7 (or just removing that line completely to allow any digit to be used).LikeLike

## GeoffR 7:16 pm

on14 March 2019 Permalink |This solution found the same three possible solutions

However, only the solution 58571 / 37 = 1583 had a unique number of digits erased by the setter, as the other two solutions had the same number of digits erased. The two digit number is therefore 37 and the five digit number is 58571.

LikeLike