# Evaluation of formula reduces domain and FullSimplify is wrong

I would like a closed form for the formula Sum[Binomial[k - b, n] Binomial[n + b, a], {n, 0, k}] where variables k, a, b are supposed to be integers. Simply evaluating this formula returns

Binomial[b, a] Hypergeometric2F1[1 + b, b - k, 1 - a + b, -1] -
Binomial[-b + k, 1 + k] Binomial[1 + b + k, a] HypergeometricPFQ[{1, 1 + b, 2 + b + k}, {2 + k, 2 - a + b + k}, -1]


which works fine when a <= b but returns Indeterminate when b < a even though the original formula doesn't. For example:

Unevaluated@
Sum[Binomial[k - b, n] Binomial[n + b, a], {n, 0, k}] /. {k -> 6, a -> 2, b -> 1}
(* 160 *)


while

Sum[Binomial[k - b, n] Binomial[n + b, a], {n, 0, k}] /. {k -> 6, a -> 2, b -> 1}
(* Indeterminate *)


However, the evaluated formula does give the right answer in the Limit.

Additionally, FullSimplify even returns 0 under the assumption that b < a:

FullSimplify[
Unevaluated@Sum[Binomial[k - b, n] Binomial[n + b, a], {n, 0, k}],
Element[k | a | b, Integers] && k >= 0 && 0 <= a <= k && 0 <= b < a]
(* 0 *)


So my question is: is this a bug? Is there a way to get Mathematica to try to simplify the sum over the whole domain?

• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. Dec 15, 2021 at 21:44

Indeed, the formula as returned by Mathematica does have the blemish you describe, due to the hypergeometric functions becoming infinite. This is actually a common problem encountered by people who use Sum[] to evaluate sums involving binomial coefficients. However, at least for this case, by using the Olver hypergeometric function instead (or what Mathematica calls Hypergeometric2F1Regularized[]), we can convert that result into something more useful. To wit,
(b! Hypergeometric2F1Regularized[1 + b, b - k, 1 - a + b, -1] +

is an expression equivalent to the one produced by Sum[] but (AFAICT) does not suffer indeterminacy problems.