## Teaser 2777: Summing up 2015

**From The Sunday Times, 13th December 2015** [link]

I asked Harry and Tom to write down three numbers that between them used nine different digits and which added to 2015. They each succeeded and one of Harry’s three numbers was the same as one of Tom’s. I noticed that Harry’s three numbers included a perfect square and Tom’s included a higher perfect square.

What were those two squares?

[teaser2777]

## Jim Randell 8:44 am

on23 February 2021 Permalink |As stated there are multiple solutions to the puzzle.

Having tackled similar problems before it seems likely that the intention of the setter is:

or possibly:

Any solution for the latter will appear as a solution for the former, so we will use the first one to solve the puzzle (as it turns out it does give a unique answer).

The following Python code generates possible sums that use a square and 2 other numbers to produce the required total, and where each of 9 digits is used exactly once in the summands.

It then choose sums that use different squares, but have one of the other numbers in common.

It runs in 95ms.

Run:[ @repl.it ]Solution:Harry’s square was 324. Tom’s square was 784.There are two ways to arrive at the solution:

Each sum uses all the digits once except for 1.

To see the multiple solutions without the restriction that each of the 9 digits is used exactly once, you can remove line 13 and the [[

`len(ds) == 9`

]] clause from line 22.The same puzzle could have been set in 2019, and had the same answer.

If the puzzle were set in 2022, there would only be one way to arrive at the (different) answer.

LikeLike

## Frits 11:37 pm

on24 February 2021 Permalink |@Jim, I find your answer to the same puzzle on the PuzzlingInPython site easier to read (over here you import 14 functions from enigma.py !).

The PuzzlingInPython version also seems to be a bit more efficient.

LikeLike

## Frits 2:04 pm

on23 February 2021 Permalink |I assumed Harry’s and Tom’s squares were not the number they shared (ABCD).

LikeLike