Message Boards Message Boards

0
|
2858 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Supporting symbolic Sum that might be summing roots of unity

Posted 1 year ago

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?

Attachments:
POSTED BY: Daniel Geisler
3 Replies

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

POSTED BY: Daniel Geisler

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
POSTED BY: Daniel Lichtblau
Posted 1 year ago

Are you wanting Mathematica to return something like

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

Piecewise formula

POSTED BY: Jim Baldwin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract