
(/VERSIONCHECK 2) 

(DEFUN |CYCLOTOM;cyclotomic;ISup;1| (|n| $)
  (PROG (|l| #1=#:G1813 #2=#:G1812 #3=#:G1810 #4=#:G1818 |u| |g|)
    (RETURN
     (SEQ
      (LETT |g| (SPADCALL (SPADCALL |n| (QREFELT $ 9)) (QREFELT $ 12))
            . #5=(|CYCLOTOM;cyclotomic;ISup;1|))
      (LETT |l|
            (SPADCALL (SPADCALL 1 1 (QREFELT $ 16))
                      (SPADCALL 1 0 (QREFELT $ 16)) (QREFELT $ 17))
            . #5#)
      (SEQ (LETT |u| NIL . #5#) (LETT #4# |g| . #5#) G190
           (COND
            ((OR (ATOM #4#) (PROGN (LETT |u| (CAR #4#) . #5#) NIL)) (GO G191)))
           (SEQ
            (LETT |l|
                  (QCAR
                   (SPADCALL
                    (SPADCALL |l|
                              (PROG1 (LETT #3# (QCAR |u|) . #5#)
                                (|check-subtype| (>= #3# 0)
                                                 '(|NonNegativeInteger|) #3#))
                              (QREFELT $ 18))
                    |l| (QREFELT $ 20)))
                  . #5#)
            (EXIT
             (COND
              ((< 1 (QCDR |u|))
               (LETT |l|
                     (SPADCALL |l|
                               (PROG1
                                   (LETT #1#
                                         (EXPT (QCAR |u|)
                                               (PROG1
                                                   (LETT #2# (- (QCDR |u|) 1)
                                                         . #5#)
                                                 (|check-subtype| (>= #2# 0)
                                                                  '(|NonNegativeInteger|)
                                                                  #2#)))
                                         . #5#)
                                 (|check-subtype| (>= #1# 0)
                                                  '(|NonNegativeInteger|) #1#))
                               (QREFELT $ 18))
                     . #5#)))))
           (LETT #4# (CDR #4#) . #5#) (GO G190) G191 (EXIT NIL))
      (EXIT |l|))))) 

(DEFUN |CYCLOTOM;cyclotomicDecomposition;IL;2| (|n| $)
  (PROG (|l| |m| #1=#:G1825 #2=#:G1838 |z| #3=#:G1837 #4=#:G1836 |rr|
         #5=#:G1822 #6=#:G1835 #7=#:G1834 #8=#:G1833 |u| |g|)
    (RETURN
     (SEQ
      (LETT |g| (SPADCALL (SPADCALL |n| (QREFELT $ 9)) (QREFELT $ 12))
            . #9=(|CYCLOTOM;cyclotomicDecomposition;IL;2|))
      (LETT |l|
            (LIST
             (SPADCALL (SPADCALL 1 1 (QREFELT $ 16))
                       (SPADCALL 1 0 (QREFELT $ 16)) (QREFELT $ 17)))
            . #9#)
      (SEQ (LETT |u| NIL . #9#) (LETT #8# |g| . #9#) G190
           (COND
            ((OR (ATOM #8#) (PROGN (LETT |u| (CAR #8#) . #9#) NIL))
             #10=(GO G191)))
           (SEQ
            (LETT |m|
                  (PROGN
                   (LETT #7# NIL . #9#)
                   (SEQ (LETT |z| NIL . #9#) (LETT #6# |l| . #9#) G190
                        (COND
                         ((OR (ATOM #6#)
                              (PROGN (LETT |z| (CAR #6#) . #9#) NIL))
                          #10#))
                        (SEQ
                         (EXIT
                          (LETT #7#
                                (CONS
                                 (QCAR
                                  (SPADCALL
                                   (SPADCALL |z|
                                             (PROG1 (LETT #5# (QCAR |u|) . #9#)
                                               (|check-subtype| (>= #5# 0)
                                                                '(|NonNegativeInteger|)
                                                                #5#))
                                             (QREFELT $ 18))
                                   |z| (QREFELT $ 20)))
                                 #7#)
                                . #9#)))
                        (LETT #6# (CDR #6#) . #9#) #11=(GO G190) G191
                        (EXIT (NREVERSE0 #7#))))
                  . #9#)
            (SEQ (LETT |rr| 1 . #9#) (LETT #4# (- (QCDR |u|) 1) . #9#) G190
                 (COND ((QSGREATERP |rr| #4#) #10#))
                 (SEQ (LETT |l| (APPEND |l| |m|) . #9#)
                      (EXIT
                       (LETT |m|
                             (PROGN
                              (LETT #3# NIL . #9#)
                              (SEQ (LETT |z| NIL . #9#) (LETT #2# |m| . #9#)
                                   G190
                                   (COND
                                    ((OR (ATOM #2#)
                                         (PROGN
                                          (LETT |z| (CAR #2#) . #9#)
                                          NIL))
                                     #10#))
                                   (SEQ
                                    (EXIT
                                     (LETT #3#
                                           (CONS
                                            (SPADCALL |z|
                                                      (PROG1
                                                          (LETT #1# (QCAR |u|)
                                                                . #9#)
                                                        (|check-subtype|
                                                         (>= #1# 0)
                                                         '(|NonNegativeInteger|)
                                                         #1#))
                                                      (QREFELT $ 18))
                                            #3#)
                                           . #9#)))
                                   (LETT #2# (CDR #2#) . #9#) #11# G191
                                   (EXIT (NREVERSE0 #3#))))
                             . #9#)))
                 (LETT |rr| (QSADD1 |rr|) . #9#) #11# G191 (EXIT NIL))
            (EXIT (LETT |l| (APPEND |l| |m|) . #9#)))
           (LETT #8# (CDR #8#) . #9#) #11# G191 (EXIT NIL))
      (EXIT |l|))))) 

(DEFUN |CYCLOTOM;cyclotomicFactorization;IF;3| (|n| $)
  (PROG (|fr| #1=#:G1842 |f|)
    (RETURN
     (SEQ
      (LETT |fr| (|spadConstant| $ 25)
            . #2=(|CYCLOTOM;cyclotomicFactorization;IF;3|))
      (SEQ (LETT |f| NIL . #2#) (LETT #1# (SPADCALL |n| (QREFELT $ 23)) . #2#)
           G190
           (COND
            ((OR (ATOM #1#) (PROGN (LETT |f| (CAR #1#) . #2#) NIL)) (GO G191)))
           (SEQ
            (EXIT
             (LETT |fr|
                   (SPADCALL |fr| (SPADCALL |f| 1 (QREFELT $ 26))
                             (QREFELT $ 27))
                   . #2#)))
           (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
      (EXIT |fr|))))) 

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

(DEFUN |CyclotomicPolynomialPackage;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
     (PROGN
      (LETT |dv$| '(|CyclotomicPolynomialPackage|)
            . #1=(|CyclotomicPolynomialPackage|))
      (LETT $ (GETREFV 29) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|CyclotomicPolynomialPackage| NIL
                  (CONS 1 $))
      (|stuffDomainSlots| $)
      $)))) 

(MAKEPROP '|CyclotomicPolynomialPackage| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|Factored| 7) (|Integer|)
              (|IntegerFactorizationPackage| 7) (0 . |factor|)
              (|Record| (|:| |factor| 7) (|:| |exponent| 7)) (|List| 10)
              (5 . |factors|) (|SparseUnivariatePolynomial| 7) (10 . |One|)
              (|NonNegativeInteger|) (14 . |monomial|) (20 . -)
              (26 . |multiplyExponents|)
              (|Record| (|:| |quotient| $) (|:| |remainder| $))
              (32 . |monicDivide|) |CYCLOTOM;cyclotomic;ISup;1| (|List| 13)
              |CYCLOTOM;cyclotomicDecomposition;IL;2| (|Factored| 13)
              (38 . |One|) (42 . |primeFactor|) (48 . *)
              |CYCLOTOM;cyclotomicFactorization;IF;3|)
           '#(|cyclotomicFactorization| 54 |cyclotomicDecomposition| 59
              |cyclotomic| 64)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 28
                                                 '(1 8 6 7 9 1 6 11 0 12 0 13 0
                                                   14 2 13 0 7 15 16 2 13 0 0 0
                                                   17 2 13 0 0 15 18 2 13 19 0
                                                   0 20 0 24 0 25 2 24 0 13 7
                                                   26 2 24 0 0 0 27 1 0 24 7 28
                                                   1 0 22 7 23 1 0 13 7 21)))))
           '|lookupComplete|)) 

(MAKEPROP '|CyclotomicPolynomialPackage| 'NILADIC T) 
