aboutsummaryrefslogtreecommitdiff
path: root/src/input/algfacob.input.pamphlet
blob: 5700a3596a9181042ceb70ad2bf4b6ad8b4c3e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
\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}