## Brain-Teaser 459

**From The Sunday Times, 8th March 1970** [link]

Grandpa was as pleased as Punch when he heard that his large flock of grandchildren would be there at his birthday party, but he couldn’t remember how many there were. So he wrote to his youngest daughter, who knew he liked problems, and got back the answer:

“There are just enough children to arrange them in pairs in such a way that the square of the age of the first of a pair added to thrice the square of the age of the second give the same total for every pair. The eldest is still a teenager. You remember that I have twins one year old.”

How many grandchildren are there?

[teaser459]

## Jim Randell 9:33 am

on4 March 2019 Permalink |I think the wording of this puzzle could be improved. Saying there are “just enough” children sounds like we are looking for the minimum number of children to satisfy the conditions, given that there are two ages of 1 amongst the children, and one teenager. So we already have three values that must be used in the pairs. The smallest potential set would be two pairs, and this is achievable, giving an answer of 4 children.

But it appears this is not the solution the setter had in mind. Instead it seems we want the largest possible number of children that can be formed into

differentpairs that give the same value for the function. If we were to allow duplicate pairs (i.e. pairs of children with the same ages in the same order), then we could increase the number of children to be as large as we want.Instead this program looks to group the ages of pairs of children into sets that give the same value for the function. We then need a set that has two 1’s and also value between 13 and 19. Then we look for the maximum number of different pairs of children possible, and this is the answer that was published.

This Python program runs in 81ms.

Run:[ @repl.it ]Solution:There are 12 grandchildren.It turns out there is only one possible total that gives a viable set of pairs. The pairs are:

Each giving the value of 364 when the function

f(a, b) = a² + 3b²is applied to them.So there two 1 year olds (the twins) and also two 11 year olds.

If we had four children of ages 1, 1, 11, 19, we would have “just enough” to form them into 2 pairs – (1, 11) and (19, 1) – that give the same value under the function, and there are two 1’s and a teenager involved. So this would be the answer if we take a strict interpretation of the wording.

Similarly, if we allow duplication among the pairs we could have 14 children, or 16, etc.

LikeLike

## Jim Randell 10:07 am

on4 March 2019 Permalink |A variation would be to look for the largest number of children of

differentages (apart from the twins) that can form the pairs.In this case we would have to discard the (11, 9) pair to leave:

So there would be 10 children.

LikeLike