### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,818 hits

Advertisements

Programming Enigma Puzzles

4 December 2013

Posted by on **From New Scientist #2946, 7th December 2013** [link]

Fewer than 100 houses have been built on the edge of a circular green, equally-spaced around the whole perimeter and numbered 1, 2, … in order. I have counted the number of pairs of houses with their first and second digits exchanged that are either 90 degrees or 180 degrees apart around the circle. The numerical difference between the counts for 90 degrees and for 180 degrees apart is the same as the higher digit of the lowest-numbered house involved.

How many houses are there in all?

[enigma1778]

Advertisements

%d bloggers like this:

There are multiple solutions if we allow leading zeros, so this Python code assumes they are not allowed (although you can set a flag in this code to allow them if you like). It runs in 37ms.

Solution:There are 72 houses in all.Here’s a diagram showing the pairs of houses that subtend 90° and 180° at the centre of the circle.

My variation: