anchor.diff:  ;; An alternative would be to make the outer iteration over list-of-lists
   ;; that solution requires a use of setf that we haven't seen so far; namely setf'ing 
   ;; not a variable but a postion in a list, e.g.\ a car or an nth expression.
  -
  -
  -
  
positive.code: ;;
  ;; Question
  ;;
  ;; Define your own REMOVE-IF.
  ;;
  
  
negative.code:     lst2
      procs))
  
  ;; 
  ;; Question 
  ;;
  ;; Find the numbers in a given range that have the same Collatz length using
  ;; applicative programming techniques.
  ;;
  
  ;; first the procedures for computing Colaltz length
  
  (defun collatz-sequence (n)
    (labels ((col-next (n)
                       (if (<= n 1)
                         1
                         (if (evenp n)
                           (/ n 2)
                           (+ (* 3 n) 1))))
             (col-seq (lst)
                      (if (= (car lst) 1)
                        (reverse lst)
                        (col-seq (cons (col-next (car lst))
                                       lst)))))
      (col-seq (list n))))
  
  (defun collatz-length (n)
    (- (length (collatz-sequence n)) 1))
  
  ;; now you need some sort of table that stores the numbers according to their
  ;; Collatz length. For this, let cl_1, cl_2,...,cl_i denote specific Collatz
  ;; lengths, and n_i_1, n_i_2,...,n_i_j denote specific numbers that have
  ;; Collatz length i. Then one way to represent a table would be to have a list
  ;; with the following structure:
  ;;
  ;; ((cl_1 n_1_1 n_1_2 n_1_3 ...) (cl_2 n_2_1 n_2_2 n_2_3 ...) .  .  .)
  ;; 
  ;; in other words a list whose elements are lists whose first element is a
  ;; Collatz length and the rest of its elements are numbers with that Collatz
  ;; length
  
  ;; you need a procedure to update the information in this table.
  
  ;; Given a pair (collatz_length number):
  ;;  -- add (collatz_length number) to the table, if there is no entry with the given collatz_length.
  ;;  -- append (number) to the list starting with collatz_length
  ;;
  ;; this is best done with hash tables (or assoc lists), but here we will do it wihtout these.
  ;;
  
  (defun add-pair (pair table)
    (if table
      (if (= (car pair) (caar table))
        (cons
          (append (car table) (cdr pair))
          (cdr table))
        (cons
          (car table)
          (add-pair pair (cdr table))))
      (list pair)))
  
  ;; you need a sequence procedure
  
  (defun seq (start end &optional acc)
    "give the integer sequence from start to end inclusive of both ends"
    (if (< end start)
      acc
      (seq
        start
        (- end 1)
        (cons end acc))))
  
  
  ;; now the final procedure
  
  (defun collect-equal-cl (start end)
    (labels ((pair-cl (n)
                      "pair n with its collatz length in the form (cl-of-n n)"
                      (list (collatz-length n) n))
             (collect (lst table)
                      (if (endp lst)
                        table
                        (collect
                          (cdr lst)
                          (add-pair (pair-cl (car lst)) table)))))
      (collect (seq start end) nil)))
  
  ;; 
  ;; Question 
  