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

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

Description

sum(v,w,f) yields the sum of the results obtained by applying f to each of the pairs (i,j) of elements from the lists or sequences v and w, which should be of the same length.

i1 : R = ZZ[x,y,z];
i2 : sum({2,3,4},{x,y,z},(i,j)->j^i)

      4    3    2
o2 = z  + y  + x

o2 : R

See also

Ways to use this method:


The source of this document is in Macaulay2Doc/functions/sum-doc.m2:58:0.