### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,270)
- misc (3)
- project euler (2)
- puzzle (67)
- site news (50)
- tantalizer (69)
- teaser (7)

### Site Stats

- 206,371 hits

Programming Enigma Puzzles

12 December 2018

Posted by on **From New Scientist #990, 4th March 1976** [link]

The Enigma Quartet all live on different floors of a mammoth block of flats. Amble and the drummer are on adjacent floors. The harpist lives four floors above Bumble. Crumble and the flautist are ten floors apart.

None of the four lives on a floor served by a lift. For, although there are three lifts all serving floor 0, one stops only at every third floor, one only at every fourth and one only at every fifth. Apart from floor 0, no floor has three lifts stopping.

Since no musician will ever walk up stairs. Amble has no way of visiting the trombonists flat without walking down at least four sets of stairs. Which instrument does Dimwit play and which floor does he live on?

[tantalizer439]

%d bloggers like this:

I supposed that “floor 0” indicates the ground floor, and the remaining floors are numbered upwards sequentially from 1.

The lowest common multiple of 3, 4, 5 is 60, so if there was a floor 60, all the lifts would stop there. So there must be fewer that 60 floors.

This Python program chooses floors for Amble, Bumble and Crumble, and possible matching floors for the drummer, flautist, harpist and trombonist. The unmatched floor number must then belong to Dimwit. It runs in 81ms.

Run:[ @repl.it ]Solution:Dimwit plays the harp and lives on floor 26.The full solution is:

Amble can walk down 2 sets of stairs from floor 23 to floor 21, then take the 3-lift down to floor 15, and then walk down 2 more sets of stairs to reach the trombonist on floor 13.

In fact there are no two floors that require Amble to walk down more than 4 sets of stairs, as you can never be more than two floors away from a lift. So, there are only 6 floors below 60 that Amble can live on: 2, 14, 23, 38, 47, 59.