Wilson's theorem represents essential material in any introductory prime number theory course. The theorem is named after John Wilson1, an 18th-century mathematician, although it had been stated in the 11th century by the Persian mathematician Ibn al-Haytham2. Wilson's theorem states that a natural number is prime if and only if
(1.7.271)
Wilson's theorem is formally stated by the following:
Theorem (1.7.272) – Wilson's Theorem: A natural numberis primeif and only if the product of all the positive integers up to, or, is one less than a multiple of
Using the prime number example , we find
(1.7.273)
which is one less than , a multiple of By manipulation, the theorem can be expressed as initially stated
(1.7.274)
and our example can be seen to hold
(1.7.275)
For a non-prime natural number , we choose
(1.7.276)
finding the result is equal to , and in the stated theorem's form, we would find it equals zero
(1.7.277)
In sequence notation, Wilson's theorem can be expressed as
(1.7.278)
which generates the following table of values for .
0
Table 1.7.2 – The first one-hundred values of.
In the table above, all non-zero numbers are prime and in red, except for
(1.7.279)
which is the only non-prime natural number equal to a non-zero result. The theorem still holds, given that is not evenly divisible by . We remark that the prime numbers appear to aggregate in the following set of odd-valued columns . The reasoning should be easy to see for the even-valued columns, given that will divide all the even numbers within. For the odd-valued column , the set of natural numbers will have the sequence
(1.7.280)
all of which are evenly divisible by . Wilson's theorem is important in analysis, but the rate at which the factorial function grows in size makes its use untenable when calculating large prime numbers and twin prime pairs. An example of the rapid rate at which the factorial function increases is seen for the prime number , for which has grown to approximately 305 octillion
(1.7.281)
Despite presenting the theorem, neither John Wilson nor his student Edward Waring could prove it. It was in 1771 that Joseph-Louis Lagrange3 proved Wilson's Theorem, and evidence suggests that Gottfried Wilhelm Leibniz had proved the theorem many years before 1771, which he did not publish. Most modern-day treatments of Wilson's Theorem apply Fermat's Little Theorem to prove it.
Theorem (1.7.282)- Fermat's little theorem:Ifis a prime number, for any integer, the numberis an integer multiple of, expressed in modular form as
By choosing and , we evaluate the theorem above
(1.7.283)
to find it equals the non-prime The term coprime defines that the only integer that divides both and is . If is not divisible by , it implies is coprime to , then Fermat's little theorem is equivalent to the statement that is an integer multiple of
(1.7.284)
which can be restated as
(1.7.285)
We use the coprime application of Fermat's little theorem to the prime numbers and , which are, therefore, coprime
(1.7.286)
finding the results holds. The example for and , represents two numbers that are not coprime and gives the result
(1.7.287)
which, unlike the previous, is non-zero. It is important to remember that two coprime numbers are not necessarily prime numbers. For example, for , we find the result is also
(1.7.288)
The harmonic numbers are defined as the partial sum of the harmonic series
(1.7.289)
From this series, the harmonic number recurrence relationship can be defined as
(1.7.290)
leading to the harmonic number difference identity
(1.7.291)
These identities can be used to derive division and product identities between adjacent harmonic numbers
(1.7.292)
(1.7.293)
(1.7.294)
The harmonic numbers can be applied analytically to Wilson's sequence , seen first by relating to the factorial in the next straightforward theorem.
Therefore, Wilson's sequence can be expressed in relationship to the harmonic numbers as
(1.7.296)
which holds irrespective of the congruent modulo operation. We can factor out from the result above and divide both sides by
(1.7.297)
then solve for
(1.7.298)
Since
(1.7.299)
we have that
(1.7.300)
A recurrence relationship can be seen by starting with the previous harmonic number identity for
(1.7.301)
which can be expanded to the next factorial
(1.7.302)
So, for , any factorial is equivalent to the harmonic number expansion
(1.7.303)
The harmonic numbers are also related to the digamma function , which is defined as the logarithmic derivative of the gamma function
(1.7.304)
Since the gamma function interpolates the factorial function to complex and non-integer values, it implies for positive integer values that
(1.7.305)
Like the factorial function, the gamma function has the following recurrence relationship
(1.7.306)
Specifically, the harmonic numbers relate to the digamma function by the following
(1.7.307)
where represents the Euler-Mascheroni constant The digamma function holds to the following equivalence involving the harmonic numbers and the Euler-Mascheroni constant
(1.7.308)
which leads to the ability to define alternate forms of Wilson's theorem using functions deeply rooted in analysis. We demonstrate this by taking Wilson's theorem and expressing it in terms of the gamma function and
(1.7.309)
From the identity for from Eq. 1.7.308, we can express as
(1.7.310)
to arrive at a form involving the gamma function, the harmonic numbers, the Euler-Mascheroni constant, and the digamma function
(1.7.311)
A generating set of a group defines a subset of elements , which under the group operation, typically multiplication or addition, can express every element of . For the subset , the subgroup of elements generated by is defined as . In the case of , is said to generate , where the elements are defined as group generators. If is equal to the empty set ∅, it implies that is the identity , otherwise known as the trivial group .
If there is a lone element , the subgroup is generally defined as , and implies that is a cyclic subgroup generated by the powers of . By definition, cyclic groups are abelian, which signifies the group operation is commutative. The order of the cyclic group can then be established as , which assumes a finite cyclic group. So, the order of finite is defined as the smallest possible integer that obeys
(1.7.312)
and every order finite cyclic group is isomorphic to the additive group If no integer establishes , the cyclic group is infinite in order, and isomorphic to the additive integer group , having as its generator by way of addition. We compare and contrast the finite and infinite order cyclic groups, where finite groups for the order example, add by congruence modulo
(1.7.313)
While the infinite order cyclic groups are the same up to , but since modular arithmetic is not employed, they continue as the set of infinite positive integers
(1.7.314)
Being isomorphic to the integers, an infinite order cyclic group has elements that are both positively and negatively orientated in relationship to the identity , shown using the group algebra notation
(1.7.315)
A finite cyclic group of order may be represented using the similar algebra notation above,
(1.7.316)
and an element in the finite group will equal another element , when the following holds for
(1.7.317)
Finite cyclic groups may also be expressed as roots of unity, where, for example the roots of unity are
(1.7.318)
which is isomorphic to the group algebra of order
(1.7.319)
Given that the group's order is prime, , the group is defined as simple, meaning it cannot be divided into subgroups. Prime-order finite cyclic groups are distinct, given that any non-identity element represents a generator of the group
(1.7.320)
The rotational symmetries of a polygon form a cyclic group, and if the set of symmetry rotations of the said polygon equals , it is isomorphic to .
In group theory, the dihedral groups represent the symmetries of the regular polygons, which include the same rotations in the plane found in the finite cyclic groups but also include reflections. So, compared to the order from the cyclic groups, the dihedral group has elements in its set, which defines it as having order can be represented as the set
(1.7.321)
where is the subset of rotations and is the set of reflections across the lines of symmetry of the -gon. So, in the set, is the finite cyclic group of order .
Figure 1.7.30 – The set of symmetric rotations of the regular pentagon/-gon in the plane (left).
The reflectionspresented as occurring by way of an orthogonal dimension to the-plane (right),
where the line of symmetry for the reflection runs from(yellow segment).
In the figure above, we take the pentagon as a rigid body, having five rotational symmetries where vertices can rotate to any vertex orientation in the plane. As a rigid body, a reflection requires that the pentagon come out of the plane to reflect across an axis of symmetry of the pentagon. In the right image above, the dashed yellow circles on the sphere's surface represent the path the vertices take to accomplish the reflection. The chosen axis of symmetry for the reflection above is represented by the segment , where remains fixed, while the pairs of vertices swap positions.
Given that the harmonic numbers are intertwined with the gamma and the factorial function, where , it becomes more intuitive when we represent the natural numbers as regular polygons (i.e., -gons) circumscribed by the complex unit circle.
Definition (1.7.322) - For any natural number, the Geometric Numbersare finite cyclic groups, representing the regular-gon circumscribed by the complex unit circle. The elements ofare the set of vertices
where the first vertex is oriented at the identity position.represents theroots of unity, and both the order ofand the number of vertices of the-gon correlates with the natural number. The vertices oriented immediately counterclockwise and clockwise from the identity are always generators of,
Definition (1.7.323) - For any prime number, the Geometric Primesare defined as the simple finite cyclic groups representing the regular-gon circumscribed by the complex unit circle, as the set of vertices
where the first vertex is oriented at the identity position.represents theroots of unity, and both the order ofand the number of vertices of the-gon correlates with the prime number. As a simple group, all elementsare generators of, except the identity
On the complex unit circle, the following equivalences hold
(1.7.324)
which implies that is equivalent to the set
(1.7.325)
Each Geometric Number has a cyclic group representation , which can be represented by a square matrix using the two generators immediately clockwise and counterclockwise from the identity .
(1.7.326)
In the cyclic matrix group form, the guaranteed primary generators are related by the matrix transpose
(1.7.327)
and these primary generators will have eigenvalues equal to the -gon vertex coordinates on the complex unit circle
(1.7.328)
(1.7.329)
Considering the eigenvalue matrices from the eigendecomposition
(1.7.330)
these can be arranged in clockwise and counterclockwise progression along the diagonal
(1.7.331)
(1.7.332)
where each eigenvalue on the diagonal is a vertex of the -gon. We start with the example of a non-prime natural number and the Geometric Number is composed of the following set of vertex elements
(1.7.333)
which represents the vertices of the square/-gon seen in Figure 1.7.31. The generators in the set are and , evidenced by the following
(1.7.334)
(1.7.335)
In contrast, the non-primary generators are the elements and ,
(1.7.336)
(1.7.337)
where represent the prime number in the prime decomposition of , and is the identity element, whose self-products are itself
Figure 1.7.31 - The regular -gon/square representation of the non-prime natural number
A finite cyclic group of order can be expressed using the notation , where and are generators, and is the element in the group. Going left to right, we use the group example
(1.7.338)
in which and are the primary generators
(1.7.339)
We can define a vector to encapsulate the group elements as a whole
(1.7.340)
The -vector can form a product with any element in the group by left-multiplication, seen using the example
(1.7.341)
for which the primary generator results in vertex-specific rotations that are positive/counterclockwise ordered. This can be expressed using exponential functions as
(1.7.342)
which has an implicit modulo- operation in the changes seen for the rational portions of the exponents. To ensure a clear understanding, we use the other primary generator, , to evaluate its product with
(1.7.343)
finding the vertices have rotated in the negative/clockwise direction, evidenced by comparing the vector to the resulting one, row-by-row. It is important to be aware that a difference exists between the perceived direction of rotation if one is considering the square/-gon as a rigid body rotation, which would appear to rotate clockwise for the products, and counterclockwise for the products. Given its consistency with the complex plane interpretation of rotations, the vertex-specific interpretation is preferred. Since the natural number has the prime decomposition , is the corollary element to the prime .
(1.7.344)
which is seen to rotate each vertex by radians when expressed in the exponential function form
(1.7.345)
Continuing with the example, the positive primary generators are the following
(1.7.346)
which, when taken together as a product sum, reveal the Geometric Numbers' relationship with the harmonic series
(1.7.347)
The analog to evaluate if is evenly divisible by values of is by the following
(1.7.348)
which is presented in Table 1.7.3, showing that is a divisor of the group, which yields all the elements
Table 1.7.3. – The product table for
Attention should be directed to the fact that product yields an ordered sequence of elements when going from left to right in the row of the table. This ordered sequence is equivalent to the exponential function product with our vector
(1.7.349)
and represents the even divisibility of for the natural number . Intuitively, this is the case given that
(1.7.350)
which is a number rotating in the oppositive direction but is equal to the element
(1.7.351)
Figure 1.7.32 - The regular -gon/square representation of the prime number , which is the natural number
The example of the prime natural number represents a Geometric Number in the Geometric Primes. The group is composed of the following set of vertex elements
(1.7.352)
which represents the vertices of the regular -gon seen in Figure 1.7.32. Since , it is a simple group, meaning all of its generators are primary, except for the identity element
(1.7.353)
Any generator can form a product with the group vector
(1.7.354)
which acts to rotate each vertex of the -gon by the integer value for .
Wilson's theorem, we recall, states that all prime numbers obey the following
(1.7.355)
We can consider how the geometric primes relate to the theorem by setting a basic foundation pertaining to the evenness and oddness of products and quotients of the natural numbers.
Lemma (1.7.356) - Natural numbers obey the following even/odd rules as products
For evenly divisiblequotients,, where, the following holds for even,
and for even, and odd
For evenly divisible odd, where, we have
and there would exist no evenly divisible quotients formed by oddwith even.
Lemma (1.7.357) - The product ofvarious natural numberswill be even if and only if there exist at least one even-valuein the product
This is true, given the distributivity of the product operation, we can group the odd and eveninto the following product
For, using the even/odd product notation,
and for, we find
The factorial function is equal to the product of the consecutive natural numbers from to
(1.7.358)
which by the distributivity of the product operation also separates into the product of odd and even sets of natural numbers
(1.7.359)
Lemma (1.7.360) – For a natural number, the factorial functionis evenly divisible byand even
The composite numberis the product of at least two primes raised to various powers, and thereforeis an evenly divisible quotient. The first even composite numberis, which foris the following
andhas the prime number composition. Theprimes cancel in the rational, but the even-valuedremains. Therefore, the even set of remaining, which assures the result is even
The same holds for odd composite natural numbers, the first of which is, having the quotient form
whereevenly dividesand actually adds another even natural number to
For increasing, more even natural numbers populate the factorial, and the even natural number setis always non-empty,.
Theorem (1.7.361) – For all prime numbers, the functionis not evenly divisible, taking the rational form
Proof – Given thatis prime and greater in value than any other prime in the decomposition of, it implies there are no even divisors of. Therefore,is not evenly divisible, and given that, the function takes the resultant form
By the previous lemmas and theorem, we can now prove the analogy to Wilson's theorem for the Geometric Primes.
Theorem (1.7.362) – The Geometric Primesobey the following expression for all prime numbers
and for all, they obey the equivalence
Proof. – The representation of Euler's formula
contains the cosine and sine functions, which are by default congruent modulo. Setting, the exponential functionbecomes
The exponential variable can be rewritten as
where the following holds
and by applying the modulocongruency, thefunction can be written as
With the exceptions of, by the previous lemmas, the factorial functionwill always be even-valued. For, the composite natural numbers,will have a prime number composition, which cancels theterm, implying the following holds for
whereis the composition of primes, and by the previous lemma, the term involving the factorial quotientwill always remain even. Therefore, the exponent congruent moduloalways equals
given thatevenly divides. By the previous theoremthe function
is not evenly divisible. By the lemma,is even, and therefore,is evenly divisible by, having a quotientwithout a remainder. Given that
this represents the irreducible product term in the congruent modulooperation, which taken together with, implies that
Plugging these variables back into the exponential function, it holds forthat
which represents the first primary generatorsitting clockwise from the identity element on the complex unit circle.
For, we have proved that, implying the exponential formequals
Definition (1.7.363) – The natural non-prime Geometric Numbersobey the following expression
except for, where the following holds
Figure 1.7.33 – A plot of the function over the natural numbers for shows the composite numbers equal to 1, noting as the only prime result on the real-axis , and is the only negative composite number . The prime numbers are the zeros along the natural number axis , except for.
In the complex representation, the locations of the geometric primes can be expressed as
(1.7.364)
where each prime coordinate coordinate is plotted in parametric form over the reals in Figure 1.7.34, using the parametric expression
(1.7.365)
Figure 1.7.34 – The primes are located on the curve (red), intersecting with the curve (blue).
In Figure 1.7.34, the waveform is plotted in conjunction with the coinciding parametric factorial expression over the reals
(1.7.366)
where all the prime numbers will be located on the curve at the points of intersection with the waveform.
The congruent modulo expression from Wilson's theorem can be applied to the cyclic matrix representation of our primary generator
(1.7.367)
and given that
(1.7.368)
we see the matrix form is consistent with the expression for
(1.7.369)
Figure 1.7.35 – The complex parametric plots for (red) and (blue) rising along .
Figure 1.7.35 represents the parametric functions for (red) and (blue) plotted in the complex plane rising along
(1.7.370)
(1.7.371)
The first five prime numbers represent the intersection of the two parametric curves (blue/red coordinates), and the non-prime natural numbers do not represent intersections on the two curves (light/dark green coordinates).
Edward Waring, "Meditationes Algebraicae" (Cambridge, England: 1770), p. 218
Joseph Louis Lagrange, "Demonstration d'un théorème nouveau concernant les nombres premiers", Nouveaux Mémoires de l'Académie Royale des Sciences et Belles-Lettres (Berlin), vol. 2, pages 125–137 (1771).