**From New Scientist #2215, 4th December 1999** [link]

At snooker a player scores 1 point for potting one of the 15 red balls, but scores better for potting any of the 6 coloured balls: 2 points for yellow, 3 for green, 4 for brown, 5 for blue, 6 for pink and 7 for black.

Davies potted his first red ball, followed by his first coloured ball, then his second red ball, and so on until he had potted all 15 red balls, each followed by a coloured ball.

After potting 15 red balls and 15 coloured balls, Davies had scored exactly 100 points; but it was interesting because in calling his score after each pot the referee had called every perfect square between 1 and 100.

**Question 1:** If in achieving this Davies had potted as few different colours as possible, which of the coloured balls would he have potted?

In fact Davies had brought a greater variety to the choice of coloured balls potted: for instance the 2nd, 5th, 8th, 11th and 14th coloured balls potted were all different and if I told you what they were you could deduce with certainty which ball was potted on each of his other pots.

**Question 2:** What (in order) were the 2nd, 5th, 8th, 11th and 14th coloured balls potted?

(In answering both questions give the colours).

[enigma1059]

### Like this:

Like Loading...

This Python 3 program starts by working out possible combinations of colours that will go with the 15 reds in order to make a score of 100, and then examine sequences of red+colour pairs made from these combinations that have the required squares as a subsequence of the scores called in potting that sequence.

From this list we can find the sequences that use the smallest number of different colours, and also sequences where the given balls are all different, and knowing their values gives a unique sequence.

It runs in 1.36s.

Run:[ @repl.it ]Solution:(1) It is possible to achieve this potting only 2 different colours – the green (3 points) and the black (7 points); (2) The specified balls are: blue, yellow, brown, black, green.For part 1:

The green is potted 5 times (5 × 3 points = 15 points), and the black is potted 10 times (10 × 7 points = 70 points). Together these make 85 points, along with the 15 points for the reds this totals 100 points.

The scoring sequence and total score is:

The colours in the sections marked [*] can be potted in any order giving rise to 2×2×3 = 12 possible sequences.

For part 2:

The yellow is potted 2 times, the green 1 time, the brown 1 time, the blue 1 time, the pink 1 time, the black 9 times. 2×2 + 1×3 + 1×4 + 1×5 + 1×6 + 9×7 = 85 points.

The sequence is:

The 2nd, 5th, 8th, 11th and 14th colours are shown in parentheses.

For part 2, there are 368 sequences of balls that use more than 2 different colours and have the required balls all different, but only one of these sequences is uniquely identified if the values of these balls are given.

My version requires my number theory library that I make available here. It also requires either Jim’s enigma.py library or my partition_unique subroutine.