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}
 A: We want the number of partitions of $N$ into at most $K$ parts.  For given the parts, there is exactly one way to arrange them in non-increasing order.
The number of partitions of $n$ into exactly $k$ (non-zero) parts is extensively discussed. As a start, please see the answer of Sammy Black. There is unfortunately no known nice closed form.
The number of partitions of $N$ into at most $K$ parts is the same as the number of partitions of $N+K$ into exactly $K$ parts. 
For if we have a partition of $N+K$ into exactly $K$ parts, by subtracting $1$ from each part we get a partition of $N$ into at most $K$ parts. And if we have a partition of $N$ into at most $K$ parts, by adding $1$ to each part we obtain a partition of $N+K$ into $K$ parts.
A: 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
$$
