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:
![<< NumberTheory`NumberTheoryFunctions`;
SquareFreeQ[2*3*5*7]](Files/NumberTheoryFunctions.en/legacy_1.gif)
NextPrime and PreviousPrime
The next prime after one million:
![<< NumberTheory`NumberTheoryFunctions`;
NextPrime[1000000]](Files/NumberTheoryFunctions.en/legacy_2.gif)
The last prime before one million:
![PreviousPrime[1000000]](Files/NumberTheoryFunctions.en/legacy_3.gif)
Random[Prime, ...]
A random prime number between 10 and 100:
![<< NumberTheory`NumberTheoryFunctions`;
Random[Prime, {10, 100}]](Files/NumberTheoryFunctions.en/legacy_4.gif)
PrimeFactorList
Find the list of prime factors of a rational number:
![<< NumberTheory`NumberTheoryFunctions`;
PrimeFactorList[713/41]](Files/NumberTheoryFunctions.en/legacy_5.gif)
PrimePowerQ
Here is a number that is a power of a single prime:
![<< NumberTheory`NumberTheoryFunctions`;
PrimePowerQ[12167]](Files/NumberTheoryFunctions.en/legacy_6.gif)
ChineseRemainder
The smallest positive integer x so that x is equal to 3 modulo 4 and x is equal to 4 modulo 5:
![<< NumberTheory`NumberTheoryFunctions`;
ChineseRemainder[{3, 4}, {4, 5}]](Files/NumberTheoryFunctions.en/legacy_7.gif)
SqrtMod and SqrtModList
This finds the smallest non-negative integer so that
is equal to 3 modulo 11:
![<< NumberTheory`NumberTheoryFunctions`;
SqrtMod[3, 11]](Files/NumberTheoryFunctions.en/legacy_8.gif)
This returns all integers less than 11 that satisfy the relation:
![<< NumberTheory`NumberTheoryFunctions`;
SqrtModList[3, 11]](Files/NumberTheoryFunctions.en/legacy_9.gif)
ClassNumber
Find the class number for the algebraic number field generated by
:
![<< NumberTheory`NumberTheoryFunctions`;
ClassNumber[-10099]](Files/NumberTheoryFunctions.en/legacy_10.gif)
FundamentalDiscriminantQ
FundamentalDiscriminantQ can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
FundamentalDiscriminantQ[3243601]](Files/NumberTheoryFunctions.en/legacy_11.gif)
ClassList
ClassList can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
ClassList[-403]](Files/NumberTheoryFunctions.en/legacy_12.gif)
KroneckerSymbol
![<< NumberTheory`NumberTheoryFunctions`;
KroneckerSymbol[5, 3]](Files/NumberTheoryFunctions.en/legacy_13.gif)
SumOfSquares
Number of ways to represent 100 as a sum of 3 squares:
![<< NumberTheory`NumberTheoryFunctions`;
SumOfSquaresR[3, 100]](Files/NumberTheoryFunctions.en/legacy_14.gif)
SumOfSquaresRepresentations
SumOfSquaresRepresentations can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
SumOfSquaresRepresentations[3, 100]](Files/NumberTheoryFunctions.en/legacy_15.gif)
OrderedSumOfSquaresRepresentations
Here is an ordered list of the representations of 100 as a sum of 3 squares:
![<< NumberTheory`NumberTheoryFunctions`;
OrderedSumOfSquaresRepresentations[3, 100]](Files/NumberTheoryFunctions.en/legacy_16.gif)
LeastPrimeFactor
LeastPrimeFactor can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
LeastPrimeFactor[3243601]](Files/NumberTheoryFunctions.en/legacy_17.gif)
QuadraticRepresentation
QuadraticRepresentation can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
QuadraticRepresentation[3, 4410796736359]](Files/NumberTheoryFunctions.en/legacy_18.gif)
Verify that this is indeed one of the possible representations:
SumOfFactors
Compute the sum of factors of that are less than
:
![<< NumberTheory`NumberTheoryFunctions`;
SumOfFactors[360]](Files/NumberTheoryFunctions.en/legacy_19.gif)
WhichRootOfUnity
WhichRootOfUnity can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
WhichRootOfUnity[Sqrt[(5 - Sqrt[5])/8] - I (1 + Sqrt[5])/4]](Files/NumberTheoryFunctions.en/legacy_20.gif)
AliquotSequence
AliquotSequence can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
AliquotSequence[220]](Files/NumberTheoryFunctions.en/legacy_21.gif)
AliquotCycle
AliquotCycle can be replaced by the following definition:
![<< NumberTheory`NumberTheoryFunctions`;
AliquotCycle[562]](Files/NumberTheoryFunctions.en/legacy_22.gif)
The original package is now available on the web at library.wolfram.com/infocenter/MathSource/6774.