### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 178,002 hits

Advertisements

Programming Enigma Puzzles

4 January 2016

Posted by on **From New Scientist #2342, 11th May 2002**

At snooker a player scores 1 point for potting one of the 15 red balls, but 2, 3, 4, 5, 6 or 7 points for potting one of the 6 “colours”.

Whyte potted his first red, then his first colour, then his second red, then his second colour, and so on until he had potted all 15 reds, each followed by a colour. Since the colours are at this stage always put back on the table after being potted, the same colour can be potted repeatedly.

After Whyte had potted each of the 15 colours his cumulative score called by the referee was always a semi-prime. A semi-prime is the product of two prime numbers; the square of a prime number counts as a semi-prime.

After potting the 15 reds and 15 colours a player tries to pot (in this order) the balls scoring 2, 3, 4, 5, 6 and 7 points. Whyte did so to complete a total “clearance”, but his cumulative score after each of those six pots was never a semi-prime.

What was his final score?

Thanks to Hugh Casement for providing a complete transcript for this puzzle.

[enigma1186]

Advertisements

%d bloggers like this:

This Python 3 program runs in 190ms.

Solution:Whyte’s final score was 114.There are many ways (1848) to achieve a final score of 114, here’s one:

Not very different:

Yes, there are only two final scores (114 and 138) that enable the second stage of the game to have all non-semi-prime scores and, of those, 138 requires the first stage to have scores that leap from 95 to 106. A neat pencil-and-paper Enigma.

Indeed. Armed with a list of semi-primes we can see that the only possible (semi-prime) scores after the reds are cleared are 87 or 111, as these are the only ones such that adding the colours (2, 3, 4, 5, 6, 7) cumulatively give a sequence of non-semi-primes. These correspond to a final score of 114 and 138 respectively.

The points for a red + a colour must be one of (3, 4, 5, 6, 7, 8), so, for 111, the only possible score before the last red + colour must be 106 (= 111 − 5), and there are no possibilities for the score before that (all of 98 – 103 are semi-prime).

So the only possible solution is score of 87 after all the reds are potted, giving a total score of 114. And, as my program finds, there are many ways to achieve this.