Petra filled in the circles with the numbers $1,2,3,4,5,6,7,8$ such that each was used exactly once and the sum of the numbers on each side of the triangle was the same.

What is the largest sum she could have obtained this way? Provide an example of a possible filling.

(A. Bohiniková)

![](https://cdn.mathpix.com/cropped/2024_04_17_f3fae1a08c67cff3918eg-4.jpg?height=440&width=445&top_left_y=588&top_left_x=811)

Hint. Where should Petra write the largest numbers?
Numbers at the vertices of the triangle contribute to the sums on two sides, while other numbers contribute only to one. Larger numbers at the vertices of the triangle will therefore result in larger sums.

We will place the three largest numbers at the vertices of the triangle and try to fill in the remaining numbers. The initial placement can be done in six ways, but only the number at the main (highest) vertex is essential—possible completions for swapped numbers in the remaining vertices are symmetric in pairs. We will examine all possibilities step by step.

- At the main vertex: 6

![](https://cdn.mathpix.com/cropped/2024_04_17_f3fae1a08c67cff3918eg-4.jpg?height=446&width=446&top_left_y=1850&top_left_x=811)

The sum of the numbers inscribed on the base of the triangle is 15, on the left side 13, and on the right side 14. We need to place the numbers 1, 2, 3, 4, 5 to compensate for the differences between the current sums on each side. This can be done, for example, as follows:

![](https://cdn.mathpix.com/cropped/2024_04_17_f3fae1a08c67cff3918eg-5.jpg?height=446&width=456&top_left_y=191&top_left_x=800)

The sum of the numbers on each side is 19.

- At the main vertex: 7: By similar reasoning as in the previous case, we get the following solution:

![](https://cdn.mathpix.com/cropped/2024_04_17_f3fae1a08c67cff3918eg-5.jpg?height=446&width=445&top_left_y=1002&top_left_x=811)

The sum of the numbers on each side is 19.

- At the main vertex: 8:

![](https://cdn.mathpix.com/cropped/2024_04_17_f3fae1a08c67cff3918eg-5.jpg?height=446&width=445&top_left_y=1756&top_left_x=811)

The sum of the numbers inscribed on the base of the triangle is 13, on the left side 14, and on the right side 15. The missing number on the base should therefore be 1 greater than the sum of the missing numbers on the left side and 2 greater than the sum of the numbers on the right side. The second requirement can be met by the following completion, which is unique up to the order of the new pair of numbers on the right side:

![](https://cdn.mathpix.com/cropped/2024_04_17_f3fae1a08c67cff3918eg-6.jpg?height=440&width=454&top_left_y=197&top_left_x=798)

Thus, the pair 3 and 4 remains for the left side, which does not meet the first requirement. Therefore, 8 cannot be at the main vertex.

The largest possible sum that can be obtained in the required way is 19. Two examples of possible fillings are given above.

Note. The sum of the given numbers is \(1+2+3+4+5+6+7+8=36\). When placing the numbers 6, 7, 8 at the vertices of the triangle, the sum of the sums of the numbers on its sides is \(36+6+7+8=57\). The sum of the numbers on each side should therefore be \(57 \div 3 = 19\). This observation allows us to quickly fill in the missing number on the base of the triangle:

- For 6 at the main vertex, it comes out to \(19-7-8=4\),
- For 7 at the main vertex, it comes out to \(19-6-8=5\),
- For 8 at the main vertex, it comes out to \(19-6-7=6\).

In the first two cases, the remaining numbers can be easily filled in the empty spaces. In the third case, the completion is not possible, as 6 would be used twice.