let the ages are 5x, 6x. Then after K years their ages are 7:8

So $\displaystyle\frac{{5x + k}}{{6x + k}} = \frac{7}{8}$

$ \Rightarrow 40x + 8k = 42x + 7k$

$ \Rightarrow$ k = 2x

Here we got an equation which gives multiple answers. For example, If x = 10, then after 20 years their ages are in 7:8 ratio. If x = 6 then after 12 years.

So all even numbers satisfies this.