From ab8cc85adde879fb963c94d15675783f2cf4b183 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 14 Aug 2007 05:14:52 +0000 Subject: Initial population. --- src/input/fns.input.pamphlet | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/input/fns.input.pamphlet (limited to 'src/input/fns.input.pamphlet') 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} -- cgit v1.2.3