## Brain-Teaser 23

**From The Sunday Times, 27th**** August 1961** [link]

A man divided 8s. 4d. among his three sons so that the difference between the shares of the eldest and youngest, expressed in halfpence, was a perfect square. The total of Alan’s and Bob’s shared was an exact multiple of 5½d.; the total of Bob’s and Clive’s shares an exact multiple of 6½d.; and the total of Alan’s and Clive’s shares an exact multiple of 9½d.

What was the name of the second son, and what was his share?

[teaser23]

## Jim Randell 8:55 am

on21 February 2021 Permalink |1s = 12d.

Working in half-pennies (hp) the total amount to distribute is 100 d = 200 hp.

And we are told:

And the difference between two of the numbers is a square number of half pennies.

The following Python program runs in 53ms.

Run:[ @repl.it ]Solution:The middle son was Clive. His share was 45d = (3s 9d).The shares are:

And we see:

And the difference between the eldest and the youngest is:

B−A= 10² hp.LikeLike

## Frits 11:53 am

on21 February 2021 Permalink |LikeLike

## Jim Randell 12:49 pm

on21 February 2021 Permalink |Here’s an alternative solution using the [[

`SubstitutedExpression()`

]] solver:LikeLike

## Hugh Casement 1:51 pm

on21 February 2021 Permalink |Theoretically Alan and Clive could each have received 57 ha’pence and Bob 86.

Zero is also a square number! However, I doubt that is the intended solution.

LikeLike

## Jim Randell 2:02 pm

on21 February 2021 Permalink |@Hugh: Well spotted!

In my programs, both

`0`

and`None`

evaluate to false, so using the return value from [[`is_square()`

]] as a boolean value will reject 0. (It also doesn’t consider 0 to be allowed as a multiple of 11, 13, 19).You can explicitly check [[

`is_square(...) is not None`

]], or just import [[`is_square_p()`

]] instead which returns a boolean.And if you do that you do indeed get two solutions:

The published solution was: “Clive, 3s 9d”.

Perhaps the setter intended the shares to be three

differentvalues.LikeLike

## John Crabtree 6:58 pm

on22 February 2021 Permalink |Working in 1/2d, then A + B + C = 200

A + B = 11p, p ≤ 18

B + C = 13q, q ≤ 15

A + C = 19r, r ≤ 10

Summing the three gives 400 = 11p + 13q + 19r

Using r as a variable as it has the fewest possible values:

B = 200 – 19r, p = 8 + 3r mod 13, q = 3 + 7r mod 11 which leads to

A = 31 + 52r mod 143

C = 112 + 110r mod 143

It is then straightforward to manually generate a table of values for A, B and C for each r. r = 1, 2 and 4 give A+B+C = 343. r = 3 and r = 5 to 10 give A+B+C = 200 and include the two solutions noted by Jim.

LikeLike