Combinatorics of the sum of two dice In my probability book I learned how to solve this kind of problem: how many vectors of the form $(i_1,i_2,...,i_r)$ exist that the sum of its components is $n$ and $i_k>0$ for all $k$? The answer uses the stars and bars argument and is $n-1\choose r-1$.
OK, now I have this really simple problem: imagine you'll roll $2$ six-faced dice, how many ways there are in which the sum of them is $n$? 
First I thought to use the before mentioned method, considering a result as a vector of the form $(i_1,i_2)$ but I realized that I have a new restriction, $i_1,i_2 \leq 6$! I thought about it and I don't know how to compute it without considering case by case ($n=2,n=3,...,n=12$), I've done it with the six-faced die, since there's only $11$ cases and found a nice 'triangular pattern', but what if the dice had each $20$ faces? Is there a more smart way to calculate it?

Hint:
This might help. 
$$\begin{array}{|l|l|l|l|l|l|l|}
\hline
  & \color{red}1 & \color{red}2 & \color{red}3 & \color{red}4  & \color{red}5  & \color{red}6  \\ \hline
\color{red}1 & 2 & 3 & 4 & 5  & 6  & 7  \\ \hline
\color{red}2 & 3 & 4 & 5 & 6  & 7  & 8  \\ \hline
\color{red}3 & 4 & 5 & 6 & 7  & 8  & 9  \\ \hline
\color{red}4 & 5 & 6 & 7 & 8  & 9  & 10 \\ \hline
\color{red}5 & 6 & 7 & 8 & 9  & 10 & 11 \\ \hline
\color{red}6 & 7 & 8 & 9 & 10 & 11 & 12 \\ \hline
\end{array}$$

Let $n$ be your sum, then notice that


*

*if $n\leq 6$, then there are $n-1$ ways to make a sum equal to $n$.

*if $n\geq 7$, then there are $13-n$ ways to make a sum equal to $n$.


We can jusify this as follows. Say you want to pick two numbers $a,b$ so that $$a+b=n$$ We can only focus on $a$, since for a fixed $a$ we know that $b=n-a$. The smallest value for $a$ is $1$, and the largest value for $a$ is therefore $n-1\geq n-a$. Thus there are $n-1$ ways to choose $a$ (and we have no choice for $b$).
We get the other case by symmetry: $12-(n-1)$.
