## Brainteaser 1766: House squares

**From The Sunday Times, 21st July 1996** [link]

There is an even number of houses in my road, numbered consecutively from 1 upwards, with the odd numbers on one side and the even numbers on the other.

My neighbour’s son was practising with his new calculator. He found the sum of the squares of all the house numbers on one side of the road and subtracted it from the sum of the squares of all the house numbers on the other side of the road. The digits in his answer were all the same.

Noticing that two of the houses displayed “For Sale” signs he decided to carry out a second calculation omitting those two houses. This gave an answer 50% higher than the first.

Which two houses are for sale?

This puzzle was included in the book *Brainteasers* (2002, edited by Victor Bryant). The puzzle text above is taken from the book.

[teaser1766]

## Jim Randell 8:12 am

on24 November 2019 Permalink |This Python program runs in 70ms.

Run:[ @repl.it ]Solution:The two houses for sale are 14 and 23.There are 36 houses in the street.

The result of the first calculation is 666.

The result of the second calculation is 999.

The difference between the sums of the squares of the first

neven numbers and the firstnodd numbers can be expressed:Which allows a slightly shorter program than generating the differences constructively.

LikeLike