### 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

While I was thinking of a more elegant way to approach this puzzle I wrote this simple Python program to brute force it, and was surprised to find that it ran in 2.3s (using PyPy) – well before I’d written a different program to solve it.

Solution:The account number is 9624317850.Here is a more efficient Python program to solve the puzzle. It runs in 35ms.

However this provides is a good example of programmer efficiency. If you are only going to run the program once, then clearly the above code, which took a couple of minutes to write and runs a few seconds, is much more time efficient than time it took to come up with the following code.

If however you want to re-use the code to solve thousands of similar problems a day, clearly this second program is going to make up for the development time on the first day.