### Random Post

### Recent Posts

- Enigma 1065: Cute cubes
- Enigma 444: Rows and rows
- Puzzle 50: Football and addition
- Enigma 1066: Members of the clubs
- Enigma 443: The bells they are a-changing
- Tantalizer 455: Ballistico
- Tantalizer 456: Square deal
- Enigma 1067: Bye!
- Enigma 442b: Oh yes I did! Oh no you didn’t!
- Puzzle 51: A multiplication

### Recent Comments

Brian Gladman on Enigma 1065: Cute cubes | |

Jim Randell on Enigma 1065: Cute cubes | |

geoffrounce on Enigma 444: Rows and rows | |

Jim Randell on Enigma 444: Rows and rows | |

geoffrounce on Enigma 1611: Three sister… |

### Archives

### Categories

- article (11)
- enigma (1,167)
- misc (2)
- project euler (2)
- puzzle (42)
- site news (45)
- tantalizer (45)
- teaser (3)

### Site Stats

- 180,599 hits

Advertisements

This Python program runs in 58ms. It uses the

yield fromconstruct so without modification it needs to be run under Python 3.Solution:There are 32 numbers in the list.A rather fiddly solution:

Pretty similar to Jim’s version:

All nine-digit numbers formed from digits 1 to 9 are divisible by 1,3,9.

If the ending digit of the answer is even, then all the candidate numbers are divisble by 1,2,3,6,9, so no candidates are divisible by exactly four of the numbers 1 to 9.

If the ending digit is one of 1,3,7,9, then the candidate numbers can only be divisible by 1,3,7,9, so no candidates are divisible by exactly five of the numbers 1 to 9.

The ending digit therefore has to be 5.

From there, it is not hard to enumerate by hand the patterns of sequences that end at 5.

The ending digit can only be 5 as it is only then searched number can only be divisible by 4 and 5 odd digits exactly as no even number can be a divisor which easily takes us to the solution by a very few number of sets.

I changed that part with the above code, only one is enough, missed that…