sums(L1,L2) returns a sorted list of the unique sums of nonzero elements of L1 with L2; sums(n, L1) returns the sorted list of unique sums of n nonzero elements of L1.
|
|
|
|
|
|
Of course the sequence of arbitrary sums of elements including 0 is essentially semigroup L. To get just the sums of n elements, one could write:
|
|
The object sums is a method function.