### Related

a : 16800;

b : -990;

quotient(a,b);

Calculate

quotient(7,4);

Calculate

##### quotient

quotient(x^5 + x + 1,...

Calculate

##### quotient-ratsimp-remainder

f : x^5 + 3*x^2 + x + 2;

g : x^2 + x + 1;

q1 : quotient(f, g);

Calculate

##### quotient

f : x^5 + 3*x^2 + x + 2;

g : x^2 + x + 1;

quotient(f, g);

Calculate

##### quotient

eq1:(x^4)-(x^3);

eq2:2*(x^3)+5;

quotient(eq1,eq2);

Calculate

##### quotient-remainder

quotient(x^5+x+1, x^3...

remainder(x^5+x+1, x^...

Calculate

##### quotient

eq1:(x^6)-1;

eq2:(x^2)-x-2;

quotient(eq1,eq2);

Calculate

a : 16800;

b : -990;

quotient(a,b);

Calculate

quotient (8,2);

Calculate

### quotient

Run Example
```(%i1)f : x^5 + 3*x^2 + x + 2;
5      2
(%o1)                          x  + 3 x  + x + 2
(%i2) g : x^2 + x + 1;
2
(%o2)                             x  + x + 1
(%i3) quotient(f/g);
(%o3)                                  0
(%i4) ```
Run Example
```quotient(4*x^4-3*x^2+5*x-3, x^2-1);
2
(%o1)                              4 x  + 1
(%i2) remainder(4*x^4-3*x^2+5*x-3, x^2-1);
(%o2)                               5 x - 2
(%i3) divide(4*x^4-3*x^2+5*x-3, x^2-1);
2
(%o3)                         [4 x  + 1, 5 x - 2]
(%i4) ```
Run Example
```:lisp (defun enum-interval (low high &optional p)  (let* ((result nil)         (end-result 0))    (do* ((low low (+ low 1)))      ((>
low high) (if (not p) end-result (values-list end-result)))      (setf end-result (reverse (push low result))))));

ENUM-INTERVAL
(%i1) :lisp (defun group (source n)  (if (zerop n) (error "zero length"))  (labels ((rec (source acc)             (let ((rest (nthcdr n source)))               (if (consp rest)                   (rec rest (cons (subseq source 0 n) acc))                   (nreverse (cons source acc))))))    (if source (rec source nil) nil)));

GROUP
(%i1) :lisp (defun row-sum (min max n)  (let ((list (enum-interval min max)) (result))    (values-list     (dotimes (i (length (group list n)) (values (nreverse result)))       (push        (list (mapcan (lambda (x) (if (numberp x) (list x)))              (nth i (group list n)))              (format nil "sum: ~a" (reduce '+         (mapcan (lambda (x) (if (numberp x) (list x)))        (nth i (group list n))))))        result)))));

ROW-SUM
(%i1) :lisp (defun col-sum (min max n)  (let ((list (enum-interval min max)) (result))    (values-list     (dotimes (i (1+ (length (group list n))) (values (nreverse result)))       (push        (list (mapcan (lambda (x) (if (numberp x) (list x))) (mapcar (lambda (x) (nth i x)) (group list n)))              (format nil "sum: ~a" (reduce '+ (mapcan (lambda (x) (if (numberp x) (list x))) (mapcar (lambda (x) (nth i x)) (group list n))))))        result)))));

COL-SUM
(%i1) :lisp (row-sum 0 10 5);

((0 1 2 3 4) sum: 10)
((5 6 7 8 9) sum: 35)
((10) sum: 10)
(%i1) :lisp (row-sum 0 10 2);

((0 1) sum: 1)
((2 3) sum: 5)
((4 5) sum: 9)
((6 7) sum: 13)
((8 9) sum: 17)
((10) sum: 10)
(%i1) :lisp (col-sum 0 10 5);

((0 5 10) sum: 15)
((1 6) sum: 7)
((2 7) sum: 9)
((3 8) sum: 11)
(%i1) :lisp (col-sum 0 10 2);

((0 2 4 6 8 10) sum: 30)
((1 3 5 7 9) sum: 25)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(%i1) :lisp (row-sum 0 10 11);

((0 1 2 3 4 5 6 7 8 9 10) sum: 55)
(%i1) :lisp (row-sum 1 10 10);

((1 2 3 4 5 6 7 8 9 10) sum: 55)
(%i1) :lisp (col-sum 0 10 1);

((0 1 2 3 4 5 6 7 8 9 10) sum: 55)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(%i1) :lisp (col-sum 1 10 1);

((1 2 3 4 5 6 7 8 9 10) sum: 55)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(NIL sum: 0)
(%i1) :lisp (defun accumulate (op init seq)  (if (null seq)      init      (funcall op (car seq)               (accumulate op init (cdr seq)))));

ACCUMULATE
(%i1) :lisp (defun horner-eval (x coeff-seq)  (accumulate (lambda (this-coeff higher-terms)                (+ (* higher-terms x) this-coeff))              0              (reverse coeff-seq)));

HORNER-EVAL
(%i1) :lisp (horner-eval 0 (list 3 2 1));

1
(%i1) f(x):=(3*(x^2))+(2*x)+1;
2
(%o1)                       f(x) := 3 x  + 2 x + 1
(%i2) f(0);
(%o2)                                  1
(%i3) :lisp (horner-eval 2 (list 3 2 1));

17
(%i3) f(2);
(%o3)                                 17
(%i4) :lisp (defun entry (tree) (car tree))(defun left-branch (tree) (cadr tree))(defun right-branch (tree) (caddr tree))(defun make-tree (entry left right)  (list entry left right));

MAKE-TREE
(%i4) :lisp (defun element-of-set? (x set)  (cond ((null set) false)        ((= x (entry set)) true)        ((<
x (entry set))         (element-of-set? x (left-branch set)))        ((>
x (entry set))         (element-of-set? x (right-branch set)))));

ELEMENT-OF-SET?
(%i4) :lisp (defun adjoin-set (x set)  (cond ((null set) (make-tree x '() '()))        ((= x (entry set)) set)        ((<
x (entry set))         (make-tree (entry set)                     (adjoin-set x (left-branch set))                    (right-branch set)))        ((>
x (entry set))         (make-tree (entry set)                    (left-branch set)                    (adjoin-set x (right-branch set))))));

(%i4) :lisp (defun partial-tree (elts n)  (if (= n 0)      (cons '() elts)      (let ((left-size (quotient (- n 1) 2)))        (let ((left-result (partial-tree elts left-size)))          (let ((left-tree (car left-result))                (non-left-elts (cdr left-result))                (right-size (- n (+ left-size 1))))            (let ((this-entry (car non-left-elts))                  (right-result (partial-tree (cdr non-left-elts)                                              right-size)))              (let ((right-tree (car right-result))                    (remaining-elts (cdr right-result)))                (cons (make-tree this-entry left-tree right-tree)                      remaining-elts))))))));

PARTIAL-TREE
(%i4) :lisp (defun list->
tree (list)  (car (partial-tree list (length list))));

LIST->TREE
(%i4) :lisp (defun tree->
list (tree)  (if (null tree)      '()      (append (tree->
list (left-branch tree))              (cons (entry tree)                    (tree->
list (right-branch tree))))));

TREE->LIST
(%i4) :lisp (list->
tree '(1 3 5 7 9 11));

(5 (1 NIL (3 NIL NIL)) (9 (7 NIL NIL) (11 NIL NIL)))
(%i4) :lisp (tree->
list (list->
tree '(1 3 5 7 9 11)));

(1 3 5 7 9 11)
(%i4) ```

### Related Help

Help for Quotient