Which programming language or a library can process Infinite Series?

后端 未结 13 1717
情书的邮戳
情书的邮戳 2021-02-03 23:46

Which programming language or a library is able to process infinite series (like geometric or harmonic)? It perhaps must have a database of some well-known series and automatica

13条回答
  •  Happy的楠姐
    2021-02-03 23:57

    This can be done in for instance sympy and sage (among open source alternatives) In the following, a few examples using sympy:

    In [10]: summation(1/k**2,(k,1,oo)) Out[10]: 2 π ── 6

    In [11]: summation(1/k**4, (k,1,oo)) Out[11]: 4 π ── 90

    In [12]: summation( (-1)**k/k, (k,1,oo)) Out[12]: -log(2)

    In [13]: summation( (-1)**(k+1)/k, (k,1,oo)) Out[13]: log(2)

    Behind the scenes, this is using the theory for hypergeometric series, a nice introduction is the book "A=B" by Marko Petkovˇeks, Herbert S. Wilf and Doron Zeilberger which you can find by googling. ¿What is a hypergeometric series?

    Everybody knows what an geometric series is: $X_1, x_2, x_3, \dots, x_k, \dots $ is geometric if the contecutive terms ratio $x_{k+1}/x_k$ is constant. It is hypergeometric if the consecutive terms ratio is a rational function in $k$! sympy can handle basically all infinite sums where this last condition is fulfilled, but only very few others.

提交回复
热议问题