Remark
This problem drove 4 of us crazy until one of us made a break through.
Assumptions.
He must eat either 1 pizza a day or 1 sandwich a day. He can't eat 2 of anything during 1 day. So he can't eat 2 pizzas in a day or 2 sandwiches in a day.
Step One
Find the number of days in a cycle.
3 out of 4 days means out of 4 days he chooses Pizza
2 out of 3 days means out of 3 days he chooses a Sandwich.
That means that there are 4 + 3 days in total = 7 days in the cycle.
Step Two
Find the number of Pizzas and the number of Sandwiches he had during the 42 day period.
3/7 * 42 = Pizzas
3*6 = 18 pizzas in 42 days.
4/7* 42 = Sandwiches
4*6 = 24 sandwiches.
In 42 days he ate 24 + 18 = 42 lunches of either pizzas or sandwiches.
Step three This is the key step.
Find the ratio of sandwiches and pizzas for x days.
Every 5 days he either has 3 pizzas or 2 sandwiches. If the total number of days is x then
3/5 * x = Pizzas
2/5 * x = Sandwiches.
Step 4
Equate the results.
Pizzas = sandwiches.
18 + 3/5 x = 24 + 2/5 x Multiply by 5
18*5 + (3/5)*x * 5 = 24 * 5 + (2/5)*x*5
90 + 3x = 120 + 2x Subtract 2x from both sides
90 + 3x - 2x = 120
90 + x = 120 Subtract 90 from both sides.
x = 120 - 90
x = 30 days.
Conclusion
It takes 30 days to even up the number of pizzas with the number of sandwiches.