How many ways to choose $a<b<c<d<e$ from the set $\{1,2,3,\dotsc,100\}$ such that $100<a+b+c+d+e<145$?

(2. Update: Now the condition $e\leq100$ is also taken care of.)

Write $$\eqalign{a&=1+x_1\cr b&=2+x_1+x_2\cr c&=3+x_1+x_2+x_3\cr d&=4+x_1+x_2+x_3+x_4\cr e&=5+x_1+x_2+x_3+x_4+x_5\cr}$$ with $x_i\geq0$ $\>(1\leq i\leq5)$. Then we have to find the number of integer solutions ${\bf x}=(x_1,\ldots,x_5)$ satisfying $x_i\geq0$ $(1\leq i\leq5)$ and $$x_1+x_2+x_3+x_4+x_5\leq95,\qquad 86\leq 5x_1+4x_2+3x_3+2x_4+x_5\leq 129\ .$$ To this end expand the functions $$f_i(t,y):={1\over 1-t y^i}\qquad (1\leq i\leq 5)$$ up to $y^{129}$ and recursively compute (up to $y^{129}$) the functions $$g_0(t,y):=1,\qquad g_{k}(t,y):=g_{k-1}(t,y)\cdot f_k(t,y)\qquad(1\leq k\leq 5)\ .$$ The function $g_5(t,y)$ is a polynomial in $t$ and $y$. Each solution ${\bf x}$ of the original problem contributes a term $t^my^n$ to $g_5$, whereby $x_1+\ldots+x_5=m$, $5x_1+\ldots+x_5=n$. We now delete all terms in $g_5$ having a $t$-degree $m>95$, and subsequently put $t:=1$. Let $\hat g_5(y)$ be the resulting polynomial in $y$ alone. The number $N$ we are looking for is then given by $$N=\sum_{k=86}^{129}{\rm coeff}_k(\hat g_5)=2\,831\,886\ ,$$ as Mathematica computed for us.


The number of partitions of $n$ into five distinct parts with largest part $k$ is the coefficient of $t^kq^n$ in $$ \frac{t^5q^{15}}{(1-tq)(1-tq^2)(1-tq^3)(1-tq^4)(1-tq^5)}. $$ (For an explanation of this, see below.) With sufficient brute force, one could extract the coefficients of all terms with $k\le100$ and $100<n<145$—this is what Christian Blatter ends up doing (2. Update) to correct the omission in his original answer—but there are certainly more efficient computational approaches.

The most straightforward method that occurs to me, which avoids having to expand a two-variable generating function, is the following: drop the restriction that the largest part be at most $100$, and compute the number of partitions of $n$ into five distinct parts for $n\in\{101,102,\ldots,144\}$ by extracting appropriate coefficients of the generating function $$ \frac{q^{15}}{(1-q)(1-q^2)(1-q^3)(1-q^4)(1-q^5)}. $$ The result is $$ 26,455+27,604+28,796+\ldots+116,875+120,362=2,862,666. $$ For $n$ in this range, at most one part may be greater than $100$. (This means we don't have to worry about $d$ exceeding $e$.) So from the total number of unrestricted partitions subtract $$ \begin{aligned} &\sum_{e=101}^{134}\sum_{n=10}^{144-e}\text{(# partitions of $n$ into four distinct parts)}\\ &\quad=\sum_{n=10}^{43}(44-n)\text{(# partitions of $n$ into four distinct parts).} \end{aligned} $$ The number of partitions of $n$ into four distinct parts is the coefficient of $q^n$ in $$ \frac{q^{10}}{(1-q)(1-q^2)(1-q^3)(1-q^4)}. $$ Putting all this together, the amount to be subtracted is $$ 34\cdot1+33\cdot1+32\cdot2+31\cdot3+30\cdot5+29\cdot6+28\cdot9+\ldots+2\cdot351+1\cdot378=30,780. $$ The net result is $$ 2,862,666-30,780=2,831,886. $$

Explanation of generating function: At first glance, the generating function in the opening paragraph may appear to be the generating function whose $t^kq^n$ coefficient is the number of partitions of $n$ into $k$ parts of size at most $5$, having at least one part of each of the sizes $1$, $2$, $3$, $4$, $5$—which it is! But conjugating any such partition gives a partition of $n$ into five distinct parts with largest part $k$. Here's an example. A partition of $27$ into nine parts of size at most $5$, with each size represented at least once is $5+4+4+4+3+3+2+1+1$. It has the Ferrers diagram below. $$ \begin{array}{cccccccc}*&*&*&*&*\\ *&*&*&*\\ *&*&*&*\\ *&*&*&*\\ *&*&*\\ *&*&*\\ *&*\\ *\\ * \end{array} $$ Conjugating gives the partition of $27$ into five distinct parts with largest part $9$ shown below. $$ \begin{array}{ccccccccc}*&*&*&*&*&*&*&*&*\\ *&*&*&*&*&*&*\\ *&*&*&*&*&*\\ *&*&*&*\\ * \end{array} $$ This is the partition $9+7+6+4+1$. Because conjugation provides a one-to-one correspondence between the two types of partitions, the generating function above also represents what we claimed.