TITLE: Looking for Distinct solutions to $x_1+x_2+x_3=100$ such that at least one of them should be greater than 40
QUESTION [5 upvotes]: For this problem suppose that the $x_i$'s must be non-negative integers, i.e., $x_i∈{0,1,2,⋯}$ for $i=1,2,3$. How many distinct solutions does the following equation have such that at least one of the $x_i$'s is larger than 40?
$$x_1+x_2+x_3=100$$
I tried using different methods but I think I got closest with advanced PIE:
I thought to do it with complement, such that $20\le x_i \le 40$, because if any of them are less 20 one must be greater than 40.
have in the back of your mind that without restrictions there are ${102\choose 2}$ solutions.
firstly i  took those $20$s and gave to all $x_i$s and got $$x_1+x_2+x_3=40$$ such that  $0\le x_i \le20$ and after that did PIE method which gave me $231$ solutions. Lastly, I did what it was asking for $${102\choose 2}-231$$ I think thins answer is too big to be true, so please help me

REPLY [4 votes]: If we denote $x_1=x,\,x_2=y,\,x_3=100-x-y$ then looking at the inequalities plot we realize that all the values fits except for the shaded region
$$\begin{cases}
x\le 40\\ y\le 40\\ x+y\ge 60
\end{cases}$$

Which occupies $\frac{21^2+21}{2}=231$ of total $\frac{101^2+101}{2}=5151$ of $(x,y)$ values,
thus the answer is $5151-231=4920$.