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

apply(ZZ,Function) -- apply a function to {0,..., n-1}

Description

The command apply(n,f) is equivalent to apply(toList(0 .. n-1),f).
i1 : apply(10, i -> i^2)

o1 = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81}

o1 : List

Ways to use this method:


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