### Random Post

### Recent Posts

- Tantalizer 450: Marriage problems
- Enigma 1057: Recycled change
- Enigma 452: Figure out these letters
- Puzzle 46: I lose my specs
- Enigma 1058: A row of colours
- Enigma 451: Double halved
- Tantalizer 451: Death rates
- Enigma 1059: Century break
- Enigma 450: A pentagonal problem
- Puzzle 48: Verse on the island

### Recent Comments

Jim Randell on Tantalizer 450: Marriage … | |

Brian Gladman on Enigma 1057: Recycled cha… | |

Jim Randell on Enigma 1057: Recycled cha… | |

geoffrounce on Enigma 452: Figure out these… | |

Jim Randell on Enigma 452: Figure out these… |

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (50)
- teaser (3)

### Site Stats

- 184,974 hits

Advertisements

I adapted my solution to Enigma 1450 (which is a similar problem, but with triangular numbers instead of square numbers) to give a constructive solution. This is a Python 3 program that runs in 66ms.

Solution:The five remaining dominoes are: 0-2, 1-1, 2-2, 3-3, 5-5.There are two chains that achieve the maximum possible square with five dominoes remaining, of which four are doubles. These are:

0-0, 0-1, 1-2, 2-3, 3-4, 4-5, 5-6, 6-1, 1-5, 5-2, 2-6, 6-3, 3-5, 5-0, 0-4, 4-6, 6-6, 6-0, 0-3, 3-1, 1-4, 4-4, 4-2 (unused: 0-2, 1-1, 2-2, 3-3, 5-5).

0-0, 0-1, 1-2, 2-3, 3-4, 4-5, 5-6, 6-3, 3-1, 1-4, 4-6, 6-0, 0-5, 5-1, 1-6, 6-6, 6-2, 2-0, 0-3, 3-5, 5-5, 5-2, 2-4 (unused: 0-4, 1-1, 2-2, 3-3, 4-4).

But the puzzle requires that the chain “could not have been shorter at any stage”. To do this I examine the indices at the chain at which square totals are achieved and choose the smallest tuple. For the two cases above the indices are:

(0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 22)

(0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 15, 19, 22)

and so the first chain is the answer to the puzzle, as each index is ≤ the corresponding index in the other solution(s).

But it’s not guaranteed that there would be a solution. If the second sequence went …, 10, 13, 14, 19, … then each sequence would be the shortest at different indices so there would be no overall solution that is the shortest at every stage. However given that there is a solution, it will be the smallest when they are lexicographically ordered.