The number of buckets is directly proportional to the area and the thickness of the wall and inversely proportional to the amount of paint. Mathematically, we can write:
n = k · (a · t) / p
where k is the proportionality constant which we do not know.
We can calculate k with the given data: 5 2-gallon buckets, area of 100 square feet and thickness 3 inches: