The problem doesn't say it, but we have to assume that David and Louis both open their bank accounts at the same time, so that the number of months is the same for both of them.
-- David starts with 140 and deposits 150 each month.
After ' M ' months, he has ( 140 + 150 M ) in his account.
-- Louis starts with 260 and deposits 120 each month.
After ' M ' months, he has ( 260 + 120 M ) in his account.
We need to find the number of months ' M ' when both accounts
have the same amount in them.
140 + 150 M = 260 + 120 M
Subtract 140 from each side: 150 M = 120 + 120 M
Subtract 120M from each side: 30 M = 120
Divide each side by 30 : M = 4
Check:
After 4 months . ..
-- David has 140 + 150M = 140 + 150(4) = 140 + 600 = $740
-- Louis has 260 + 120M = 260 + 120(4) = 260 + 480 = $740
-- They're equal. yay !
For any other number of months, more than 4 or less than 4,
they're not equal.