# Five positive integers in a row, each being the sum of the digit sum of its neighbours

Five positive integers should be put in a row such that each integer is the sum of the digit sum of its neighbours.

The integers at the beginning and at the end have only one neighbour, i.e the first integer is the digit sum of the second integer, the fifth integer is the digit sum of the fourth integer.

What is the smallest sum of those five integers?

Smallest sum is

45

Solutions are

1 10 9 17 8
2 11 9 16 7
3 12 9 15 6
...
8 17 9 10 1

Reasoning

Let a b c d e be a solution. Then (writing [] for digit sum) c = a + e = [b] + [d]. Also, b = 2[b] + [d] and d = [b] + 2[d]. Therefore b and d must be multidigit. The smallest possible way is b = 10 + B and d = 10 + D where B = a - 1 and D = e - 1 are single digit. From this it follows that c = a + e = 9.

• There's a hole in your logic; those aren't all the solutions. It misses the solution of "9 18 18 18 9". Jul 19 at 21:46
• @ralphmerridew 9 18 18 18 9 is not a minimal solution. It sums to 72. Jul 19 at 23:04

This should be optimal.

1 10 9 17 8

2 11 9 16 7

3 12 9 15 6

4 13 9 14 5

In each case, the sum is 45.