
(/VERSIONCHECK 2) 

(DEFUN |INTHEORY;harmonic;IF;1| (|n| $)
  (PROG (|#G3| |s| |k| |h|)
    (RETURN
      (SEQ (COND
             ((< |n| 0)
              (|error| "harmonic not defined for negative integers"))
             ('T
              (SEQ (COND
                     ((< |n| (QCAR (QREFELT $ 16)))
                      (SEQ (LETT |s| 0 . #0=(|INTHEORY;harmonic;IF;1|))
                           (EXIT (LETT |h| (|spadConstant| $ 17) . #0#))))
                     ('T
                      (PROGN
                        (LETT |#G3| (QREFELT $ 16) . #0#)
                        (LETT |s| (QCAR |#G3|) . #0#)
                        (LETT |h| (QCDR |#G3|) . #0#)
                        |#G3|)))
                   (SEQ (LETT |k| (+ |s| 1) . #0#) G190
                        (COND ((> |k| |n|) (GO G191)))
                        (SEQ (EXIT (LETT |h|
                                    (SPADCALL |h|
                                     (SPADCALL 1 |k| (QREFELT $ 18))
                                     (QREFELT $ 19)) . #0#)))
                        (LETT |k| (+ |k| 1) . #0#) (GO G190) G191
                        (EXIT NIL))
                   (PROGN
                     (RPLACA (QREFELT $ 16) |n|)
                     (QCAR (QREFELT $ 16)))
                   (PROGN
                     (RPLACD (QREFELT $ 16) |h|)
                     (QCDR (QREFELT $ 16)))
                   (EXIT |h|)))))))) 

(DEFUN |INTHEORY;fibonacci;2I;2| (|n| $)
  (PROG (|#G8| |#G9| |k| |t| |#G11| |#G12| |#G13| |#G14| |f1| |f2|)
    (RETURN
      (SEQ (COND
             ((EQL |n| 0) 0)
             ((< |n| 0)
              (* (COND ((ODDP |n|) 1) ('T -1))
                 (SPADCALL (- |n|) (QREFELT $ 21))))
             ('T
              (SEQ (PROGN
                     (LETT |#G8| 0 . #0=(|INTHEORY;fibonacci;2I;2|))
                     (LETT |#G9| 1 . #0#)
                     (LETT |f1| |#G8| . #0#)
                     (LETT |f2| |#G9| . #0#))
                   (SEQ (LETT |k| (- (INTEGER-LENGTH |n|) 2) . #0#)
                        G190 (COND ((< |k| 0) (GO G191)))
                        (SEQ (LETT |t|
                                   (SPADCALL |f2| 2 (QREFELT $ 23)) . #0#)
                             (PROGN
                               (LETT |#G11|
                                     (+ |t|
                                      (SPADCALL |f1| 2 (QREFELT $ 23))) . #0#)
                               (LETT |#G12|
                                     (+ |t|
                                      (*
                                       (SPADCALL 2 |f1| (QREFELT $ 24))
                                       |f2|)) . #0#)
                               (LETT |f1| |#G11| . #0#)
                               (LETT |f2| |#G12| . #0#))
                             (EXIT (COND
                                     ((SPADCALL |n| |k| (QREFELT $ 26))
                                      (PROGN
                                        (LETT |#G13| |f2| . #0#)
                                        (LETT |#G14|
                                         (+ |f1| |f2|) . #0#)
                                        (LETT |f1| |#G13| . #0#)
                                        (LETT |f2| |#G14| . #0#))))))
                        (LETT |k| (+ |k| -1) . #0#) (GO G190) G191
                        (EXIT NIL))
                   (EXIT |f2|)))))))) 

(DEFUN |INTHEORY;euler;2I;3| (|n| $)
  (PROG (|l| #0=#:G1848 |i| |j| #1=#:G1858 |t| |e|)
    (RETURN
      (SEQ (COND
             ((< |n| 0)
              (|error| "euler not defined for negative integers"))
             ((ODDP |n|) 0)
             ('T
              (SEQ (LETT |l| (SPADCALL (QREFELT $ 10) (QREFELT $ 27))
                         . #2=(|INTHEORY;euler;2I;3|))
                   (EXIT (COND
                           ((< |n| |l|)
                            (SPADCALL (QREFELT $ 10) |n|
                                (QREFELT $ 28)))
                           ('T
                            (SEQ (SPADCALL (QREFELT $ 10)
                                     (SPADCALL
                                      (PROG1
                                       (LETT #0#
                                        (- (+ |n| 1) |l|) . #2#)
                                        (|check-subtype| (>= #0# 0)
                                         '(|NonNegativeInteger|) #0#))
                                      0 (QREFELT $ 9))
                                     (QREFELT $ 29))
                                 (SEQ (LETT |i| 1 . #2#) G190
                                      (COND
                                        ((> |i| |l|) #3=(GO G191)))
                                      (SEQ
                                       (EXIT
                                        (SPADCALL (QREFELT $ 10) |i| 0
                                         (QREFELT $ 30))))
                                      (LETT |i| (+ |i| 2) . #2#)
                                      #4=(GO G190) G191 (EXIT NIL))
                                 (SEQ (LETT |i| (+ |l| 1) . #2#) G190
                                      (COND ((> |i| |n|) #3#))
                                      (SEQ
                                       (LETT |t|
                                        (LETT |e| 1 . #2#) . #2#)
                                       (SEQ (LETT |j| 2 . #2#)
                                        (LETT #1# (- |i| 2) . #2#) G190
                                        (COND ((> |j| #1#) #3#))
                                        (SEQ
                                         (LETT |t|
                                          (QUOTIENT2
                                           (* (* |t| (+ (- |i| |j|) 1))
                                            (+ (- |i| |j|) 2))
                                           (SPADCALL |j| (- |j| 1)
                                            (QREFELT $ 31))) . #2#)
                                         (EXIT
                                          (LETT |e|
                                           (+ |e|
                                            (* |t|
                                             (SPADCALL (QREFELT $ 10)
                                              |j| (QREFELT $ 28)))) . #2#)))
                                        (LETT |j| (+ |j| 2) . #2#) #4#
                                        G191 (EXIT NIL))
                                       (EXIT
                                        (SPADCALL (QREFELT $ 10) |i|
                                         (- |e|) (QREFELT $ 30))))
                                      (LETT |i| (+ |i| 2) . #2#) #4#
                                      G191 (EXIT NIL))
                                 (EXIT (SPADCALL (QREFELT $ 10) |n|
                                        (QREFELT $ 28)))))))))))))) 

(DEFUN |INTHEORY;bernoulli;IF;4| (|n| $)
  (PROG (|l| #0=#:G1860 |i| |j| #1=#:G1870 |t| |b|)
    (RETURN
      (SEQ (COND
             ((< |n| 0)
              (|error| "bernoulli not defined for negative integers"))
             ((ODDP |n|)
              (COND
                ((EQL |n| 1)
                 (SPADCALL (SPADCALL 1 2 (QREFELT $ 18))
                     (QREFELT $ 33)))
                ('T (|spadConstant| $ 17))))
             ('T
              (SEQ (LETT |l| (SPADCALL (QREFELT $ 15) (QREFELT $ 34))
                         . #2=(|INTHEORY;bernoulli;IF;4|))
                   (EXIT (COND
                           ((< |n| |l|)
                            (SPADCALL (QREFELT $ 15) |n|
                                (QREFELT $ 35)))
                           ('T
                            (SEQ (SPADCALL (QREFELT $ 15)
                                     (SPADCALL
                                      (PROG1
                                       (LETT #0#
                                        (- (+ |n| 1) |l|) . #2#)
                                        (|check-subtype| (>= #0# 0)
                                         '(|NonNegativeInteger|) #0#))
                                      (|spadConstant| $ 17)
                                      (QREFELT $ 14))
                                     (QREFELT $ 36))
                                 (SEQ (LETT |i| 1 . #2#) G190
                                      (COND
                                        ((> |i| |l|) #3=(GO G191)))
                                      (SEQ
                                       (EXIT
                                        (SPADCALL (QREFELT $ 15) |i|
                                         (|spadConstant| $ 17)
                                         (QREFELT $ 37))))
                                      (LETT |i| (+ |i| 2) . #2#)
                                      #4=(GO G190) G191 (EXIT NIL))
                                 (SEQ (LETT |i| (+ |l| 1) . #2#) G190
                                      (COND ((> |i| |n|) #3#))
                                      (SEQ (LETT |t| 1 . #2#)
                                       (LETT |b|
                                        (SPADCALL (- 1 |i|) 2
                                         (QREFELT $ 18)) . #2#)
                                       (SEQ (LETT |j| 2 . #2#)
                                        (LETT #1# (- |i| 2) . #2#) G190
                                        (COND ((> |j| #1#) #3#))
                                        (SEQ
                                         (LETT |t|
                                          (QUOTIENT2
                                           (* (* |t| (+ (- |i| |j|) 2))
                                            (+ (- |i| |j|) 3))
                                           (SPADCALL |j| (- |j| 1)
                                            (QREFELT $ 31))) . #2#)
                                         (EXIT
                                          (LETT |b|
                                           (SPADCALL |b|
                                            (SPADCALL
                                             (SPADCALL |t|
                                              (QREFELT $ 38))
                                             (SPADCALL (QREFELT $ 15)
                                              |j| (QREFELT $ 35))
                                             (QREFELT $ 39))
                                            (QREFELT $ 19)) . #2#)))
                                        (LETT |j| (+ |j| 2) . #2#) #4#
                                        G191 (EXIT NIL))
                                       (EXIT
                                        (SPADCALL (QREFELT $ 15) |i|
                                         (SPADCALL
                                          (SPADCALL |b|
                                           (SPADCALL (+ |i| 1)
                                            (QREFELT $ 38))
                                           (QREFELT $ 40))
                                          (QREFELT $ 33))
                                         (QREFELT $ 37))))
                                      (LETT |i| (+ |i| 2) . #2#) #4#
                                      G191 (EXIT NIL))
                                 (EXIT (SPADCALL (QREFELT $ 15) |n|
                                        (QREFELT $ 35)))))))))))))) 

(DEFUN |INTHEORY;inverse| (|a| |b| $)
  (PROG (|borg| |q| |r| |#G25| |#G26| |#G27| |#G28| |c1| |d1|)
    (RETURN
      (SEQ (LETT |borg| |b| . #0=(|INTHEORY;inverse|))
           (LETT |c1| 1 . #0#) (LETT |d1| 0 . #0#)
           (SEQ G190
                (COND
                  ((NULL (COND ((EQL |b| 0) 'NIL) ('T 'T))) (GO G191)))
                (SEQ (LETT |q| (QUOTIENT2 |a| |b|) . #0#)
                     (LETT |r| (- |a| (* |q| |b|)) . #0#)
                     (PROGN
                       (LETT |#G25| |b| . #0#)
                       (LETT |#G26| |r| . #0#)
                       (LETT |a| |#G25| . #0#)
                       (LETT |b| |#G26| . #0#))
                     (EXIT (PROGN
                             (LETT |#G27| |d1| . #0#)
                             (LETT |#G28| (- |c1| (* |q| |d1|)) . #0#)
                             (LETT |c1| |#G27| . #0#)
                             (LETT |d1| |#G28| . #0#))))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT (COND
                   ((EQL |a| 1) (SPADCALL |c1| |borg| (QREFELT $ 42)))
                   ('T (|error| "moduli are not relatively prime")))))))) 

(DEFUN |INTHEORY;chineseRemainder;5I;6| (|x1| |m1| |x2| |m2| $)
  (SEQ (COND
         ((OR (< |m1| 0) (< |m2| 0))
          (|error| "moduli must be positive"))
         ('T
          (SEQ (LETT |x1| (SPADCALL |x1| |m1| (QREFELT $ 42))
                     . #0=(|INTHEORY;chineseRemainder;5I;6|))
               (LETT |x2| (SPADCALL |x2| |m2| (QREFELT $ 42)) . #0#)
               (EXIT (+ |x1|
                        (* |m1|
                           (SPADCALL
                               (* (- |x2| |x1|)
                                  (|INTHEORY;inverse| |m1| |m2| $))
                               |m2| (QREFELT $ 42)))))))))) 

(DEFUN |INTHEORY;jacobi;3I;7| (|a| |b| $)
  (PROG (|#G37| |#G38| #0=#:G1897 |k| |j|)
    (RETURN
      (SEQ (COND
             ((< |b| 0)
              (LETT |b| (- |b|) . #1=(|INTHEORY;jacobi;3I;7|))))
           (EXIT (COND
                   ((EQL |b| 0)
                    (|error| "second argument of jacobi may not be 0"))
                   ((EQL |b| 1) 1)
                   (#2='T
                    (SEQ (COND
                           ((SPADCALL |b| (QREFELT $ 44))
                            (COND
                              ((< 1 (SPADCALL |a| 4 (QREFELT $ 42)))
                               (EXIT (|error|
                                      "J(a/b) not defined for b even and a = 2 or 3 (mod 4)"))))))
                         (COND
                           ((SPADCALL |b| (QREFELT $ 44))
                            (COND
                              ((SPADCALL |a| (QREFELT $ 44)) (EXIT 0)))))
                         (SEQ (LETT |k| 0 . #1#) G190
                              (COND
                                ((NULL (SPADCALL |b| (QREFELT $ 44)))
                                 #3=(GO G191)))
                              (SEQ (EXIT
                                    (LETT |b| (QUOTIENT2 |b| 2) . #1#)))
                              (LETT |k| (QSADD1 |k|) . #1#)
                              #4=(GO G190) G191 (EXIT NIL))
                         (LETT |j|
                               (SEQ (COND
                                      ((ODDP |k|)
                                       (COND
                                         ((EQL
                                           (SPADCALL |a| 8
                                            (QREFELT $ 42))
                                           5)
                                          (EXIT -1)))))
                                    (EXIT 1)) . #1#)
                         (EXIT (COND
                                 ((EQL |b| 1) |j|)
                                 (#2#
                                  (SEQ (LETT |a|
                                        (SPADCALL |a| |b|
                                         (QREFELT $ 42)) . #1#)
                                       (SEQ G190
                                        (COND ((NULL (< 1 |a|)) #3#))
                                        (SEQ
                                         (EXIT
                                          (COND
                                            ((ODDP |a|)
                                             (SEQ
                                              (COND
                                                ((EQL
                                                  (REMAINDER2 |a| 4) 3)
                                                 (COND
                                                   ((EQL
                                                     (REMAINDER2 |b| 4)
                                                     3)
                                                    (LETT |j|
                                                     (- |j|) . #1#)))))
                                              (EXIT
                                               (PROGN
                                                 (LETT |#G37|
                                                  (REMAINDER2 |b| |a|) . #1#)
                                                 (LETT |#G38|
                                                  |a| . #1#)
                                                 (LETT |a|
                                                  |#G37| . #1#)
                                                 (LETT |b|
                                                  |#G38| . #1#)))))
                                            ('T
                                             (SEQ
                                              (SEQ (LETT #0# NIL . #1#)
                                               (LETT |k| 0 . #1#) G190
                                               (COND (#0# #3#))
                                               (SEQ
                                                (EXIT
                                                 (LETT |a|
                                                  (QUOTIENT2 |a| 2) . #1#)))
                                               (LETT |k|
                                                (PROG1 (QSADD1 |k|)
                                                  (LETT #0#
                                                   (ODDP |a|) . #1#)) . #1#)
                                               #4# G191 (EXIT NIL))
                                              (EXIT
                                               (COND
                                                 ((ODDP |k|)
                                                  (COND
                                                    ((< 4
                                                      (REMAINDER2
                                                       (+ |b| 2) 8))
                                                     (LETT |j|
                                                      (- |j|) . #1#)))))))))))
                                        NIL #4# G191 (EXIT NIL))
                                       (EXIT
                                        (COND
                                          ((EQL |a| 0) 0)
                                          (#2# |j|))))))))))))))) 

(DEFUN |INTHEORY;legendre;3I;8| (|a| |p| $)
  (COND
    ((SPADCALL |p| (QREFELT $ 47)) (SPADCALL |a| |p| (QREFELT $ 45)))
    ('T (|error| "characteristic of legendre must be prime")))) 

(DEFUN |INTHEORY;eulerPhi;2I;9| (|n| $)
  (PROG (|entry| #0=#:G1907 |r|)
    (RETURN
      (SEQ (COND
             ((EQL |n| 0) 0)
             ('T
              (SEQ (LETT |r| (|spadConstant| $ 12)
                         . #1=(|INTHEORY;eulerPhi;2I;9|))
                   (SEQ (LETT |entry| NIL . #1#)
                        (LETT #0#
                              (SPADCALL (SPADCALL |n| (QREFELT $ 50))
                                  (QREFELT $ 54)) . #1#)
                        G190
                        (COND
                          ((OR (ATOM #0#)
                               (PROGN
                                 (LETT |entry| (CAR #0#) . #1#)
                                 NIL))
                           (GO G191)))
                        (SEQ (EXIT (LETT |r|
                                    (SPADCALL
                                     (SPADCALL (- (QCAR |entry|) 1)
                                      (QCAR |entry|) (QREFELT $ 18))
                                     |r| (QREFELT $ 39)) . #1#)))
                        (LETT #0# (CDR #0#) . #1#) (GO G190) G191
                        (EXIT NIL))
                   (EXIT (SPADCALL (SPADCALL |n| |r| (QREFELT $ 55))
                             (QREFELT $ 56)))))))))) 

(DEFUN |INTHEORY;divisors;IL;10| (|n| $)
  (PROG (|f| #0=#:G1917 |k| #1=#:G1918 |pow| |m| #2=#:G1919 |newList|
             |oldList|)
    (RETURN
      (SEQ (LETT |oldList| (LIST 1) . #3=(|INTHEORY;divisors;IL;10|))
           (SEQ (LETT |f| NIL . #3#)
                (LETT #0#
                      (SPADCALL (SPADCALL |n| (QREFELT $ 50))
                          (QREFELT $ 54)) . #3#)
                G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |f| (CAR #0#) . #3#) NIL))
                   #4=(GO G191)))
                (SEQ (LETT |newList| |oldList| . #3#)
                     (SEQ (LETT |k| 1 . #3#)
                          (LETT #1# (QCDR |f|) . #3#) G190
                          (COND ((QSGREATERP |k| #1#) #4#))
                          (SEQ (LETT |pow| (EXPT (QCAR |f|) |k|) . #3#)
                               (EXIT (SEQ (LETT |m| NIL . #3#)
                                      (LETT #2# |oldList| . #3#) G190
                                      (COND
                                        ((OR (ATOM #2#)
                                          (PROGN
                                            (LETT |m| (CAR #2#) . #3#)
                                            NIL))
                                         #4#))
                                      (SEQ
                                       (EXIT
                                        (LETT |newList|
                                         (CONS (* |pow| |m|) |newList|) . #3#)))
                                      (LETT #2# (CDR #2#) . #3#)
                                      #5=(GO G190) G191 (EXIT NIL))))
                          (LETT |k| (QSADD1 |k|) . #3#) #5# G191
                          (EXIT NIL))
                     (EXIT (LETT |oldList| |newList| . #3#)))
                (LETT #0# (CDR #0#) . #3#) #5# G191 (EXIT NIL))
           (EXIT (SPADCALL (CONS #'|INTHEORY;divisors;IL;10!0| $)
                     |oldList| (QREFELT $ 61))))))) 

(DEFUN |INTHEORY;divisors;IL;10!0| (|#1| |#2| $)
  (SPADCALL |#1| |#2| (QREFELT $ 58))) 

(DEFUN |INTHEORY;numberOfDivisors;2I;11| (|n| $)
  (PROG (|entry| #0=#:G1925 #1=#:G1923 #2=#:G1921 #3=#:G1922)
    (RETURN
      (SEQ (COND
             ((EQL |n| 0) 0)
             (#4='T
              (PROGN
                (LETT #3# NIL . #5=(|INTHEORY;numberOfDivisors;2I;11|))
                (SEQ (LETT |entry| NIL . #5#)
                     (LETT #0#
                           (SPADCALL (SPADCALL |n| (QREFELT $ 50))
                               (QREFELT $ 54)) . #5#)
                     G190
                     (COND
                       ((OR (ATOM #0#)
                            (PROGN (LETT |entry| (CAR #0#) . #5#) NIL))
                        (GO G191)))
                     (SEQ (EXIT (PROGN
                                  (LETT #1# (+ 1 (QCDR |entry|)) . #5#)
                                  (COND
                                    (#3# (LETT #2# (* #2# #1#) . #5#))
                                    ('T
                                     (PROGN
                                       (LETT #2# #1# . #5#)
                                       (LETT #3# 'T . #5#)))))))
                     (LETT #0# (CDR #0#) . #5#) (GO G190) G191
                     (EXIT NIL))
                (COND (#3# #2#) (#4# 1))))))))) 

(DEFUN |INTHEORY;sumOfDivisors;2I;12| (|n| $)
  (PROG (|entry| #0=#:G1933 #1=#:G1930 #2=#:G1929 #3=#:G1927 #4=#:G1928
                 |r|)
    (RETURN
      (SEQ (COND
             ((EQL |n| 0) 0)
             (#5='T
              (SEQ (LETT |r|
                         (PROGN
                           (LETT #4# NIL
                                 . #6=(|INTHEORY;sumOfDivisors;2I;12|))
                           (SEQ (LETT |entry| NIL . #6#)
                                (LETT #0#
                                      (SPADCALL
                                       (SPADCALL |n| (QREFELT $ 50))
                                       (QREFELT $ 54)) . #6#)
                                G190
                                (COND
                                  ((OR (ATOM #0#)
                                    (PROGN
                                      (LETT |entry| (CAR #0#) . #6#)
                                      NIL))
                                   (GO G191)))
                                (SEQ (EXIT
                                      (PROGN
                                        (LETT #2#
                                         (SPADCALL
                                          (-
                                           (EXPT (QCAR |entry|)
                                            (+
                                             (PROG1
                                              (LETT #1#
                                               (QCDR |entry|) . #6#)
                                               (|check-subtype|
                                                (>= #1# 0)
                                                '(|NonNegativeInteger|)
                                                #1#))
                                             1))
                                           1)
                                          (- (QCAR |entry|) 1)
                                          (QREFELT $ 18)) . #6#)
                                        (COND
                                          (#4#
                                           (LETT #3#
                                            (SPADCALL #3# #2#
                                             (QREFELT $ 39)) . #6#))
                                          ('T
                                           (PROGN
                                             (LETT #3# #2# . #6#)
                                             (LETT #4# 'T . #6#)))))))
                                (LETT #0# (CDR #0#) . #6#) (GO G190)
                                G191 (EXIT NIL))
                           (COND
                             (#4# #3#)
                             (#5# (|spadConstant| $ 12)))) . #6#)
                   (EXIT (SPADCALL |r| (QREFELT $ 56)))))))))) 

(DEFUN |INTHEORY;sumOfKthPowerDivisors;INniI;13| (|n| |k| $)
  (PROG (|entry| #0=#:G1941 #1=#:G1938 #2=#:G1937 #3=#:G1935 #4=#:G1936
                 |r|)
    (RETURN
      (SEQ (COND
             ((EQL |n| 0) 0)
             (#5='T
              (SEQ (LETT |r|
                         (PROGN
                           (LETT #4# NIL
                                 . #6=(|INTHEORY;sumOfKthPowerDivisors;INniI;13|))
                           (SEQ (LETT |entry| NIL . #6#)
                                (LETT #0#
                                      (SPADCALL
                                       (SPADCALL |n| (QREFELT $ 50))
                                       (QREFELT $ 54)) . #6#)
                                G190
                                (COND
                                  ((OR (ATOM #0#)
                                    (PROGN
                                      (LETT |entry| (CAR #0#) . #6#)
                                      NIL))
                                   (GO G191)))
                                (SEQ (EXIT
                                      (PROGN
                                        (LETT #2#
                                         (SPADCALL
                                          (-
                                           (EXPT (QCAR |entry|)
                                            (+
                                             (* |k|
                                              (PROG1
                                               (LETT #1#
                                                (QCDR |entry|) . #6#)
                                                (|check-subtype|
                                                 (>= #1# 0)
                                                 '(|NonNegativeInteger|)
                                                 #1#)))
                                             |k|))
                                           1)
                                          (- (EXPT (QCAR |entry|) |k|)
                                           1)
                                          (QREFELT $ 18)) . #6#)
                                        (COND
                                          (#4#
                                           (LETT #3#
                                            (SPADCALL #3# #2#
                                             (QREFELT $ 39)) . #6#))
                                          ('T
                                           (PROGN
                                             (LETT #3# #2# . #6#)
                                             (LETT #4# 'T . #6#)))))))
                                (LETT #0# (CDR #0#) . #6#) (GO G190)
                                G191 (EXIT NIL))
                           (COND
                             (#4# #3#)
                             (#5# (|spadConstant| $ 12)))) . #6#)
                   (EXIT (SPADCALL |r| (QREFELT $ 56)))))))))) 

(DEFUN |INTHEORY;moebiusMu;2I;14| (|n| $)
  (PROG (|t| |k| #0=#:G1947 #1=#:G1946 #2=#:G1944)
    (RETURN
      (SEQ (EXIT (COND
                   ((EQL |n| 1) 1)
                   ('T
                    (SEQ (LETT |t| (SPADCALL |n| (QREFELT $ 50))
                               . #3=(|INTHEORY;moebiusMu;2I;14|))
                         (SEQ (EXIT (SEQ (LETT |k| NIL . #3#)
                                     (LETT #0#
                                      (SPADCALL |t| (QREFELT $ 54)) . #3#)
                                     G190
                                     (COND
                                       ((OR (ATOM #0#)
                                         (PROGN
                                           (LETT |k| (CAR #0#) . #3#)
                                           NIL))
                                        (GO G191)))
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((< 1 (QCDR |k|))
                                          (PROGN
                                            (LETT #2#
                                             (PROGN
                                               (LETT #1# 0 . #3#)
                                               (GO #1#)) . #3#)
                                            (GO #2#))))))
                                     (LETT #0# (CDR #0#) . #3#)
                                     (GO G190) G191 (EXIT NIL)))
                              #2# (EXIT #2#))
                         (EXIT (COND
                                 ((ODDP (SPADCALL |t| (QREFELT $ 67)))
                                  -1)
                                 ('T 1)))))))
           #1# (EXIT #1#))))) 

(DEFUN |IntegerNumberTheoryFunctions| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1949)
        (RETURN
          (COND
            ((LETT #0#
                   (HGET |$ConstructorCache|
                         '|IntegerNumberTheoryFunctions|)
                   . #1=(|IntegerNumberTheoryFunctions|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache|
                                   '|IntegerNumberTheoryFunctions|
                                   (LIST
                                    (CONS NIL
                                     (CONS 1
                                      (|IntegerNumberTheoryFunctions;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#)
                  (HREM |$ConstructorCache|
                        '|IntegerNumberTheoryFunctions|))))))))))) 

(DEFUN |IntegerNumberTheoryFunctions;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|IntegerNumberTheoryFunctions|)
              . #0=(|IntegerNumberTheoryFunctions|))
        (LETT $ (GETREFV 69) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|IntegerNumberTheoryFunctions|
            NIL (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 10 (SPADCALL 1 1 (QREFELT $ 9)))
        (QSETREFV $ 15
                  (SPADCALL 1 (|spadConstant| $ 12) (QREFELT $ 14)))
        (QSETREFV $ 16 (CONS 1 (|spadConstant| $ 12)))
        $)))) 

(MAKEPROP '|IntegerNumberTheoryFunctions| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|NonNegativeInteger|) (|Integer|)
             (|IndexedFlexibleArray| 7 (NRTEVAL 0)) (0 . |new|) 'E
             (|Fraction| 7) (6 . |One|)
             (|IndexedFlexibleArray| 11 (NRTEVAL 0)) (10 . |new|) 'B 'H
             (16 . |Zero|) (20 . /) (26 . +) |INTHEORY;harmonic;IF;1|
             |INTHEORY;fibonacci;2I;2| (|PositiveInteger|) (32 . **)
             (38 . *) (|Boolean|) (44 . |bit?|) (50 . |#|) (55 . |elt|)
             (61 . |concat!|) (67 . |setelt|) (74 . *)
             |INTHEORY;euler;2I;3| (80 . -) (85 . |#|) (90 . |elt|)
             (96 . |concat!|) (102 . |setelt|) (109 . |coerce|)
             (114 . *) (120 . /) |INTHEORY;bernoulli;IF;4|
             (126 . |positiveRemainder|)
             |INTHEORY;chineseRemainder;5I;6| (132 . |even?|)
             |INTHEORY;jacobi;3I;7| (|IntegerPrimesPackage| 7)
             (137 . |prime?|) |INTHEORY;legendre;3I;8| (|Factored| $)
             (142 . |factor|)
             (|Record| (|:| |factor| 7) (|:| |exponent| 7)) (|List| 51)
             (|Factored| 7) (147 . |factors|) (152 . *) (158 . |numer|)
             |INTHEORY;eulerPhi;2I;9| (163 . <) (|Mapping| 25 7 7)
             (|List| 7) (169 . |sort|) |INTHEORY;divisors;IL;10|
             |INTHEORY;numberOfDivisors;2I;11|
             |INTHEORY;sumOfDivisors;2I;12|
             |INTHEORY;sumOfKthPowerDivisors;INniI;13| (175 . |One|)
             (179 . |numberOfFactors|) |INTHEORY;moebiusMu;2I;14|)
          '#(|sumOfKthPowerDivisors| 184 |sumOfDivisors| 190
             |numberOfDivisors| 195 |moebiusMu| 200 |legendre| 205
             |jacobi| 211 |harmonic| 217 |fibonacci| 222 |eulerPhi| 227
             |euler| 232 |divisors| 237 |chineseRemainder| 242
             |bernoulli| 250)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 68
                                '(2 8 0 6 7 9 0 11 0 12 2 13 0 6 11 14
                                  0 11 0 17 2 11 0 7 7 18 2 11 0 0 0 19
                                  2 7 0 0 22 23 2 7 0 22 0 24 2 7 25 0
                                  0 26 1 8 6 0 27 2 8 7 0 7 28 2 8 0 0
                                  0 29 3 8 7 0 7 7 30 2 7 0 6 0 31 1 11
                                  0 0 33 1 13 6 0 34 2 13 11 0 7 35 2
                                  13 0 0 0 36 3 13 11 0 7 11 37 1 11 0
                                  7 38 2 11 0 0 0 39 2 11 0 0 0 40 2 7
                                  0 0 0 42 1 7 25 0 44 1 46 25 7 47 1 7
                                  49 0 50 1 53 52 0 54 2 11 0 7 0 55 1
                                  11 7 0 56 2 7 25 0 0 58 2 60 0 59 0
                                  61 0 53 0 66 1 53 6 0 67 2 0 7 7 6 65
                                  1 0 7 7 64 1 0 7 7 63 1 0 7 7 68 2 0
                                  7 7 7 48 2 0 7 7 7 45 1 0 11 7 20 1 0
                                  7 7 21 1 0 7 7 57 1 0 7 7 32 1 0 60 7
                                  62 4 0 7 7 7 7 7 43 1 0 11 7 41)))))
          '|lookupComplete|)) 

(MAKEPROP '|IntegerNumberTheoryFunctions| 'NILADIC T) 
