Let's call the two numbers x and y. We can write a system of equations to describe the situation:
5x = 8y
x - y = 150
Let's solve the first equation for x:
x = 8y/5
Now we can use substitution to solve the system by plugging 8y/5 in for x in the second equation:
(8y/5) - y = 150
Simplify:
3y/5 = 150
3y = 750
y = 250
If y = 250, then x is:
x = 8(250)/5 = 400
The answer is 250 and 400.