I have the following word problem:
Bob received 21 gifts in total for his birthday. He got video games, CDs, snack bars, and sudoku books. He received 3 times as many CDs as video games, and twice as many sudoku books as snack bars. How many of each gift did he receive?
The problem can easily be solved by testing numbers, but is there any formulaic way to do so?
EDIT: Question mark
You can set up 3 equations from the word problem.
$$V+C+A+U=21\\C=3V\\U=2A$$So we can say $$V+3V+A+2A=21\\4V+3A=21$$
From here, you cannot directly solve this without an additional piece of information, but you can guess and check how many sums of a multiple of 4 and a multiple of 3 equal 21. One such sum is, $12+9$. $$4(3)+3(3)=21\\9+3+3+6=21$$