Upgrading from:

NumberTheory`NumberTheoryFunctions`

SquareFreeQ, PrimePowerQ, KroneckerSymbol, ChineseRemainder, and PrimitiveRoot have been added to the built-in Mathematica kernel functions.
NextPrime and PreviousPrime are now available as the newly added built-in Mathematica kernel function NextPrime.
Random[Prime,] is now available as the newly added built-in Mathematica kernel function RandomPrime.
The functionality of PrimeFactorList is available in the enhanced built-in Mathematica kernel function FactorInteger.
SqrtMod is now available as the built-in Mathematica kernel function PowerMod.
SqrtModList is now available as the newly added built-in Mathematica kernel function PowerModList.
ClassNumber is now available as the newly added built-in Mathematica kernel function NumberFieldClassNumber.
SumOfSquaresR is now available as the built-in Mathematica kernel function SquaresR.
OrderedSumOfSquaresRepresentations is now available as the built-in Mathematica kernel function PowersRepresentations.

SquareFreeQ

A product of distinct primes contains no squared factors:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
SquareFreeQ[2*3*5*7]

NextPrime and PreviousPrime

The next prime after one million:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
NextPrime[1000000]

The last prime before one million:

Version 5.2 PreviousPrime[1000000]

Random[Prime, ...]

A random prime number between 10 and 100:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
Random[Prime, {10, 100}]

PrimeFactorList

Find the list of prime factors of a rational number:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
PrimeFactorList[713/41]

PrimePowerQ

Here is a number that is a power of a single prime:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
PrimePowerQ[12167]

ChineseRemainder

The smallest positive integer x so that x is equal to 3 modulo 4 and x is equal to 4 modulo 5:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
ChineseRemainder[{3, 4}, {4, 5}]

SqrtMod and SqrtModList

This finds the smallest non-negative integer so that is equal to 3 modulo 11:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
SqrtMod[3, 11]

This returns all integers less than 11 that satisfy the relation:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
SqrtModList[3, 11]

ClassNumber

Find the class number for the algebraic number field generated by :

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
ClassNumber[-10099]

FundamentalDiscriminantQ

FundamentalDiscriminantQ can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
FundamentalDiscriminantQ[3243601]

ClassList

ClassList can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
ClassList[-403]

KroneckerSymbol

Find the Kronecker symbol :

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
KroneckerSymbol[5, 3]

SumOfSquares

Number of ways to represent 100 as a sum of 3 squares:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
SumOfSquaresR[3, 100]

SumOfSquaresRepresentations

SumOfSquaresRepresentations can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
SumOfSquaresRepresentations[3, 100]

OrderedSumOfSquaresRepresentations

Here is an ordered list of the representations of 100 as a sum of 3 squares:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
OrderedSumOfSquaresRepresentations[3, 100]

LeastPrimeFactor

LeastPrimeFactor can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
LeastPrimeFactor[3243601]

QuadraticRepresentation

QuadraticRepresentation can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
QuadraticRepresentation[3, 4410796736359]

Verify that this is indeed one of the possible representations:

SumOfFactors

Compute the sum of factors of that are less than :

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
SumOfFactors[360]

WhichRootOfUnity

WhichRootOfUnity can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
WhichRootOfUnity[Sqrt[(5 - Sqrt[5])/8] - I (1 + Sqrt[5])/4]

AliquotSequence

AliquotSequence can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
AliquotSequence[220]

AliquotCycle

AliquotCycle can be replaced by the following definition:

Version 5.2 << NumberTheory`NumberTheoryFunctions`;
AliquotCycle[562]

The original package is now available on the web at library.wolfram.com/infocenter/MathSource/6774.