diff options
author | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
commit | ab8cc85adde879fb963c94d15675783f2cf4b183 (patch) | |
tree | c202482327f474583b750b2c45dedfc4e4312b1d /src/input/fns.input.pamphlet | |
download | open-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz |
Initial population.
Diffstat (limited to 'src/input/fns.input.pamphlet')
-rw-r--r-- | src/input/fns.input.pamphlet | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/input/fns.input.pamphlet b/src/input/fns.input.pamphlet new file mode 100644 index 00000000..b183a586 --- /dev/null +++ b/src/input/fns.input.pamphlet @@ -0,0 +1,42 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/input fns.input} +\author{The Axiom Team} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +<<*>>= + +-- Input for page ExampleFunctions +)clear all + +odd(i) == 2*i - 1 +[odd(i) for i in 1..10] +odd == i +-> 2*i - 1 +odd(1111) +[i for i in 2.. | prime? i] +primes := / +primes == [p := nextPrime(i = 0 => 2; p) for i in 1..] +primes +primes(20) +firstPrimes(n) == [primes(i) for i in 1..n] +firstPrimes(25) +primesLessThan(n) == [p for p in primes while p < n] +primesLessThan 1000 +isPrime? n == reduce(or,[n = p for p in primes while n <= p]) +isPrime?(1111) +twins := [p,p+2 for p in primes | prime?(p+2)] +twins := [p, p+2 for i in 1.. | (p := primes(i)) + 2 = primes(i+1)] +firsts := [p for i in 1.. | (p := primes(i)) + 2 = primes(i+1)] +twins := [p, p + 2 for p in firsts] +twins(i) ==firsts(i),2 + firsts(i) +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document} |