I was taught in high school algebra to translate word problems into algebraic expressions. So when I encountered this problem I tried to reason out an algebra formula for it
For every dollar Ben spent on bagels, David spent 25 cents less. Ben paid $12.50 more than David. How much did they spend in the bagel store together?
To solve this I imagined a series of comparisons when Ben spends $x$, David spends $.75x$. Loop this relationship until $x - .75x \approx 12.50$. Good. Done. $x = 50$, then add David's for the answer. Coming from computers, I would have set this up in code where a loop (recursion) would increase $x$ until the condition $x - .75x = 12.50$ was met, then the "loop counter/accumulator" would be how much Ben spent, i.e., $50$, etc.
I'm a beginner with math, but it seems like there should be a better approach, something with series and sequences or even calculus derivatives, something better than my brute-force computer algorithm. Can someone enlighten? The "answer" given at the site (see link) is its own brute-force and hardly satisfying. I'm thinking there should be something more formal -- at least for the first part that derives $50$.
Update
I think everyone so far has missed my point. Many of you simply re-did the problem again. I'm wondering if there is a more formal way to do this other than just "figuring it out" (FIO). The whole FIO routine is murky. It looks like a limit problem; it looks like a system of equations, but I'm not experienced enough to know exactly. If there isn't, then let's call it a day....
From the step $x-.75x=12.50$ simplify to $.25x=12.5$, divide by .25 to immediately get $x=50$. No looping/brute force needed.