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.
Yes, you suggested import mpmath. Because of the effects you describe I always work with different worksheets, one with mpmath and one without. Of course this is peripheral here with regard to the problem.
Yes, I swapped n and k. Sorry for this. I deleted the edit.