Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
4

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

asked 9 years ago

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?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 9 years ago

vdelecroix gravatar image

updated 9 years ago

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 2n. 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 2n... for other sums it might be different. But whatever convergent series you are considering, its numerical evaluation will be constant from a certain point.

Preview: (hide)
link
3

answered 9 years ago

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 1x21. After realizing that, I tried to evaluate your function but ipython always crash.

Preview: (hide)
link

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: 9 years ago

Seen: 4,871 times

Last updated: Jan 09 '16