In the "Update" (the day after the Question itself was posted), the OP mentions a recursion for counting the partitions of $n$ into $k$ distinct parts, each part at most $M$:
$$ p_k(\leq M, \mathcal{D},n) =
p_{k-1}(\leq M-1, \mathcal{D},n-k) +
p_k(\leq M-1, \mathcal{D},n-k) $$
and asks "How can I prove this?".
To see this, separate the required partitions on the basis of whether $1$ appears as a summand. If it does, then subtracting $1$ from each summand produces a partition of $n-k$ with exactly $k-1$ distinct parts (since the original summand $1$ disappears), each part at most $M-1$. These partitions are counted by the first term on the right-hand side of the recursion. Otherwise the summand $1$ does not appear, and subtracting $1$ from each part resulting in a partition of $n-k$ with exactly $k$ distinct parts, each part at most $M-1$. These cases are counted by the second term.
Note that a partition of $n$ with $k$ distinct parts exists if and only if $n \ge \binom{k+1}{2}$, because the ascending summands $m_1 + \ldots + m_k = n$ must satisfy $m_i \ge i$. If $n = \binom{k+1}{2}$, then there is just one such partition with $k$ distinct parts, the largest of which is $k$. Repeated application of the recursion will culminate with terms which we can evaluate "by inspection" as either zero or one.
By itself this recursion doesn't seem to give us an especially attractive way of evaluating $p_k(\leq M, \mathcal{D},n)$. Like the recursion for Fibonacci numbers, as a top-down method it suffers from recalculating terms multiple times (giving exponential complexity), so we would be better off working with it as a bottom-up method (giving polynomial complexity).
Better for large parameters is to close the circle with the ideas presented by @NikosM. by showing how the evaluation of $p_k(\leq M, \mathcal{D},n)$ can be reduced to counting restricted partitions without requiring distinct summands.
Prop. Suppose that $n \gt \binom{k+1}{2}$. Then the following are equal:
$(i)$ the number of partitions of $n$ into exactly $k$ distinct parts, each part at most $M$, i.e. $p_k(\leq M, \mathcal{D},n)$
$(ii)$ the number of partitions of $n - \binom{k}{2}$ into exactly $k$ parts, each part at most $M$
$(iii)$ the number of partitions of $n - \binom{k+1}{2}$ into at most $k$ parts, each part at most $M$
Sketch of proof: Once we know the ordered summands of partitions in $(i)$ satisfy $m_i \ge i$, it is easy to visualize their equivalents in $(ii)$ and $(iii)$ by Young tableaux, also called Ferrers diagrams. We remove a "base triangle" of dots corresponding to the first $i$ dots in the $i$th summand (since $m_i \ge i$) to get case $(iii)$, and remove one fewer dot in each summand to preserve exactly $k$ summands in case $(ii)$. These constructions are reversible, and the counts are equal.
Remark 1 If $n \le \binom{k+1}{2}$, $p_k(\leq M, \mathcal{D},n)=1$ if $n=\binom{k+1}{2}$ and $k \le M$ and otherwise $p_k(\leq M, \mathcal{D},n)=0$.
Remark 2 For fixed $k,n$, suppose $M_0 = n - \binom{k}{2} \gt 0$. Then for all $M \ge M_0$, $p_k(\leq M, \mathcal{D},n) = p_k(\leq M_0, \mathcal{D},n)$. That is, further increasing the upper bound $M$ on the size of parts will not yield additional partitions of $n$ with exactly $k$ distinct parts.
Recommended Reading
Andrews, George E. The Theory of Partitions (Cambridge University Press, 1998)
A modern classic for theory of integer partitions, reviewed by Richard Askey in BAMS.
$p(n,k)$ is the number of ways to partition $n$ into $k$ parts. It is the same as the number of different ways of placing $n$ objects into $k$ pots. Firstly put $1$ object in each pot. Total $k$ objects have been put and now we have to put remaining $n-k$ objects into $k$ pots.
Hence,
$$ p(n,k)=p(n-k,1)+p(n-k,2)+\cdots+p(n-k,k-1)+p(n-k,k)$$
Also observe that,
$$ p(n-1,k-1)=p(n-k,1)+p(n-k,2)+\cdots+p(n-k,k-1)$$
From the above two equations, we conclude:
$$p(n,k)=p(n-1,k-1)+p(n-k,k)$$
Best Answer
Note that
$$x^k\prod_{i=1}^k\frac1{1-x^i}=\left(\prod_{i=1}^{k-1}\frac1{1-x^i}\right)\cdot\frac{x^k}{1-x^k}\tag{1}$$
is the product of the following series:
$$\begin{align*} &1+x+x^2+x^3+x^4+\ldots+x^n+\ldots\\ &1+x^2+x^4+x^6+x^8+\ldots+x^{2n}+\ldots\\ &1+x^3+x^6+x^9+x^{12}+\ldots+x^{3n}+\ldots\\ &1+x^4+x^8+x^{12}+x^{16}+\ldots+x^{4n}+\ldots\\ &\qquad\qquad\qquad\vdots\\ &1+x^{k-1}+x^{2(k-1)}+x^{3(k-1)}+x^{4(k-1)}+\ldots+x^{(k-1)n}+\ldots\\ &x^k+x^{2k}+x^{3k}+x^{4x}+x^{5k}+\ldots+x^{kn}+\ldots \end{align*}$$
Each term of the product will therefore have the form
$$x^{n_1}x^{2n_2}x^{3n_3}\ldots x^{kn_k}=x^{n_1+2n_2+3n_3+\ldots+kn_k}\;,$$
where $n_1,n_2,\ldots,n_{k-1}\ge 0$, and $n_k\ge 1$. This term is $x^n$ if and only if
$$n_1+2n_2+3n_3+\ldots+kn_k=n\;,\tag{2}$$
in which case it corresponds to a partition of $n$ into $n_1$ parts of size $1$, $n_2$ parts of size $2$, and so on. Since $n_k\ge 1$, this partition must have a largest part of size $k$. Conversely, each partition of $n$ with largest part $k$ yields a solution to $(2)$ with $n_k\ge 1$. Thus, the coefficient of $x^n$ in $(1)$ is precisely the number of partitions of $n$ with largest part $k$.
Now look at the Ferrers diagram of any partition of $n$ with largest part $k$. Flip that diagram over its main diagonal, so that the top row becomes the first column and vice versa. You now have the Ferrers diagram of a partition of $n$ with exactly $k$ parts; this partition is the conjugate of the original partition. Every partition of $n$ into exactly $k$ parts arises in this way from a partition of $n$ with largest part $k$, so there are exactly as many partitions of $n$ into exactly $k$ parts as there are with largest part $k$: the former are the conjugates of the latter (and vice versa). Thus, the coefficient of $x^n$ in $(1)$ is also the number of partitions of $n$ into exactly $k$ parts.