aboutsummaryrefslogtreecommitdiff
path: root/src/input/is.input.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
committerdos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
commitab8cc85adde879fb963c94d15675783f2cf4b183 (patch)
treec202482327f474583b750b2c45dedfc4e4312b1d /src/input/is.input.pamphlet
downloadopen-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz
Initial population.
Diffstat (limited to 'src/input/is.input.pamphlet')
-rw-r--r--src/input/is.input.pamphlet51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/input/is.input.pamphlet b/src/input/is.input.pamphlet
new file mode 100644
index 00000000..4f451c22
--- /dev/null
+++ b/src/input/is.input.pamphlet
@@ -0,0 +1,51 @@
+\documentclass{article}
+\usepackage{axiom}
+\begin{document}
+\title{\$SPAD/src/input is.input}
+\author{The Axiom Team}
+\maketitle
+\begin{abstract}
+\end{abstract}
+\eject
+\tableofcontents
+\eject
+\section{License}
+<<license>>=
+--Copyright The Numerical Algorithms Group Limited 1991.
+@
+<<*>>=
+<<license>>
+
+-- This is the 3n + 1 function: f(n) = n/2 if n is even,
+-- 3n + 1 otherwise
+--
+-- It can obviously be coded as
+-- f n ==
+-- even? n => n quo 2
+-- 3 * n + 1
+
+-- but we code using the pattern matching syntax:
+-- f n ==
+-- n is 2*m% => m%
+-- 3 * n + 1
+
+-- The 'integer' is to return an integer instead of a polynomial
+f n ==
+ not empty?(u := Is(n, 2*m%)) => integer eval(m%, u)
+ 3 * n + 1
+
+)set stream showall on
+
+-- The function g generates the stream of the repeated applications of f
+g(n:INT):STREAM(INT) == generate(f, n)
+
+-- There is a conjecture that g(n) gets into the cycle (1 4 2)
+-- for every n
+s := g 27
+extend(s, 150)
+@
+\eject
+\begin{thebibliography}{99}
+\bibitem{1} nothing
+\end{thebibliography}
+\end{document}