### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,115)
- misc (2)
- project euler (2)
- puzzle (29)
- site news (43)
- tantalizer (29)
- teaser (3)

### Site Stats

- 166,357 hits

Programming Enigma Puzzles

25 December 2014

Posted by on **From New Scientist #2424, 6th December 2003** [link]

For a summer job I work in an ice-cream parlour. We sell six-scoop “specials” in which customers can choose one scoop each of six different flavours from our extensive range.

One day, a coach party consisting of a prime number of people came in and they each ordered a six-scoop special. I noticed that if you looked at any pair of flavours from our extensive range, then that pair was in precisely one of the coach party’s specials.

How many flavours are there in our extensive range, and how many of the coach party included vanilla (the most popular of our flavours) in their specials?

[enigma1268]

Advertisements

%d bloggers like this:

A bit of analysis (presented in the comments) gives a straightforward program to solve this puzzle.

This Python program runs in 34ms.

Solution:There are 31 flavours. 6 of the specials ordered included vanilla.There are 31 people in the coach party. Each (and every) flavour is included in exactly 6 of the specials ordered by the coach party.

Given the analysis above we see that the number of people is:

Which has integer solutions when k = 3n and k = 3n + 1.

[Case 1] For k = 3n:

[Case 1a] When n is even, n = 2m

which will be composite when m > 1, and when m = 1 (k = 6) gives p = 31, which is prime and thus gives rise to a solution.

[Case 1b] When n is odd, n = 2m+1

which is obviously composite for m > 0, and when m = 0 gives p = 8, which is also composite. So gives no further solutions.

[Case 2] For k = 3n + 1:

[Case 2a] When n is even, n = 2m

which is composite for m > 0, and gives p = 1 (a non-prime) when m = 0. So gives no further solutions.

[Case 2b] When n is odd, n = 2m + 1:

which is composite for m > 0, and gives p = 14 (composite) for m = 0. So gives no further solutions.

Hence there is a single solution when k = 6 of p = 31.