**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]

### Like this:

Like Loading...

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: