Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I is easy to enter

$ \sum_{s=1}^{n}k(s) $

But how can I enter

$ \sum_{s=1,3}k(s) $


When I try it, Mathematica says

Syntax::sntxi: Incomplete expression; more input is needed .

Also the following didn't work.


share|improve this question
up vote 12 down vote accepted

According to the documentation:

$\sum _i^{i_{\max }} f$ is by default interpreted as Sum[f {$i$, $i_{\max }$}]

so we can abuse this: enter image description here

You can use Sequence to provide di too because:

$\sum _{i=i_{\min }}^{i_{\max }} f$ is by default interpreted as Sum[f {$i$, $i_{\min }$, $i_{\max }$}]

enter image description here

ssch has found undocumented but useful pattern that is also interpreted:

$\sum _{spec} f$ is by default interpreted as Sum[f, spec]

enter image description here

share|improve this answer
Using {i,1,5,2} instead of i=1 works too – ssch Dec 7 '13 at 13:05
@ssch Good point, definitely cleaner than Sequence :) – Kuba Dec 7 '13 at 13:06
@Kuba What exactly do you mean by your "Sequence" solution? When I evaluate Sum[i, {i, {i = 1, Sequence[5, 2]}}] I get 8 in Mathematica 8.0.4. Please clarify. – Alexey Popkov Dec 7 '13 at 16:43
@AlexeyPopkov according to the documentation, solution with Sequence is equivalent to Sum[i, {i, 1, Sequence[5, 2]}] not to the one you've provided. – Kuba Dec 7 '13 at 16:46
@Kuba Thanks, it is clear now. +1 – Alexey Popkov Dec 8 '13 at 6:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.