ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 02 Nov 2016 12:23:14 -0500Sage seems to be improperly computing an infinite sum, and giving an incorrect answerhttp://ask.sagemath.org/question/35354/sage-seems-to-be-improperly-computing-an-infinite-sum-and-giving-an-incorrect-answer/Reference this question: https://ask.sagemath.org/question/35305/how-i-can-test-this-equality-with-sage/
Here is the evaluation of an infinite sum in sage:
var('n')
f(n) = (-1)^(n+1)/(3*n+6*(-1)^n)
sum(f(2*n)+f(2*n+1),n,0,oo)
1/3*log(2) - 7/9
Evaluating the same sum in Mathematica:
f[n_] := (-1)^(n + 1)/(3*n + 6*(-1)^n)
Sum[f[2*n] + f[2*n + 1], {n, 0, Infinity}]
1/6 (-2 + Log[4])
Sage seems to be giving an incorrect solution. Am I missing something?rtcWed, 02 Nov 2016 12:23:14 -0500http://ask.sagemath.org/question/35354/Calculating terms of a serieshttp://ask.sagemath.org/question/9965/calculating-terms-of-a-series/Is there any way to calculate terms of a series which Sage is unable to find a closed-form expression for?
For example, how do I calculate the first ten terms of `a` in the following example?
sage: a = sum(sqrt(x), x, 0, oo)
sage: a
sum(sqrt(x), x, 0, +Infinity)
Eviatar BachMon, 01 Apr 2013 19:45:49 -0500http://ask.sagemath.org/question/9965/Problem with infinite sumhttp://ask.sagemath.org/question/9666/problem-with-infinite-sum/With Maple everything is so simple.
R := n -> sum(bernoulli(2*k)/n^(2*k), k = 1..infinity);
seq(evalf(R(i)), i = 1..5);
0.1449340668,0.03986813370,...
With Sage that's another story.
def R(n):
var('k')
return sum(bernoulli(2*k)/n^(2*k), k, 1, infinity)
[R(i) for i in (1..5)]
TypeError: unable to convert x (=2*k) to an integer. What do I miss?
EDIT with errors deleted.petropolisSat, 29 Dec 2012 10:00:10 -0600http://ask.sagemath.org/question/9666/