Given a Ferrers board of shape $(b\_1,\ldots,b\_m)$, we define $r\_k$ as number of ways to place $k$ non-attacking rooks (as in Chess). In section 2.4 of Stanley's Enumerative Combinatorics (vol. 1) it's shown the identity:
$$\sum\_k r\_k (x)\_{m-k} = \prod\_i (x+s\_i)$$
where $s\_i = b\_i-i+1$, but I don't know if I can invert this formula or make an efficient algorithm to compute the $r\_k$'s.


If this isn't possible, I would be satisfied if I can compute them efficiently in the following shapes:


$(2,2,4,4,\ldots,2n-2,2n-2,2n)$


$(2,2,4,4,\ldots,2n,2n)$


$(1,1,3,3,\ldots,2n-1,2n-1,2n+1)$



How to compute the rook polynomial of a Ferrers board?
You can retrieve the coefficients of a polynomial written in the falling factorial basis by computing finite differences, as follows. 


Let $f : \mathbb{Z} \to \mathbb{Z}$ be a function, and let $\Delta f(n) = f(n+1) - f(n)$. Let $\Delta^{r+1} f = \Delta(\Delta^r f)$.


**Lemma 1:** $\displaystyle \Delta {n \choose k} = {n \choose k-1}$.


**Corollary:** If $\displaystyle f(n) = \sum\_{i=0}^d a\_i {n \choose i}$, then $\Delta^i f(0) = a\_i$.


**Lemma 2:** $\displaystyle \Delta^i f(0) = \sum\_{j=0}^{i} (-1)^{i-j} {i \choose j} f(j)$.


Note the similarity to how the Taylor coefficients of a polynomial in the usual basis are extracted, and note that $\displaystyle {n \choose k} = (n)\_k k!$. For the sake of having a final answer, this gives


$$r\_k = \frac{1}{(m-k)!} \sum\_{j=0}^{m-k} (-1)^{m-k-j} {m-k \choose j} \prod\_i (j + s\_i).$$


