# $\sum_{k=1}^{\infty }\left\lfloor\frac{5}{5^k}\right\rfloor$ giving wrong answer?

Bug introduced in 7.0 or earlier and fixed in 11.0.1

When I try to evaluate the following:

$$\sum_{k=1}^{\infty }\Bigg\lfloor\frac{5}{5^k}\Bigg\rfloor$$

using

Sum[Floor[5/5^k], {k, 1, ∞}]


Mathematica provides an answer of $0$ when it clearly should be $1$. Using any finite limit for the summation, however, provides the correct answer. Why does this happen?

• What is the code you are using to get your result? Commented Dec 24, 2015 at 3:27
• Interesting: stackoverflow.com/questions/8690884/… Commented Dec 24, 2015 at 6:12
• Fascinating. Sum[Floor[5/5^k], {k, 0, \[Infinity]}] gives the expected 6, while Sum[Floor[5/5^k], {k, a, Infinity}] gives 0 for all larger a I've tested. Commented Dec 24, 2015 at 12:51
• The reason why a finite limit gives a good result is that in that case Mathematica computes the result directly: calculate each term, sum them up. Using a symbolic limit also results in 0. I don't have any insight into why it misses the k == 1 case when doing it symbolically. Tagging as bug. Commented Dec 24, 2015 at 13:16
• @Szabolcs, i.e. such finit limit Sum[Floor[5/5^k], {k, 1, 10^20}] gives 0. But Sum[Floor[5/5^k], {k, 0.99999999, Infinity}] gives 1. Definitely bug Commented Dec 24, 2015 at 13:34

Sum[Floor[5/5^k], {k, 1, Infinity}]

This is certainly a bug, but one the user is warned about. The help section on "Possible Issues" provides a couple of examples where Sum gives "an unexpected result" (read: a wrong one). It's always related to using some discrete function that cannot be evaluated symbolically, like PrimeQ or Plus@*IntegerDigits, and ends up oversimplified at the attempt. I strongly believe your case is no different because [5/5^k] is zero in all points inside [1,+∞), so perhaps Mathematica simplifies the summand to zero when trying to perform its symbolic methods. The remedy advised by the official help is to "prevent symbolic evaluation" by specifying a Method (none of the official list works, which should be a hint) or by making the sum finite.