## Teaser 2842: The best policy

**From The Sunday Times, 12th March 2017** [link]

George and Martha’s home insurance policy number is a six-figure number consisting of six different digits. George commented that the number was divisible by each of its digits and also by the sum of its digits. Martha then added that, if you deleted the left-hand digit, then you were left with a five-figure number divisible by the sum of its five digits. If you then deleted that number’s left-hand digit, then you were left with a four-figure number divisible by the sum of its four digits, and so on all the way down.

What is their policy number?

[teaser2842]

## Jim Randell 11:59 am

on30 September 2019 Permalink |Using copy and paste we can easily make the expressions to feed to the [[

`SubstitutedExpression()`

]] solver from theenigma.pylibrary.The following run file executes in 78ms.

Run:[ @repl.it ]Solution:The policy number is 384912.I also coded up a custom program for this particular problem.

It runs in 44ms. So it is faster, but the execution time saved is only a fraction of a second, so you could argue it isn’t worth the extra effort for writing the program. Nevertheless, here it is:

We can however use this program to investigate numbers of different lengths, and we find that 6 is the maximum possible length.

LikeLike