### 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,129 hits

Programming Enigma Puzzles

23 October 2019

Posted by on **From New Scientist #969, 2nd October 1975 **[link]

There is a fascinating gallstone museum in the Yorkshire town of Wollycobble and folks come from miles around. But it costs a bit of brass to run and there has long been an admission charge. On the principle that the older you are the more interesting other folk’s insides become, the rate is traditionally 1p per year of age. Thus a 10 year old pays 10p, a chap aged 38 pays 38p and so on.

But prices have just had to go up. Yet tradition is sacred. So, craftily, the rate of 1p per year of age remains but now there are only 5p and 7p tickets. As a result the 10 year old still pays 10p (= 5p + 5p) and a 38 year old 38p (= 7p + 7p + 7p + 7p + 5p + 5p); but a 3 year old now pays 5p and an 18 year old 19p (= 7p + 7p + 5p).

The Bundle family makes an annual pilgrimage and, having this year 50 members of all different ages from 1 to 50, arrived expecting to pay £12.75.

At least how much extra did the wily curators extract from them by insisting on the new ticket system?

[tantalizer419]

%d bloggers like this:

The [[

`express()`

]] function (as seen inPuzzle #10,Enigma 486) has been incorporated into the latest version of theenigma.pylibrary.This gives a short Python program to solve the puzzle that runs in 95ms.

Run:[ @repl.it ]Solution:The minimum extra charge is 19p.As 5 and 7 are co-prime there is a largest number that cannot be expressed with a combination of tickets. This number is: (5 × 7) – (5 + 7) = 23.

The ages that are overcharged are:

Giving a total extra charge of 19p.