Last week, Fred had a total of 334 yellow and red pens. Two weeks later, he sold 2/3 of all the yellow pens and 82 red pens. Now he has the same number of yellow and red pens. How many pens does he have in the end?

y = yellow pens

r = red pens

Last week, Fred had a total of 334 yellow and red pens means:

y + r = 334

When he sold 2 / 3 of all the yellow pens rest of yellow pens is y / 3

When he sold 82 of all the red pens rest of the red pens is r - 82

Now he has the same number of yellow and red pens means:

y / 3 = r - 82

Now you must solve system of two equations:

y + r = 334

y / 3 = r - 82
__________

Try to solve that.

The solutions is:

y = 189 , r = 145

In the end he have y / 3 + r - 82 = 189 / 3 + 145 - 82 = 123 pens