Definition: | sequence s = factors(atom n, integer include1=0) |
Description: | Returns a list of all integer factors of n. If the optional include1 parameter is 1, the result includes 1 and n, if -1 the result includes 1 but not n, and if it is 0 (the default), the result includes neither 1 nor n. |
Example: |
s = factors(6) -- s is {2,3} s = factors(6,1) -- s is {1,2,3,6} s = factors(6,-1) -- s is {1,2,3} |
See Also: | prime_factors |