\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input algfacob.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1991.
@
<<*>>=
<<license>>

-- Examples used in Algebra document: ALGFACOB SCRIPT
)set history on
)clear all

-- The Algebra of Factored Integers

(w,x,y,z): FR INT
x := 2^8 * 78^7 * 111^3 * 74534
y := nilFactor(2,10) * nilFactor(3,20) * nilFactor(5,30)
x*y
w := x+y
expand w
f := x/y
g := (x^9)/y
f*g
h := (f*g)/(g*nilFactor(2,200))
)clear all

-- The Algebra of Factored Polynomials

(u,v,w) : FR POLY INT
u := factor (x^4 - y^4)
v := nilFactor(x-y,2) * nilFactor(x+y,2) * nilFactor(x^2 + y^2,1)
w := factor(x^2 + 2*x*y + 2*x + 2*y + y^2 + 1) * nilFactor(x-y,2)
nthFactor(u,1)
nthFactor(u,2)
nthFactor(u,3)
nthFactor(u,4)
gcd(u,v)
u + v
lcm(u,v)
u * v * w
expand %
u/w
w/(u*v)
%%(-1) * %%(-2)
%%(-1) + %%(-2)
)clear all

-- Some Notes on Using Factored Objects

f : FR INT := 144000
nthFactor(f,1)
nthExponent(f,1)
nthFlag(f,1)
nthFlag(nilFactor(20,4),1)
nthFlag(primeFactor(7,9),1)
factors f
numberOfFactors f
f
reduce(*,[nthFactor(f,i) :: (FR INT) for i in 1..numberOfFactors(f)])
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
