constrained stars and bars problem I want to know number of solutions for following equation, where $r_k$'s are non-negative integers, and there is a constraint on $r_k$'s such that $r_1 \geq r_2 \geq \cdots \geq r_K$
\begin{equation}
r_1+r_2+\cdots+r_K=N
\end{equation}

EDIT:  This response answers a slightly different question, where $K$ (the number of summands) is allowed to vary.  I will leave it here for posterity, but it doesn't deserve any upvotes.

These are the integer partitions of $N$.  There is no closed formula for $p(N)$, the number of such partitions, although there is a nice generating function:
$$
\begin{align}
\sum_{N=1}^\infty p(N) x^N &= \prod_{k=1}^{\infty} \frac{1}{1-x^k} \\
&= (1 + x + x^2 + x^3 + \cdots)
(1 + x^2 + x^4 + x^6 + \cdots)
(1 + x^3 + x^6 + x^9 + \cdots)
\cdots
\end{align}
$$
The beginning of this expansion is
$$
1 + x + 2x^2 + 3x^3 + 5x^4 + 7x^5 + 11x^6 + \cdots
$$
which is another way of saying that for $N = 0, 1, 2, 3, \dots$, the values of $p(N)$ are
$$
1, 1, 2, 3, 5, 7, 11, \dots
$$
