Problem 2. Bojan, Mirko, and Zdravko had a bag with marbles. Bojan added to the bag as many marbles as there were in the bag and one more marble. Then, Mirko added to the bag twice as many marbles as there were in the bag at that moment plus three marbles. Finally, Zdravko added three times as many marbles as there were in the bag at that moment plus five marbles. In the end, there were 149 marbles in the bag. How many marbles were in the bag at the beginning?
Solution. Let there be $x$ candies in the bag at the beginning. When Bojan added candies to the bag, there were

$$
x+x+1=2 x+1
$$

candies in it. When Mirko added the candies, there were

$$
2 x+1+4 x+2+3=6 x+6
$$

candies in the bag. Finally, when Zdravko added the candies to the bag, there were

$$
6 x+6+18 x+18+5=24 x+29
$$

candies. Now it is enough to solve the equation

$$
24 x+29=149
$$

Its solution is $x=5$.

At the beginning, there were 5 candies in the bag.