Rax Adaam
Rax Adaam

Reputation: 810

(wx)Maxima: list factors of an integer

How can one return the factors of an integer in a list? e.g. list_factors(6); > [1,2,3,6]? Is something like this possible? I looked through the documentation but didn't find anything like this tied to "factor" or "prime".

Upvotes: 1

Views: 370

Answers (1)

Eric Blom
Eric Blom

Reputation: 36

I think this is what you want:

listify(divisors(6)); > [1, 2, 3, 6]

Upvotes: 2

Related Questions