$\sum_{k=1}^{\infty }\left\lfloor\frac{5}{5^k}\right\rfloor$ giving wrong answer?
This bug has been fixed in the just released Mathematica 11.0.1.
Sum[Floor[5/5^k], {k, 1, Infinity}]
(* 1 *)
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.