4. Josef was returning from a trip. First, he traveled by train and then continued from the station by bike. The entire journey took exactly 1 hour 30 minutes and he covered a distance of $60 \mathrm{~km}$. The train traveled at an average speed of $50 \mathrm{~km} / \mathrm{h}$. Determine how long Josef rode his bike, given that his speed $v \mathrm{~km} / \mathrm{h}$ is expressed as a natural number, as is the distance measured in $v \mathrm{~km}$ that he covered by bike.
SOLUTION. Let $v$ be the distance in kilometers that Josef cycled, and $r$ be his speed in $\mathrm{km} / \mathrm{h}$. According to the problem, $r$ and $v$ are natural numbers and $v<60$. Josef cycled for $v / r \mathrm{~h}$. He traveled the distance $(60-v) \mathrm{km}$ by train, which took $(60-v) / 50 \mathrm{~h}$. Therefore, according to the problem, we have

$$
\frac{60-v}{50}+\frac{v}{r}=\frac{3}{2} .
$$

This equation is equivalent to

$$
50 v-15 r-r v=0,
$$

which we can further rearrange to

$$
(50-r)(v+15)=15 \cdot 50=2 \cdot 3 \cdot 5^{3} .
$$

From this, it follows that $50-r$ is a natural number less than 50 and $v+15$ is a natural number greater than 15 and does not exceed 75, and additionally, the product $(50-r)(v+15)$ is divisible by $5^{3}$. Four cases can arise.

- $5^{3} \mid 50-r$. This is not possible because $1 \leqq 50-r<50$.
- $5^{2} \mid 50-r$ and $5 \mid v+15$. The number $50-r$ is therefore 25, from which $r=25$ and $v=15$.
- $5 \mid 50-r$ and $5^{2} \mid v+15$. The number $v+15$ is thus an element of the set $\{25,50\}$, from which we calculate the other two possibilities $r=20, v=10$ and $r=35, v=35$.
- $5^{3} \mid v+15$. This is not possible because $15<v+15<75$.

The possible times Josef spent cycling (in minutes) are therefore $15 \cdot 60 / 25=36$, $10 \cdot 60 / 20=30$ and $35 \cdot 60 / 35=60$.

By listing all the possibilities, we have found that if Josef traveled according to the problem, he cycled for either 30, 36, or 60 minutes.