I see.
Thank you very much for the response!
On Wednesday, September 10, 2025 at 3:02:59 PM UTC+3 Oscar wrote:
> I think WolframAlpha is wrong when it says that it diverges. My guess
> is that since you use a float it uses a heuristic numeric check for
> convergence and since this converges slowly the heuristic check looks
> like it does not converge. You can see mpmath struggles with it as
> well:
>
> In [1]: f = binomial(-S(2)/5, 1 + k) * hyper([1, 7/5 + k], [2 + k], -1)
>
> In [2]: f.evalf(subs={k:1e10})
> ...
> File <string>:38, in hypsum_2_1_RZ_Z_R(coeffs, z, prec, wp, epsshift,
> magnitude_check, **kwargs)
>
> NoConvergence: Hypergeometric series converges too slowly. Try
> increasing maxterms.
>
> On Wed, 10 Sept 2025 at 12:50, Paul Royik <[email protected]> wrote:
> >
> > If you replace -2/5 with -0.4, WolframAlpha says that the series
> diverges:
> https://www.wolframalpha.com/input?i=sum%28binomial%28-0.4%2C+n%29%2C+%28n%2C+1%2C+inf%29%29
> >
> > On Wednesday, September 10, 2025 at 2:48:04 PM UTC+3 Oscar wrote:
> >>
> >> I don't think wolframalpha says it is divergent:
> >>
> >>
> https://www.wolframalpha.com/input?i=sum%28binomial%28-2%2F5%2C+n%29%2C+%28n%2C+1%2C+inf%29%29
> >>
> >> It does not compute the sum in closed form but gives a formula for the
> >> partial sums as
> >>
> >> 2^(-2/5)-1 + f(k)
> >>
> >> where f(k) is something that goes to zero for large k.
> >>
> >> SymPy gives the same partial sum formula in terms of 2F1 (hyper)
> >> although it looks a little different with gamma functions:
> >>
> >> In [29]: print(summation(binomial(S(-2)/5, n), (n, 1, k)))
> >> (5/2 - 5*2**(3/5)/4)*gamma(3/5)/gamma(-2/5) - gamma(3/5)*hyper((1, k +
> >> 7/5), (k + 2,), -1)/(gamma(-k - 2/5)*gamma(k + 2))
> >>
> >> I think SymPy and WolframAlpha are in agreement but just WA does not
> >> compute a closed form for this particular sum whereas SymPy does get
> >> the closed form but SymPy does not simplify the gamma functions as
> >> nicely as WA does.
> >>
> >> I think simplify here could be improved:
> >>
> >> In [33]: e = summation(binomial(S(-2)/5, n), (n, 1, oo))
> >>
> >> In [34]: print(e)
> >> (5/2 - 5*2**(3/5)/4)*gamma(3/5)/gamma(-2/5)
> >>
> >> In [35]: e.evalf()
> >> Out[35]: -0.242141716744801
> >>
> >> In [36]: 2**(-2/5)-1
> >> Out[36]: -0.242141716744801
> >>
> >> In [37]: print(simplify(e))
> >> 5*(2 - 2**(3/5))*gamma(3/5)/(4*gamma(-2/5))
> >>
> >> Maybe gammasimp could handle this better somehow.
> >>
> >> --
> >> Oscar
> >>
> >> On Wed, 10 Sept 2025 at 12:19, Paul Royik <[email protected]> wrote:
> >> >
> >> > sum of binomial(-2/5, n), n=1..infinity
> >> >
> >> > SymPy says that the answer is 2^(-2/5)-1.
> >> > WolframAlpha says that the series is divergent.
> >> >
> >> > What answer is correct?
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> Groups "sympy" group.
> >> > To unsubscribe from this group and stop receiving emails from it,
> send an email to [email protected].
> >> > To view this discussion visit
> https://groups.google.com/d/msgid/sympy/16f407ca-97a8-4565-ace5-1157c2702722n%40googlegroups.com
> .
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "sympy" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> > To view this discussion visit
> https://groups.google.com/d/msgid/sympy/b73c1f9f-774f-451f-9574-b0db731cae7dn%40googlegroups.com
> .
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/sympy/bbf876d4-fb6d-4f9e-8667-02e89b75a590n%40googlegroups.com.