Daniel B. answered 09/19/22
A retired computer professional to teach math, physics
Lemma:
Assume a given equation for some integers a and n
x + y = n (1)
with the constraints
a ≤ x (2)
a ≤ y (3)
Claim 1: If n < 2a then there are no solutions.
Claim 2: If n ≥ 2a then there are n - 2a + 1 integer solutions.
Proof:
Claim 1 follows from 2a ≤ x + y,
which is the result of adding the inequalities (2) and (3).
To prove Claim 2 note that we get a single solution for any choice of y in the range
a ≤ y ≤ n - a
And there are n - 2a + 1 integers in the range a ≤ y ≤ n - a.
QED
Now consider the given equation
x + y + z = 8 (4)
with the constraints
-5 ≤ x (5)
-5 ≤ y (6)
-5 ≤ z (7)
Any solution satisfies
z = 8 - (x + y) (8)
and
-10 ≤ x + y (9)
(the latter being the result of adding inequalities (5) and (6)).
Combination of (7), (8), and (9) yields
-5 ≤ z ≤ 18 (10)
There are 24 integers z satisfying (10) and for each we can rewrite (4) into
x + y = 8 - z
This is an equation satisfying the prerequisites of the Lemma with a = -5 and n = 8 - z.
By the Lemma, each choice of z gives 8 - z - 2×(-5) + 1 = 19 - z solutions.
The minimal number of solutions is 1, which happens for z = 18,
and the maximal number of solutions is 24, which happens for z = -5.
Using the formula for the sum of arithmetic sequence, the total number of solutions is
1 + 2 + ... + 24 = (1 + 24)×24/2 = 300