2. Several people need to dig a canal. If they start working simultaneously, then they will dig the canal in 24 hours. However, they come to work one after another at equal time intervals, and then each works until the completion of the work. How long did the first worker work if he worked 5 times longer than the last worker to arrive?
Solution. Let's denote the total number of workers by $z$, the number of hours the last worker worked by $x$, and the number of hours in the time interval between the arrival of two workers who came to work one after the other by $y$. Then the total number of work hours spent digging the canal is $x+(x+y)+(x+2 y)+\ldots+(x+(z-1) y)$, which, according to the problem, is equal to $24 z$, i.e.,

$$
x+(x+y)+(x+2 y)+\ldots+(x+(z-1) y)=24 z
$$

Considering that the sum of the first $z-1$ natural numbers is $\frac{(z-1) z}{2}$, we get $x z+\frac{y z(z-1)}{2}=24 z$, i.e.,

$$
2 x+y(z-1)=48
$$

Knowing that the first worker worked five times longer than the last worker, the following equality must also hold:

$$
x+y(z-1)=5 x
$$

From (1) and (2), we get $6 x=48$, i.e., $x=8$.

Accordingly, the first worker worked 40 hours.