Supporting symbolic Sum that might be summing roots of unity

Consider that how Sum gives different results when x is set to 1.

In[1]:= Sum[x^-k, {k, 1, n}]
Out[1]= (x^-n (-1 + x^n))/(-1 + x)
In[2]:= x = 1;
Sum[x^-k, {k, 1, n}]
Out[3]= n

Shouldn’t Sum have an option to assume if might be be summing a root of unity? Is there a clean and simple way to get this functionality without using variants of Hold and Inactive?

FractionalIteration.wl (11.5 KB)

Are you wanting Mathematica to return something like

Piecewise[{{(x^-n (-1 + x^n))/(-1 + x), x != 1}, {n, x == 1}}]

multilineformula.png

For symbolic results evaluated at specific points, sometimes a limit is required.

In[803]:= Limit[Sum[x^-k, {k, 1, n}], x -> 1]

Out[803]= n

Thanks Jim and Daniel, having a couple of options is great as I fine tune the software.