Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

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

share|improve this question

1 Answer 1

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
1  
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

 
discard

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.