The number, 1406357289, is a 0 to 9 pandigital number because it is made
up of each of the digits 0 to 9 in some order, but it also has a rather
interesting sub-string divisibility property.
Let
be the 1st digit,
be the 2nd digit, and so on. In this way, we note the following:
- is divisible by 2
- is divisible by 3
- is divisible by 5
- is divisible by 7
- is divisible by 11
- is divisible by 13
- is divisible by 17
To solve this I checked all the pandigital numbers from 1,023,456,789 to
9,876,543,210 to see if they fit this pattern. I used the Pandita algorithm
to permute through the numbers and made a batch of functions to do all
the steps for solving it.
I want to find a faster solution though. This one relies on checking 10!
- 9! numbers and takes over 2 seconds...
60,313