### 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 is a similar path counting problem to

Enigma 1711, although in 2 dimensions rather than 3.The following Python code can either count the paths directly or use a formula to compute the number of paths. In either case it runs in 41ms.

Solution:There are 3,003 shortest paths to the four points.The solution is found on a 10×10 square.

If you remove the condition that the number of paths be less than 10,000 you find that the next lowest solution is on squares with sides 66, 68, 70, 72, 74, 76, 78 and there are 61,218,182,743,304,701,891,431,482,520 shortest paths.

The next solution occurs on squares with sides 442 to 544, and there are 3,537,835,171,522,765,057,006,983,148,520,718,494,957,187,357,011,427,136,691,375,227,388,082,606,684,583,032,666,088,334,962,061,461,901,090,477,513,197,821,330,000,906,170,565,587,040,820,236,444,389,470,701,575,515,092,325,417,606,033,095,416,151,914,090,271,577,807,800 shortest paths.