0
$\begingroup$

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.

enter image description here 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!

$\endgroup$
4
  • $\begingroup$ 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$ Commented Jan 1 at 19:46
  • $\begingroup$ With v14.1 on a Mac I get a^n Binomial[-2 + d + n, -2 + d] Hypergeometric2F1[1, -n, 2 - d - n, b/a] for the sum and all substitutions return 3044 $\endgroup$ Commented Jan 1 at 20:31
  • 2
    $\begingroup$ You've changed the question and made new input different than what you had before. Now comment and answer below do not answer the new changes you made. Instead you should keep the old question, and just add new update below it, saying you had wrong input or something. But do not just remove old question making it not visible any more. $\endgroup$ Commented Jan 4 at 21:54
  • $\begingroup$ Any way, there could be a bug in how Mathematica evaluates, as the order should not really make difference. I would suggest sending bug report to Wolfram support with the new example. $\endgroup$ Commented Jan 4 at 21:56

2 Answers 2

1
$\begingroup$

Please always say which version you are using when showing a problem !

Using V 14.1 on windows 10, it gives same result. This could then be a bug that was fixed in current version.

sum = Sum[Binomial[-2 + d - lb + n, -2 + d] a^(n - lb) b^lb, {lb, 0, n}]
sum /. {n -> 5, a -> 3, b -> 2, d -> 3}
sum /. d -> 3 /. {n -> 5, a -> 3, b -> 2}

Screen shot below. Notice the sum is different than what you show.

enter image description here

$\endgroup$
1
$\begingroup$

Looks like a bug:

$Version

(*  "14.1.0 for Mac OS X ARM (64-bit) (July 16, 2024)"  *)

Hypergeometric2F1[1, -4, -4, x]
Hypergeometric2F1[1, -5, -5, x] (* if {n -> 5, d -> 3} *)
Hypergeometric2F1[1, -n, -n, x] (* if just {d -> 3} *)
(*
1 + x + x^2 + x^3 + x^4       (* wrong *)
1 + x + x^2 + x^3 + x^4 + x^5 (* wrong *)
1/(1 - x)                     (* right *)
*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.