New Scientist Back Page Puzzle 23 – Circling the Squares
by Rob Eastaway
From New Scientist #3249, 28th September 2019
Darts player Juan Andred has noticed that on a standard dartboard, there are some neighbouring pairs of numbers that add up to a square number. For example, 20 and 5 make 25, while 6 and 10 add up to 16. He has been wondering if he can come up with a new arrangement of the numbers 1 to 20 so that all neighbouring pairs add up to a square number. And he has nearly succeeded.
He has 20 at the top of the board, and every pair of neighbours adds to a square — with one exception. On his new board, 18 doesn’t form a square with its clockwise neighbour, which is 15, or with its anticlockwise neighbour.
What does Juan’s “square” dartboard look like?
One Comment
Leave one →
-
Brian Gladman permalink1234567891011121314151617181920# the set of perfect squares less than 40sqrs = set(x * x for x in range(1, 7))# find a complete sequence of numbers from <nbrs># in which adjacent items sum to squaresdef solve(nbrs, seq):if not nbrs:yield seqelse:for x in nbrs:if seq[-1] + x in sqrs:yield from solve(tuple(i for i in nbrs if i != x), seq + (x,))# start the sequence with the numbers that don't sum to a squarefor s in solve(set(range(1, 21)).difference([15, 18]), (18, 15)):# expreess the sequence starting at 20i = s.index(20)print(s[i:] + s[:i])