Replying to kcrisman:
Maybe it's time we fixed this.
It is not clear if forcing people to use N()
and getting a float, even if there is an integer simplification of the sum, is the right thing to do. Granted, the error thrown on N(I(10))
is a bug, and this ticket is about it. Here is a minimal example:
sage: (k,n) = var('k,n')
sage: f(n)=sum(abs(-k*k+n),k,1,n)
sage: f(n=8)
sum(abs(-k^2 + 8), k, 1, 8)
sage: N(f(8))
However, I would expect f(n=8).simplify()
or .expand()
to give me the result 162
, and this is #17422