In how many ways can I choose 5 integers with a minimum difference between any of them? In how many ways can I choose 5 positive integers lesser or equal to 18, in order that every difference between two of them is bigger or equal to 2?
So, for example, one way can be 18, 16, 11, 8, 2 (because 18 - 16 = 2, 18 - 11 = 7, ... 8 - 2 = 6).
Can someone give some hints to solve it?
 A: Once you have your five integers, $18-5=13$ of the integers in the set $\{1,\ldots,18\}$ remain, and there has to be at least one of these integers between every two of the five that you picked. If your integers are $a_1,a_2,a_3,a_4$, and $a_5$ in increasing order, you must have at least one integer in each of the four gaps between $a_1$ and $a_2$, between $a_2$ and $a_3$, between $a_3$ and $a_4$, and between $a_4$ and $a_5$. You may have integers before $a_1$ or after $a_5$, but you don’t have to.
Once we put one of those $13$ extra integers into each of the four gaps between consecutive chosen integers, we’re left with $13-4=9$ unused integers that can be distributed amongst the six gaps before, between, and after the chosen integers. Finding the number of ways to do this is a standard stars-and-bars problem; the answer is that there are
$$\binom{9+6-1}{6-1}=\binom{14}5=2002$$
different ways to do this. (The reasoning behind the formula is explained reasonably well in the linked article.) Each of these corresponds to one of the possible sets of five integers, so there are $2002$ such sets.
To make it clearer (I hope), here’s an example. If we put $2$ of the $9$ extra integers before $a_1$, none between $a_1$ and $a_2$, $3$ between $a_2$ and $a_3$, one between $a_3$ and $a_4$, $2$ between $a_4$ and $a_5$, and the last one after $a_5$, we end up with


*

*$2$ integers before $a_1$;  

*$1$ integer between $a_1$ and $a_2$ (because we put one in that gap before we started distributing the $9$ extras);  

*$4$ integers between $a_2$ and $a_3$;  

*$2$ integers between $a_3$ and $a_4$;  

*$3$ integers between $a_4$ and $a_5$; and  

*$1$ integer after $a_5$.


That means that $a_1$ must be $3$, $a_2$ must be $a+2=5$, $a_3$ must be $a_2+5=10$, $a_4=a_3+3=13$, and $a_5=a_4+4=17$. In the displayed line below, the red numbers are the five that we chose, the blue numbers are the four that we placed between them to ensure that no two ended up adjacent, and the black numbers are the $9$ extras.
$$1,2,\color{red}3,\color{blue}4,\color{red}5,\color{blue}6,7,8,9.\color{red}{10},\color{blue}{11},12,\color{red}{13},\color{blue}{14},15,16,\color{red}{17},18$$
Notice that the $9$ extras are distributed exactly as described: $2$ before $a_1$, none between $a_1$ and $a_2$, and so on. 
A: There are $14\choose5$ ways to arrange $9$ C's and $5$ D's in a row (e.g, CCDCDDCCCDCDCC).  Now imagine a numbered row of $19$ squares, covered by $9$ coins and $5$ dominoes (where a coin covers a single square and a domino covers two consecutive squares).  For each such arrangement, take the smaller of the two numbers from each of the $5$ dominoes.  That gives you what you want.
Remark:  This approach easily generalizes to other cases.  For example, if you want the $5$ numbers to differ by at least $3$, all you have to do is cover a row of $18+3-1=20$ numbered squares with $5$ trominoes and $20-5\cdot3=5$ coins, which can be done in $5+5\choose5$ different ways.  The bijection again comes from using the smallest number beneath each tromino (which can be at most $18$).
A: As noticed by Kaligule$^{(*)}$, this question is equivalent to counting in how many ways we may write $21$ as a sum of six integers $\geq 2$, so it is given by the coefficient of $x^{21}$ in
$$ \left(x^2+x^3+x^4+x^5+\ldots\right)^{6} = \frac{x^{12}}{(1-x)^6} $$
that is the coefficient of $x^9$ in $\frac{1}{(1-x)^6}$. By stars and bars, the answer is $\binom{14}{5}=\color{red}{2002}$.
$(*)$ If we take $a_0=-1$, $a_6=20$ and define $b_i=a_i-a_{i-1}$, our choice of $a_1,a_2,a_3,a_4,a_5 \in [1,18]$ is associated in bijective way with a choice of $b_1,\ldots,b_6$ fulfilling the constraints $b_i\geq 2$ and $b_1+\ldots+b_6=a_6-a_0=21$.
