Ask Your Question
4

How to evaluate the infinite sum of 1/(2^n-1) over all positive integers?

asked 2016-01-09 15:28:40 +0100

ablmf gravatar image

I have tried

s = sum(1/(2^x-1), x, 1, oo)
s.n()

But I got

cannot evaluate symbolic expression numerically

The sum does not have a simple form, but it is finite. So is there a way to evaluate it numerically in sage?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2016-01-09 16:04:43 +0100

vdelecroix gravatar image

updated 2016-01-09 16:41:49 +0100

One possibility to get around this infinite sumation is to use truncation

sage: sum(1 / (2^x - 1), x, 1, 10).n()
1.60571827189075
sage: sum(1 / (2^x - 1), x, 1, 30).n()
1.60669515148397
sage: sum(1 / (2^x - 1), x, 1, 100).n()
1.60669515241529

Your sum is converging pretty fast. The tail after $n$ is of the order of $2^{-n}$. In particular, since real numbers have a default of 53 bits of precision, the evaluation of the sum is the same at 53 and 100 (but not at 52)

sage: sum(1 / (2^x - 1), x, 1, 52).n() == sum(1 / (2^x - 1), x, 1, 100).n()
False
sage: sum(1 / (2^x - 1), x, 1, 53).n() == sum(1 / (2^x - 1), x, 1, 100).n()
True

The fact that it is exactly 53 in this case is because the size of the tail is exactly $2^{-n}$... for other sums it might be different. But whatever convergent series you are considering, its numerical evaluation will be constant from a certain point.

edit flag offensive delete link more
3

answered 2016-01-09 16:59:25 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Another way to do that is by using SymPy:

from sympy import Sum, Symbol
x = Symbol('x')
s = Sum( 1/(x**2-1), (x, 1, 00))
s.doit()

Give the result[1]:

0

I remember seeing a way to convert SymPy expression to SAGE format, but I don't know how exactly.

[1] I apologize I typed another function in the command line which is $\frac{1}{x^2 -1}$. After realizing that, I tried to evaluate your function but ipython always crash.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-01-09 15:28:40 +0100

Seen: 4,738 times

Last updated: Jan 09 '16