Dear all,
I am playing with maxima-5.9.1 and found that divisors() function
described in the Maxima manual is not implemented.
I did:
grep -i divisors *.lisp
in the src directory of the source distribution of the maxima-5.9.1
and cannot find the definition.
Somthing quite similar is the lisp function divisors defined in
src/factor.lisp . However, it does not accept an integer as an
input argument, but it accepts the output of the function cfactorw
also defined in factor.lisp.
So,
(%i1) :lisp (divisors (cfactorw 12))
((1 nil) (3 (3)) (2 (2)) (6 (2 3)) (4 (2 2)) (12 (2 2 3)))
If it is still not in the latest source, the following would be the
simplest
definition for the function divisors:
(defun $divisors (n)
(let ((a (sort (mapcar #'car (divisors (cfactorw n))) #'<)))
(push (list 'mlist 'simp) a)
a))
Yasuaki Honda
Chiba, Japan