Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » sum » sum(VisibleList,Function)
next | previous | forward | backward | up | index | toc

# sum(VisibleList,Function) -- sum results of applying a function

- Function: sum

## Description

sum(v,f) yields the sum of the expressions obtained by applying f to each of the elements of the list or sequence v.

    i1 : sum(1 .. 10, i -> i^2)

    o1 = 385

## See also

- sum -- compute the sum

## Ways to use this method:

- sum(VisibleList,Function) -- sum results of applying a function

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/sum-doc.m2:67:0.