>
 numfunctions not implemented
+ Integer Number Theory Functions
+
+The
+IntegerNumberTheoryFunctions package contains a variety of
+operations of interest to number theorists. Many of these operations
+deal with divisibility properties of integers (Recall that an integer
+a divides an integer b if there is an integer c such that b=a*c.)
+
+The operation divisors returns a list
+of the divisors of an integer
+
+You can now compute the number of divisors of 144 and the sum of the
+divisors of 144 by counting and summing the elements of the list we
+just created.
+
+Of course, you can compute the number of divisors of an integer n,
+usually denoted d(n), and the sum of the divisors of an integer n,
+usually denoted ς(n), without ever listing the divisors of n.
+
+In Axiom, you can simply call the operations
+
+The key is that d(n) and ς(n) are "multiplicative functions".
+This means that when n and m are relatively prime, that is, when n and
+m have no factors in common, then d(nm)=d(n)d(m) and ς(nm)=
+ς(n)ς(m). Note that these functions are trivial to
+compute when n is a prime power and are computed for general n from
+the prime factorization of n. Other examples of multiplicative functions
+are ς_k(n), the sum of the kth powers of the divisors of n and
+φ(n), the number of integers between 1 and n which are prime to n.
+The corresponding Axiom operations are called
+sumOfKthPowerDivisors and
+eulerPhi.
+
+
+An interesting function is called μ(n), the Moebius mu function,
+defined as
++ 0 if n has a repeated prime factor
+ (i.e. is divisible by a square)
+ μ(n)= 1 if n is 1
+ (1)^k if n is the product of k distinct primes
+
+The corresponding Axiom operation is
+
+This function occurs in the following theorem:
+
+Theorem(Moebius Inversion Formula):
+Let f(n) be a function on the positive integers and let F(n) be defined
+by F(n)=sum of f(n) over d  n where the sum is taken over the positive
+divisors of n. Then the values of f(n) can be recovered from the values
+of F(n):f(n) = sum of μF(n/d) over dn, where the sum is taken
+over the positive divisors of n.
+
+When f(n)=1, the F(n)=d(n). Thus, if you sum μ(d)*d(n/d) over
+the positive divisors of d of n, you should always get 1.
+
+Similarly, when f(n)=n, then F(n)=ς(n). Thus, if you sum
+μ(d)*ς(n/d) over the positive divisors d of n, you
+should always get n.
+
+The Fibonacci numbers are defined by
++ F(1)=1
+ F(2)=1
+ F(n)=F(n1)+F(n2) for n=3,4,...
+
+The operation fibonacci computes the
+nth Fibonacci number.
+
+Fibonacci numbers can also be expressed as sums of binomial
+coefficients.
+
+
+Quadratic symbols can be computed with the operations
+legendre and
+jacobi. The Legendre symbol (a/p) is
+defined for integers a and p with p an odd prime number. By definition,
++ = 1 when a is not a square (mod p)
+ (a/p) = 0 when a is divisible by p
+ = +1 when a is a square (mod p)
+
+You compute (a/p) via the command legendre(a,p)
+
+
+The Jacobi symbol (a/n) is the usual extension of the Legendre symbol,
+where n is an arbitrary integer. The most important property of the
+Jacobi symbol is the following: if K is a quadratic field with
+discriminant d and quadratic character χ, the χ(n)=(d/n).
+Thus, you can use the Jacobi symbol to compute, say, the class numbers
+of imaginary quadratic fields from a standard class number formula. This
+function computes the class number of the imaginary quadratic field with
+discriminant d.
+
+
<>
@
@@ 37164,37 +37567,36 @@ Additional Topics:
<>
Axiom provides many operations for manipulating arbitrary precision
integers. In this section we will show some of those that come from
Integer itself plus some that are
implemented in other packages. More examples of using integers are in
the following sections:
More examples of expansions are available in
IntegerNumberTheoryFunctions,
+ General Integer Information
+
+Axiom provides many operations for manipulating arbitrary precision integers.
+In this section we will show some of those that come from
+Integer itself plus some that are implemented
+in other packages. More examples of integers are in the following sections:
+Numbers.
+IntegerNumberTheoryFunctions,
DecimalExpansion,
BinaryExpansion,
HexadecimalExpansion, and
RadixExpansion.
+RadixExpansion
<>
@
+\subsection{numintegerfractions.xhtml}
+<>=
+<>
+
+
+<>
+ numintegerfractions not implemented
+<>
+@
+
\subsection{numintegers.xhtml}
<>=
<>
@@ 37278,7 +37680,7 @@ Additional topics
 Functions
+ Examples
Examples from number theory
@@ 37579,6 +37981,114 @@ To see other operations use the system command
<>
@
+\subsection{numnumbertheoreticfunctions.xhtml}
+<>=
+<>
+
+
+
+<>
+ Some Number Theoretic Functions
+
+Axiom provides several number theoretic operations for integers.
+More examples are in
+IntegerNumberTheoryFunctions,
+
+The operation fibonacci computes the
+Fibonacci numbers. The algorithm has a running time O(log(n)**3) for
+argument n.
+
+The operation legendre computes the
+Legendre symbol for its two integer arguments where the second one is
+prime. If you know the second argument to be prime, use
+jacobi instead where no check is made.
+
+The operation jacobi computes the Jacobi symbol
+for its two integer arguments. By convention, 0 is returned if the greatest
+common divisor of the numerator and denominator is not 1.
+
+The operation eulerPhi compute the values
+of Euler's φfunction where φ(n) equals the number of
+positive integers less than or equal to n that are relatively prime to the
+positive integer n.
+
+The operation moebiusMu computes the
+Moebius μ function.
+
+Although they have somewhat limited utility, Axiom provides Roman numerals.
+
+<>
+@
+
\subsection{numnumericfunctions.xhtml}
<>=
<>
@@ 38092,7 +38602,7 @@ Issue the system command
to display the full list of operations defined by
RadixExpansion. More examples of
+RadixExpansion. More examples of
expansions are available in
DecimalExpansion,
BinaryExpansion, and
@@ 38274,10 +38784,135 @@ to display the full list of operations defined by
\subsection{numproblems.xhtml}
<>=
<>
+
<>
 numproblems not implemented
+ Problems
+
+One can show that if an integer of the form 2**k1 is prime then
+k must be prime.
+
+Proof
+Suppose that k=m*n is a nontrivial factorization. Then
++ 2^m = 1 (mod (2^m1))
+ 2^(m*n) = 1 (mod (2^m1))
+ so 2^m1 is a nontrivial factor of 2^k1
+
+
+Problem Find the smallest prime p such that 2**p1 is not prime
+
+Answer
+
+First, define a function:
+
+You can try factoring f(p) as p ranges through the set of primes.
+For example,
+
+This gets tedious after a while, so let's use Axiom's stream facility.
+A streamm is essentially an infinite sequence. First, we create a stream
+consisting of the positive integers:
+
+Now, we create a stream consisting of the primes:
+
+Here is the 25th prime:
+
+Next, create the stream of numbers of the form 2**p1 with p prime:
+
+Finally, form the stream of factorizations of the elements of numbers:
+
+You can see that the fifth number in the stream (2047=23*89) is the first
+one that has a nontrivial factorization. Since 2**11=2048, the solution
+to the problem is 11.
+
+Here is another way to see that 2047 is the first number in the stream
+that is composite:
+
+
+Problem: Find the smallest positive integer n such that
+n**2n+41 is not prime.
+
+Answer: When n=41, n**2n+41=41**2, which certainly isn't prime.
+Is there any smaller integer that works? Here are the first 40 values:
+
+Now have Axiom factor the numbers on this list:
+
+You can see that 41 is the smallest positive integer n such that
+n**2n+41 is not prime.
<>
@
@@ 38430,6 +39065,8 @@ to display the full list of operations defined by
<>
+ Quotient Fields
+
The Fraction domain implements quotients.
The elements must belong to a domain of category
IntegralDomain: multiplication
@@ 38579,6 +39216,8 @@ Conversion is discussed in detail in
<>
+ Rational Numbers
+
Like integers, rational numbers can be arbitrarily large. For example:

@@ 42119,88 +42758,6 @@ You can also substitute numerical values for some or all of the variables.
<>
@
\subsection{primesandfactorization.xhtml}
<>=
<>



<>
Use the operation factor to factor integers.
It returns an object of type
Factored Integer. See Factored for a
discussion of the manipulation of factored objects.

The operation prime? returns true or false
depending on whether its argument is a prime.

The operation nextPrime returns the
least prime greater than its argument.

The operation prevPrime returns the
greatest prime less than its argument

To compute all primes between two integers (inclusively), use the
operation primes.

You might sometimes want to see the factorization of an integer when it is
considered a Gaussian integer. See Complex
for more details.


<>
@
\subsection{puiseuxseries.xhtml}
<>=
@@ 43096,103 +43653,6 @@ Enter the size of the matrix:
@
\subsection{somenumbertheoreticfunctions.xhtml}
<>=
<>



<>
Axiom provides several number theoretic operations for integers.
More examples are in
IntegerNumberTheoryFunctions.

The operation fibonacci computes the
Fibonacci numbers. The algorithm has running time O(log(n)^3) for
argument n.

The operation legendre computes the
Legendre symbol for its two integer arguments where the second one is prime.
If you know the second argument to be prime, use
jacobi instead where no check is made.

The operation jacobi computes the Jacobi
symbol for its two integer arguments. By convention, 0 is returned if
the greatest common divisor of the numerator and denominator is not 1.

The operation eulerPhi computes the
values of Euler's phi function where phi(n) equals the number of positive
integers less than or equal to n that are relatively prime to the positive
integer n.

The operation moebiusMu
computes the Moebius mu function.

The Ei function computes the Exponential Integral.

Although they have somewhat limited utility, Axiom provides Roman numerals.

<>
@

\subsection{summation.xhtml}
<>=
<>
@@ 43962,5 +44422,3 @@ static char axiom_bits[] = {
\bibitem{1} nothing
\end{thebibliography}
\end{document}

