Let T=Tom’s age and rT be John’s age where r is the ratio of the brothers’ ages.
18 years ago their ages were T-18 and rT-18, also:
13(T-18)=8(rT-18), 13T-234=8rT-144, 13T-8rT=90, T=90/(13-8r).
We know that r=5/7 or 7/5, so T (a whole number)=90/(13-8(5/7)) or 90/(13-8(7/5)), that is, 210/17 or 50. So Tom is 50 years old, r=7/5 (making John 70 years old). Also, 210/17=12 approx, so 18 years ago Tom wasn’t even born!