# Mathematical Notation: Summation

In response to David Wees’ post about summation notation, I’d like to suggest that the terseness of mathematical notation is a godsend when working on long calculations, but it should, perhaps, be collapsible for experts and expandable for beginners.  What I mean is that while

$\sum\limits_{i=1}^{6} i^2$ or

$\sum\limits_{i\in1\ldots6} i^2$

may suffice for the expert, beginners may prefer

$\mathop{\Sigma\text{um}}\limits_{i\text{ from }1}^{\text{to }6} i^2$ or

$\mathop{\text{Sum}}\limits_{i\text{ from }1\text{ to }6} i^2$.

I hate the linear form that David Wees mentions,

Summation (i, 3, 6, i2) = 32 + 42 + 52 + 62 = 86,

for it loses the spatial memory aspect of the original summation convention.  The real problem seems to be that this last expression serializes for computers well, but the other mathematics is hard to type.  I would prefer “smaller bits” of mathematics, like Sum and Sequence:

Sum[Sequence[Lambda[i,i^2], 1..6]] or even Sum[(i->i^2)[1..6]]

It would be nice if computers would do f[A] if f[a] is defined for every a in A without some kind of function like Map or Apply.  Here’s a longer version of the last expression:

Sum[Apply[Lambda[i,i^2],1..6]]

In fancy LaTeX form that might be:

$\sum (i\mapsto i^2)[1..6]$ or

$\sum \left[(i\mapsto i^2)[1..6]\right]$

if we want to make the operator precedence completely clear.  Here, “1..6” is some Ruby-like syntactic sugar to mean the set (really: sequence) {1,2,3,4,5,6}.