Question: I am a topologist and not terribly familiar with the combo literature so please forgive me if this is standard. I'm hoping for some sort of reference for this. Given a positive integer $n$, I wish to count the number of ways to write $n$ as a sum of distinct parts with a fixed length. For example, $n=12$ with length $3$ would yield $7$; namely $\{1,2,9\}, \{1,3,8\}, \{1,4,7\}, \{1,5,6\}, \{2,3,7\}, \{2,4,6\}, \{3,4,5\}$. I am aware of this $Q(n)$ function but it looks at all lengths, not a fixed one. Is anything known about this?

Answer: 
Let $q(n,k)$ be the number of partitions of $n$ into $k$ distinct parts. The generating function is $$Q\_k(x)=\sum\_{n\ge 0}q(n,k)x^n=\frac{x^{k+\binom{k}2}}{(1-x)(1-x^2)\dots(1-x^k)}\;.$$ A fairly terse derivation can be found in [these notes](http://math.berkeley.edu/~mhaiman/math172-spring10/partitions.pdf). The numbers $q(n,k)$ are sequence [A008289](http://oeis.org/A008289) in the [Online Encyclopedia of Integer Sequences](http://oeis.org/wiki/Welcome); the entry has a little more information and a reference.

**Added:** The $\binom{k}2$ in the exponent in the numerator corresponds naturally to the $\binom{k}2=\frac{k(k-1)}2$ in Zander’s answer; the reason for it can be found in the notes to which I linked.
Have a look to Henry Bottomley's site <http://www.se16.info/js/partitionstest.htm>
I like it very much and I hope it will help you.
greetings s.h.