I have to create the function arrangement in C++ : the number of admissible p-lists in n objects.
$$ar(n,p)=\begin{pmatrix}n\\ p\end{pmatrix}\times p!=n\times...\times(n-p+1)$$
But I prefer this formula : $$\frac{n!}{(n-p)!}$$
the function is int** arrangement(int m) constructing the array of arrangement values for $n=0,1,...,m$ and $0\le p\le n$. For instance arrangement(4) should give :
1
1 1
1 2 2
1 3 6 6
1 4 12 24 24
I don't understand the second line. It should be $\{\begin{pmatrix}4\\ 0\end{pmatrix}\times0!=1,\begin{pmatrix}4\\ 1\end{pmatrix}\times1!=4\}$ and so on , isn't it ?