### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,393)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (61)
- site news (62)
- tantalizer (105)
- teaser (7)
- today (1)

### Site Stats

- 244,212 hits

Programming Enigma Puzzles

9 August 2019

Posted by on **From New Scientist #2153, 26th September 1998** [link]

The denominations of coins in circulation which are less than a pound are 50, 20, 10, 5, 2 and 1p.

Harry, Tom and I went into a shop recently and each made a purchase costing less than £1 (100p). The cost of each of these purchases was different. We each paid with a £1 coin and each received four coins in change — in each case the change due could not be given in fewer than four coins; but equally if we had paid the exact price for our purchases it would have been possible for each of us to have done so with four coins, but not with fewer.

The total cost of our three purchases was not only more than, but also an exact multiple of, the total amount of change than between us we received.

What did each of our purchases cost?

[enigma998]

%d bloggers like this:

This Python program finds the amounts that are expressible using exactly 4 coins but no fewer, and then finds three of these amounts that satisfy the remaining conditions.

It runs in 94ms.

Run:[ @repl.it ]Solution:The purchases cost 37p, 81p, 82p.