# How to approach

1. Apr 11, 2015

### CWatters

I saw a problem the other day that belongs to a class of problems that I have forgotten how to solve (I'm 55). It went like this..

Trains leave a station every 15mins and every 20 mins. The first two leave together at 9.10am. Do any others leave at the same time and when is the next time?

The simple way to solve it is just to write down the two sequences...

15mins: 9.10 9.25 9.40 9.55 10.10 etc
20mins: 9.10 9.30 9.50 10.10 etc

and note that they match again at 10.10am

Clearly that works for this problem but there must be a better way. I just can't seem to figure out how to do the general case. For example you could assume there is a match at some time ΔT after 9.10 then write...

ΔT = n*15 = m*20

where n and m are unknown integers. But thats one equation with two unknowns.

I half remember that ΔT must be a multiple of |n-m| or something like that but I think that just adds another unknown integer to the mix.

2. Apr 11, 2015

### Staff: Mentor

Are you thinking of Diophantine equations?

In this case, you can break it into prime factors:

3*5*n = 2*2*5*m

3*n = 4*m. Hence n=4 and m=3

Just a guess

3. Apr 11, 2015

### HallsofIvy

The simplest way to deal with this is "least common multiple" of 15 and 20. 15= 3*5 and 20= 4*5 so the least common multiple is 3*4*5= 60 minutes. Two trains leave together 10 minutes after every hour.

4. Apr 12, 2015

### CWatters

Thanks HallsofIvy. That's exactly what I was trying to remember.