.
Let "w" be the number of white widgets.
Then from the condition, you have this equation
=
.
It gives
pw = 12 + 20 + w, or
(p-1)*w = 12 + 20 = 32.
So, "p-1" is one of the divisors of the integer number 32.
The possible divisors are p-1 = 1, 2, 4, 8, 16 and/or 32 (all degrees of 2, from 0 to 5).
So, there are 6 possible integer values for p, 2, 3, 5, 9, 17 and 33. ANSWER
Solved.