Search code examples
listmaximawxmaximafactoring

(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".


Solution

  • I think this is what you want:

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