If B=number of brown balls, then W, the number of white balls=2B/3+7. So the equation is W=2B/3+7.
If only white and brown balls are in the mixture then B+2B/3+7=45, so 5B/3=45-7=38, B=3*38/5=22.8, and W=22.2.
There cannot be a fractional number of balls so, either there are other balls in the mix, or 2/3 is an approximation. [An additional equation (inequality) would be 5B/3≤38 or 5B≤114 or B<22 (since W must also be a whole number).]
If we assume there are other balls in the mix then the number of these balls would be 3, 8, 13, 18, etc., because these numbers would reduce the number of brown and white balls to a number divisible by 5 (38-3=35, 38-8=30, etc.):
Other Brown White
3. 21. 21.
8. 18. 19.
13. 15. 17.
18. 12. 15.
23. 9. 13.
28. 6. 11.
33. 3. 9.
As other balls increase by 5, brown balls decrease by 3 and white balls by 2.
If there are no other colours of balls, 2/3 is an approximation and there would be 23 brown and 22 white.