Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summation of 1/(n*(n + 1)*(2*n + 1)) , n=1 to infinity converges but symbolically evaluates to nan #13133

Open
ethankward opened this issue Aug 15, 2017 · 2 comments · May be fixed by #13451
Open
Labels

Comments

@ethankward
Copy link
Contributor

>>> import sympy
>>> sympy.__version__
'1.1.1'
>>> n = sympy.Symbol('n')
>>> s = sympy.Sum(1/(n*(n + 1)*(2*n + 1)), [n, 1, sympy.oo])
>>> s.doit()
nan
>>> sympy.N(s)
0.227411277760219

The actual value is 3 - 4 log(2).

@czgdp1807
Copy link
Member

czgdp1807 commented Sep 22, 2019

Currently, the code behaves like as follows,

Python 3.6.8 (default, Aug 20 2019, 17:12:48) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
>>> n = symbols('n')
>>> Sum(1/(n*(n + 1)*(2*n + 1)), [n, 1, oo]).doit()
nan
>>> N(Sum(1/(n*(n + 1)*(2*n + 1)), [n, 1, oo]).doit())
nan

@anutosh491
Copy link
Member

anutosh491 commented Feb 5, 2022

We do have classes implemented in functions/special/hyper.py to compute the answer though . I believe the answer should be -4*HyperRep_atanh(1) - 2*HyperRep_log1(1) + 3 , but there are some 3-4 errors reported like this which return nan,I am not sure if we have required things to approach those !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants