Today James Grime tweeted this question/puzzle:

Is there a six digit number abcdef such that the following all hold?

- a+b+c+d+e+f = y
- ab+cd+ef=10y
- abc+def=100y

If not, show why not.

A little tweeting back and forth verified that “ab” means 10a+b not a×b.

If you want to have a go at this, don’t read any further until you have!

First, rewrite the expressions so that both sides use standard arithmetic:

- a+b+c+d+e+f = y
- 10a+b+10c+d+10e+f=10y
- 100a+10b+c+100d+10e+f=100y

I noticed that since a, b, c, d, e and f are all positive integers, so must y be. Then 10y must end in 0 and 100y must end in 00.

From 3, we see that in 100y only c and f contribute to the units, so c+f=0, or f=-c. See also that only b and e contribute to the 10s, so b+e=, or e=-b.

Since a, b, c, d, e and f are positive digits 0-9, the only values that satisfy these equations are c=f=0 and b=e=0.

From 2, we see that in 10y only b, d and f contribute to the units. Therefore b+d+f=0, or d=b+f. Since b=f=0, we know that d=0.

So solutions to this problem have a being any digit 0-9, b=c=d=e=f=0, and so y=a.

The answer isn’t no, nor is it *quite* yes. These multiples of 100000 are not exactly interesting!

After I emailed Jim I was interested to see this solution, posted at The Wandering Monster, which took a substitution approach. On Twitter Dave Hughes gave his approach: “My solution was inelegant – I threw a C# program at it“. How interesting to see how different people approach a problem!

Update (20 mins after posting!): Please check the comments for a caveat I’ve missed.

It’s not quite enough to say that because only b and c contribute to the units that they must add to (and therefore both be) zero — they could add to 10, with b and e adding to 9. Of course in the end this doesn’t work either…

Ah, yes, of course! Well spotted. (Curse my rusty maths brain!)

Take equation 2 away from eq. 1:

9a + 9c + 9e = 9y, so y = (a+c+e).

Sub that back into eq. 1:

a + b + c + d + e + f = y = a + c + e

So b + d + f = 0, which means all three are zero.

Sub those values into eq. 3:

100a + c + 10e = 100y

For integers between 0 and 9, c and e must both be zero.