I need some help. I do not understand how to get the answer (solution) to this question. I could not solve it, neither did it help when I saw the answer. This is a question from the chapter combinatorics from my textbook. Should be noted that my textbook has not be explaining anything that resembles this kinds of questions. So I am stuck. I would appreciate some insights. Thanks.
The question:
Let $n \in \mathbb{Z^+}$. How many solutions are there to the equation: $$x+y+z=n$$ such that $x,y,z \in \mathbb{N}$?
The answer:
$\frac{1}{2}(n^{2} + 3n + 2)$
How did they arrive at this answer?