I am working on a symbolic summation in Mathematica involving a Hypergeometric function. Specifically, I define the following term:
bin[n_, d_] := Binomial[n + d - 1, d - 1];
sum = Sum[bin[n - lb, d - 2] a^(n - lb) b^lb, {lb, 0, n}]
Mathematica simplifies this to:
a^n Binomial[-3 + d + n, -3 + d] Hypergeometric2F1[1, -n, 3 - d - n, b/a]
However, when I plug in specific values for a, b, n, and d, the numerical results differ between:
Direct evaluation:
sum /. {n -> 5, a -> 3, b -> 2, d -> 3}
which gives 665. However, using the simplified closed-form expression for a specific dimension:
sum /. d -> 3 /. {n -> 5, a -> 3, b -> 2}
gives 729.
I suspect the issue lies in how Mathematica handles the simplification or evaluation of the Hypergeometric function in this context. Has anyone encountered similar issues with symbolic simplifications involving Hypergeometric functions in Mathematica? Are there known workarounds or explanations for such behavior?
Any insight would be greatly appreciated!

sum = Sum[ Binomial[-2 + d - lb + n, -2 + d] a^(n - lb) b^lb, {lb, 0, n}, Assumptions -> {n, a, b, d} \[Element] PositiveIntegers, GenerateConditions -> True]returns the input in 14.1 on Windows . $\endgroup$a^n Binomial[-2 + d + n, -2 + d] Hypergeometric2F1[1, -n, 2 - d - n, b/a]for thesumand all substitutions return3044$\endgroup$