If \(p \sim \mathrm{Beta}(\alpha, \beta)\) and
\(X \sim \mathrm{Binomial}(n, p)\), then
\(X \sim \mathrm{BetaBinomial}(n, \alpha, \beta)\).
Probability mass function
$$
f(x) = {n \choose x} \frac{\mathrm{B}(x+\alpha, n-x+\beta)}{\mathrm{B}(\alpha, \beta)}
$$
Cumulative distribution function is calculated using recursive algorithm that employs the fact that
\(\Gamma(x) = (x - 1)!\), and
\(
\mathrm{B}(x, y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
\), and that
\(
{n \choose k} = \prod_{i=1}^k \frac{n+1-i}{i}
\). This enables re-writing probability mass function as
$$
f(x) = \left( \prod_{i=1}^x \frac{n+1-i}{i} \right) \frac{\frac{(\alpha+x-1)!\,(\beta+n-x-1)!}{(\alpha+\beta+n-1)!}}{\mathrm{B}(\alpha,\beta)}
$$
what makes recursive updating from \(x\) to \(x+1\) easy using the properties of factorials
$$
f(x+1) = \left( \prod_{i=1}^x \frac{n+1-i}{i} \right) \frac{n+1-x+1}{x+1} \frac{\frac{(\alpha+x-1)! \,(\alpha+x)\,(\beta+n-x-1)! \, (\beta+n-x)^{-1}}{(\alpha+\beta+n-1)!\,(\alpha+\beta+n)}}{\mathrm{B}(\alpha,\beta)}
$$
and let's us efficiently calculate cumulative distribution function as a sum of probability mass functions
$$F(x) = \sum_{k=0}^x f(k)$$