4. (7 points) Given a string of four numbers $a, b, c, d$, we will perform the following operation: between every two adjacent numbers, we will insert a number that is the result of subtracting the left number from the right number. We will perform the same operation on the new string and so on. Find the sum of the numbers in the string that results after $m$ such operations.
Solution: Let's see how the sum of a row changes after the next operation. Let $a_{1}, a_{2}, \ldots, a_{n}$ be the row to which the operation is applied. Then the new row has the form $a_{1}, a_{2}-a_{1}, a_{2}, a_{3}-a_{2}, \ldots, a_{n-1}, a_{n}-a_{n-1}, a_{n}$. The sum of the numbers in the new row is

$$
\begin{gathered}
S_{m}=a_{1}+\left(a_{2}-a_{1}\right)+a_{2}+\left(a_{3}-a_{2}\right)+\ldots+a_{n-1}+\left(a_{n}-a_{n-1}\right)+a_{n}= \\
=\left(a_{1}+a_{2}+\ldots+a_{n}\right)+\left(a_{n}-a_{1}\right)=S_{m-1}+\left(a_{n}-a_{1}\right)
\end{gathered}
$$

Notice now that for any row obtained from the row $a, b, c, d$ using several operations, it holds that $a_{n}=d$ and $a_{1}=a$. In the end, we get

$$
S_{m}=S_{m-1}+(d-a)=\ldots=S_{0}+m \cdot(d-a)=a+b+c+d+m \cdot(d-a)
$$

Answers:

| Variant | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Answer | 7150 | 4110 | 2480 | 7288 | 5560 | 6144 | 4380 | 5732 | 8042 | 7454 |