### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,130 hits

Programming Enigma Puzzles

6 April 2018

Posted by on **From New Scientist #1592, 24th December 1987** [link]

After our successful pantomime production in which I played the leading lady, I gave my little costarring helpers some gifts from a big bag of different trinkets, and they each got a different number and none were left.

To make it fairer I gave each helper 10p for each gift that he

didn’tget and deducted 40p for each gift that hedidget, but that still gave each of them some 10p coins as well as some gifts. It cost me £12.60 in addition to the gifts.What was the highest number of gifts received by any helper (that little fellow got less than 50p cash)?

What part was I playing?

This puzzle completes the archive of *Enigma* puzzles from 1987. There is now a complete archive from the start of *Enigma* in February 1979 to the end of 1987, and also from February 2000 to the final *Enigma* puzzle in December 2013. Making 1162 *Enigma* puzzles posted so far, which means there are about 626 left to post.

[enigma442b] [enigma442]

%d bloggers like this:

126 ten-pence coins were given out. If there are

khelpers who geta, b, c, d, …gifts, then in totalN = a + b + c + d + …gifts are distributed.If a helper receives

xgifts they also getN − 5x10p coins.There are 126 coins in total, so:

so:

k > 5.Also each helper receives at least one coin, so:

This Python program runs in 158ms.

Run:[ @repl.it ]Solution:The helper who received the most gifts got 12. The role involves a leading lady with 7 “little co-stars”, so is probably Snow White.There are 7 helpers. Each of which receives a split of 63 available gifts. The actual split is (6, 7, 8, 9, 10, 11, 12), and the corresponding number of coins received is (33, 28, 23, 18, 13, 8, 3). So the helper who received 12 gifts also got three 10p coins (30p).

In fact, in order to arrive at a single solution, we need to interpret “some 10p coins” as “at least two 10p coins”. Otherwise we can also get solutions with 6 helpers, the luckiest of which receives 25 gifts (of the 126 available) and one 10p coin.