The teacher wrote the following numbers on the board:

$$
1,4,7,10,13,16,19,22,25,28,31,34,37,40,43
$$

Any two adjacent numbers differ by the same value, in this case, 3. Then she erased all the numbers from the board except for 1, 19, and 43. She further added several integers between these three numbers such that any two adjacent numbers again differed by the same value, and no number was written more than once.

In how many ways could the teacher have completed the numbers?

(K. Pazourek)

Hint. Could 5 be among the added numbers?
One way to fill in the numbers is, of course, the one the teacher erased (in this case, the difference between consecutive numbers is 3). Another possible, and probably the simplest, way is to fill in all natural numbers from 1 to 43 (in this case, the difference is 1).

Each filling according to the task is completely determined by the difference between consecutive numbers, which we denote as $d$. Therefore, all possible fillings can be determined by considering all possible differences $d$ and checking whether the corresponding sequence (starting with 1) contains the numbers 19 and 43.

However, for a number 19 to be included in such a sequence, the difference $19-1=18$ must be some multiple of the determining constant $d$. Similarly, for the number 43 to be included in such a sequence, the difference $43-19=24$ must be some multiple of the number $d$. In other words, $d$ must be a common divisor of the numbers 18 and 24. Therefore, all possible fillings correspond to all common divisors of the numbers 18 and 24, which are precisely the numbers $1, 2, 3$, and 6. The teacher could have filled in the numbers on the board in four ways.

Note. The previous considerations can be appropriately supported by a visual representation on a number line; here, the division $s$ by the largest possible difference $d=6$ is highlighted:

![](https://cdn.mathpix.com/cropped/2024_04_17_47cbfa10f45526792f91g-5.jpg?height=63&width=786&top_left_y=1345&top_left_x=635)