scieee AI-readable full text Open interactive document viewer

On Quotients of a More General Theorem of Wilson

Morozov, Ivan V.

Full text

#A93 INTEGERS 25 (2025) ON QUOTIENTS OF A MORE GENERAL THEOREM OF WILSON Ivan V. Morozov The City College of New York, New York, New York [email protected] Received: 11/27/24, Accepted: 7/1/25, Published: 11/5/25 Abstract The basis of this work is a simple, extended corollary of Wilson’s theorem. This corollary generates many more quotients than those already generated by Wilson’s theorem, and it is of interest to derive how they relate to each other and build on the established properties of the original quotients. The main results are expressions for sums of these quotients, modular congruences that extend the results of Lehmer, and generating functions. 1. Introduction In order to efficiently describe the results presented in this work, we will define P1:= P∪ {1}, where Pis the set of all primes, as the set of positive non-composite numbers. With this said, Wilson’s theorem is a primality test by which W(n) = 1+(n−1)! n is an integer if and only if n≥1 is a positive non-composite. Also, {W(p) : p∈P1} is the set of Wilson quotients. We may, in fact, generalize this notion by observing that (n−1)! = (n−k−1)! Qk m=1(n−m) implies W(n) = 1+(n−k−1)! Qk m=1(n−m) n. The Qk m=1(n−m) term is a falling factorial, so we can implement an expansion of this product, the coefficients of which are the Stirling numbers of the first kind s(a, b), defined by (x)n=Qn−1 k=0 (x−k) = Pn k=0 s(n, k)xk. Thus, Qk m=1(n−m) = 1 n(n)k+1 and W(n) = 1+(n−k−1)! 1 n(n)k+1 n=1+(n−k−1)! Pk+1 i=0 s(k+ 1, i)ni−1 n, DOI: 10.5281/zenodo.17535209 INTEGERS: 25 (2025) 2 and since s(k+ 1,0) = 0 for k≥0, we have W(n) = 1+(n−k−1)! Pk+1 i=0 s(k+ 1, i + 1)ni n.(1) Observing that Pk+1 i=1 s(k+ 1, i + 1)ni≡0 (mod n) and s(k+ 1,1) = (−1)kk!, Wilson’s criterion extends to a corollary with an additional parameter. Corollary 1. Given nonnegative integers n≥1and k < n, (−1)kk!(n−k−1)! ≡ −1 (mod n) if and only if nis non-composite. Incidentally, Wilson’s theorem is a corollary of its own corollary when k= 0, and we will thus refer to the more general Wilson-like quotients as Mk(n) = 1+(−1)kk!(n−k−1)! n, where, by Corollary 1, Mk(n) is an integer if and only if n∈P1. The values of some of these quotients are listed in Table 3 at the end of the paper. Note that M0(n) = W(n). These quotients yield nonpositive results for odd k, and therefore we can get rid of the signs by defining M+ k(n) = |Mk(n)|= (−1)kMk(n) = (−1)k+k!(n−k−1)! n.(2) We will broadly refer to the functions Mk(n) and M+ k(n) as M-numbers. 2. Sums of Mk(n) and M+ k(n) One area of investigation is the study of finite sums of values of the functions Mk and M+ k, which we will broadly refer to as Z-numbers. Considering the sums Z(n) = n−1 X k=0 Mk(n), Z+(n) = n−1 X k=0 M+ k(n),(3) we can derive two theorems concerning them. Theorem 1. The function Z(n)is an integer for all n∈N. Proof. If n∈P1, then Mk(n)∈Zimplies Z(n)∈Zby Corollary 1. Otherwise, consider the term (−1)kk!(n−k−1)!, where nis composite. If it is additionally not equal to 4, we see that k!(n−k−1)! = k!(n−(k+ 1))(n−(k+ 2)) . . . (n−(n−1)) , INTEGERS: 25 (2025) 3 and hence, k!(n−k−1)! ≡(−1)n−k−1k!(k+1)(k+2) . . . (n−1) ≡(−1)n−k−1(n−1)! (mod n). Moreover, since n= 4, it follows that (n−1)! ≡0 (mod n), implying (−1)kk!(n−k−1)! ≡0 (mod n). It follows that n−1 X k=0 1+(−1)kk!(n−k−1)! ≡ n−1 X k=0 1≡0 (mod n), which, with the fact that Z(4) = 1, shows that Z(n)∈Zfor all n∈N. Theorem 2. The function Z+(n)is a natural number if and only if nis even or non-composite. Proof. If n∈P1, then M+ k(n)∈Zimplies Z+(n)∈Zby Corollary 1. Otherwise, consider the term (−1)kk!(n−k−1)!, where nis composite. If it is additionally not equal to 4, the preceeding proof showed that k!(n−k−1)! ≡0 (mod n). This implies that n−1 X k=0 (−1)k+k!(n−k−1)! ≡ n−1 X k=0 (−1)k≡1+(−1)n−1 2(mod n), which, with the fact that Z+(4) = 4, shows that Z+(n)∈Zif and only if nis even or non-composite. In this case, we actually have that Z+(n)∈Nsince Z+(n)>0. Some values of Z(n) and Z+(n) are listed in Tables 1 and 2 in the last section. 2.1. Formula for Z(n) Furthermore, we can derive a closed formula for Z(n). Let S=Pn−1 k=0 (−1)kk!(n− k−1)!. Then Z(n) = n−1 X k=0 1 n!+S n= 1 + S n. Now, dividing Sby (n−1)! yields S (n−1)! = n−1 X k=0 (−1)kk!(n−k−1)! (n−1)! = n−1 X k=0 (−1)k n−1 k. INTEGERS: 25 (2025) 4 An identity for the same sum [1] tells us that n X k=0 (−1)k n k=(1 + (−1)n) (n+ 1) n+ 2 , n ∈N0, so S (n−1)! =1+(−1)n−1n n+ 1 , and it follows algebraically that Z(n) = 1 + 1+(−1)n−1(n−1)! n+ 1 . We observe that Z(2n) = 1 and Z(2n−1) = 1 + (2n−2)! n. The former case is obviously a natural number. In the latter case, n= 1 is a trivial case, and since 2n−2≥nfor n≥2, we have that n|(2n−2)! for all n∈N. This is a proof of a stronger version of Theorem 1: Z(n)∈Nfor all n∈N. 2.2. Formula for Z+(n) We can also derive a formula for Z+(n) by initially setting S=Pn−1 k=0 k!(n−k−1)!, which produces Z+(n) = n−1 X k=0 (−1)k n!+S n=1+(−1)n−1 2n+S n. Dividing Sby (n−1)! produces S (n−1)! = n−1 X k=0 k!(n−k−1)! (n−1)! = n−1 X k=0 1 n−1 k. An identity from [1] tells us that n X k=0 1 n k=n+ 1 2n n X r=0 2r r+ 1 , n ∈N0, so S (n−1)! =n 2n−1 n−1 X r=0 2r r+ 1 , and it follows algebraically that Z+(n) = 1+(−1)n−1 2n+(n−1)! 2n n X r=1 2r r. INTEGERS: 25 (2025) 5 To deal with the remaining partial sum, we make use of the Lerch transcendent, a special function denoted by Φ and defined by Φ(z, s, a) = P∞ n=0 zn (n+a)s. It has the property that Φ(z, s, a) = znΦ(z, s, n +a) + n−1 X r=0 zr (r+a)s for ℜ(a),ℜ(s)>0, n∈N, and z∈C[2]. We employ this equivalence by setting a= 1, s= 1, and z= 2, which yields Φ(2,1,1) = 2nΦ(2,1, n + 1) + n−1 X r=0 2r r+ 1 . We also define the polylogarithm to be the function Lis(z), commonly given by the Dirichlet series Lis(z) = P∞ n=1 zn ns. Because Φ(z, s, 1) = 1 zLis(z) [3], we have Li1(2) = −iπ = 2n+1Φ(2,1, n + 1) + n X r=1 2r r, and hence, n X r=1 2r r=−iπ −2n+1Φ(2,1, n + 1) . By substitution we derive that Z+(n) = 1+(−1)n−1 2n−(n−1)! 2Φ(2,1, n + 1) + 2−niπ.(4) 3. Modular Congruences 3.1. Congruences of Mk(p) and M+ k(p) Bernoulli numbers Bkare signed rational numbers that are ubiquitous in number theory and analysis. We can define them precisely using the exponential generating function x ex−1=P∞ k=0 Bkxk k!, in which they arise. When pis prime, it is known that M0(p)≡W(p)≡B2(p−1) −Bp−1(mod p), which is obtained from the congruence relation p−1 + ptW (p)≡pBt(p−1) (mod p2) by subtraction after substituting t= 1 and t= 2 [4]. Recalling Equation (1), it is clear that (p−k−1)! Pk+1 i=2 s(k+ 1, i + 1)pi p≡0 (mod p), INTEGERS: 25 (2025) 6 so M0(p)≡1+(p−k−1)!(s(k+ 1,1) + ps(k+ 1,2)) p ≡Mk(p) + s(k+ 1,2)(p−k−1)! (mod p). The Stirling numbers of the first kind s(k+ 1,2) can be expressed with harmonic numbers as s(k+ 1,2) = (−1)k+1k!Hk, which yields M0(p)≡Mk(p)+(−1)k+1k!Hk(p−k−1)! ≡Mk(p) + Hk(mod p) (5) by Corollary 1. By subtraction, Mk(p)≡B2(p−1) −Bp−1−Hk(mod p).(6) From Equation (5), we construct a congruence analogous to Lehmer’s: p−1 + ptMk(p)≡pBt(p−1) −ptHk(mod p2). For the unsigned M-numbers, utilizing Equation (2) produces the congruences M+ k(p)≡(−1)kMk(p)≡(−1)kB2(p−1) −Bp−1−Hk(mod p),(7) (−1)k(p−1) + ptM+ k(p)≡(−1)kpBt(p−1) −ptHk(mod p2). 3.2. Congruences of Z(n) and Z+(n) Theorem 3. If nis composite, then Z(n)≡1 (mod n). If nis non-composite, then Z(n)≡ −1 (mod n). Proof. Recalling the formulae Z(2n) = 1 and Z(2n−1) = 1 + (2n−2)! nfor n∈N, observe that if n= 2k−1 is composite, then we can apply the same argument as in the proof of Theorem 1 to show that 2k−1|(2k−2)!. Thus, 2k−1|(2k−2)! k since k∤2k−1, implying Z(n)≡1 (mod n) for n∈ P1. However, if n= 2k−1 is non-composite, then k(Z(2k−1) + 1) = 2k+ (2k−2)! ≡1−1≡0 (mod 2k−1) by Wilson’s theorem. Thus, since k∤2k−1, it follows that Z(2k−1) + 1 ≡0 (mod 2k−1), implying Z(n)≡ −1 (mod n) for n∈P1, proving our theorem. From Equation (6), we have that p−1 X k=1 Hk≡ p−1 X k=1 (M0(p)−Mk(p)) ≡(p−1)M0(p)−Z(p) + M0(p) ≡pM0(p)−Z(p)≡2+(p−1)! (mod p). INTEGERS: 25 (2025) 7 Since 1 + (p−1)! ≡0 (mod p) by Wilson’s theorem, p−1 X k=1 Hk≡1 (mod p) for pprime. We can also consider the recursive nature of harmonic numbers given by Hn= 1+ 1 nPn−1 k=1 Hk, which by recursion yields Hn+1 =1 n+1 +Hn. Substituting this into the previous sum implies the following congruence for pprime: Hp≡1 + 1 p(mod p). Theorem 4. We have the congruence Z(2n−1) ≡0 (mod n)if and only if nis non-composite. Proof. Since Z(2n−1) = 1 + (2n−2)! n= 1 + (2n−2)(2n−3) · · · (n+ 1)(n−1)!, if n∈P1, then Z(2n−1) ≡1−(2n−2)! n!(mod n) by Wilson’s theorem. However, (2n−2)! n!≡(n−2)! (mod n), so Z(2n−1) ≡1−(n−2)! (mod n), and thus Z(2n−1) ≡0 (mod n) by Corollary 1. For the other direction, observe that (2n−2)! n≡(n−1)!(n−2)! ≡ −1 (mod n) implies that nis non-composite by Corollary 1. This is because if nwere otherwise composite, then (n−1)!(n−2)! ≡0 (mod n). Theorem 5. For even n= 2, the function Z+(n)obeys two congruences: Z+(2n)≡0 (mod 2n), n ∈ P1\ {2},(8) Z+(2n)≡n+ 1 (mod 2n), n ∈P\ {2}.(9) Proof. Recalling Equation (3), Z+(2n) = 2n−1 X k=0 (−1)k+k!(2n−k−1)! 2n=1 n n−1 X k=0 k!(2n−k−1)! due to the even number of terms and consequential symmetry of the summands. Evidently, since n∈ P1\ {2}and if n= 2 and n= 4, we have n2|(2n−k−1)! for all 0 ≤k≤n−1. Additionally, 2 |k! for 2 ≤k≤n−1 and (2n−1)! + (2n−2)! 2n2=(2n−2)! n∈N for n∈N. With the cases Z+(4) = 4 and Z+(8) = 1536, this proves Equation (8). INTEGERS: 25 (2025) 8 For the second congruence, again consider Z+(2n) = 1 nPn−1 k=0 k!(2n−k−1)!. Let us select distinct 0 ≤k1< k2≤n−1 and take the sum of two terms: k1!(2n−k1−1)! + k2!(2n−k2−1)! = k1!(2n−k2−1)! (2n−k1−1)! (2n−k2−1)! +k2! k1!. Setting k2=k1+ 1, this becomes k1!(2n−k1−2)!(2n). Clearly, 2n2|k1!(2n− k1−2)!(2n). Because nis an odd prime, the sum for Z+(2n) will have an odd number of terms, allowing us to pair every other term with its succeeding term as described, leaving only the last one, (n−1)!n!, unpaired. Therefore, nZ+(2n)≡ −n! (mod 2n2) by Wilson’s theorem, and since Wilson quotients for odd primes are always odd, 2n2|n(1 + (n−1)! + n). A simple algebraic manipulation allows us to see that −n!≡n2+n(mod 2n2), which proves Equation (9). Theorem 6. We have the congruence Z+(p)≡B2(p−1) −Bp−1−1 2Hp−1 2(mod p), where pis an odd prime. Proof. If pis prime, we invoke Equation (7) to observe that Z+(p)≡ p−1 X k=0 (−1)kB2(p−1) −Bp−1−Hk ≡B2(p−1) −Bp−1− p−1 X k=1 (−1)kHk(mod p). Observe that p−1 X k=1 (−1)kHk=−1 + 1 + 1 2−1 + 1 2+1 3+. . . +1 + . . . +1 p−1 =1 2 p−1 2 X n=1 1 n=1 2Hp−1 2 when pis an odd prime, so we get our desired congruence. If p= 2, then Z+(2) = 1 ≡B2−B1+ 1 (mod 2). It is worth noting that this congruence bears a close resemblance to the one of Mp−1 2(p). Thus, by combining Equation (6) with the above congruence, we obtain the interesting relation Z+(p)≡1 2M0(p) + Mp−1 2(p)(mod p). 4. Generating Functions In this section we derive the exponential generating functions of our M-numbers and Z-numbers. INTEGERS: 25 (2025) 9 4.1. M-numbers Considering the sequences of quotients Mk(n) for n∈N, its exponential generating function1for |x| ≤ R, where R > 0 is the radius of convergence, is derived as follows: EG(Mk(n); x) = ∞ X n=0 Mk(n+k+ 1)xn n!= ∞ X n=0 1+(−1)kk!n! n+k+ 1 xn n!. Note that the first term appearing in the summand is Mk(k+ 1), as Mk(n) is undefined for n≤k. Also observe that ∞ X n=0 1+(−1)kk!n! n+k+ 1 xn n!< ∞ X n=0 1+(−1)kk!xn, which has a radius of convergence R= 1. Therefore, EG(Mk(n); x) has a positive radius of convergence of at least 1. This allows the summation to be split as EG(Mk(n); x) = ∞ X n=0 xn n!(n+k+ 1) + (−1)kk! ∞ X n=0 xn n+k+ 1 , where, from the second summation term above, the radius of convergence, R, equals 1. As dictated by the definitions of the lower incomplete gamma function γ(a, x) = xaP∞ n=0 (−x)n n!(n+a)and the Lerch transcendent Φ(x, s, a) = P∞ n=0 xn (n+a)s[2], we derive the exponential generating function by setting a=k+ 1 and s= 1, EG(Mk(n); x)=(−1)kk!Φ(x, 1, k + 1) −γ(k+ 1,−x) xk+1 . For the exponential generating function of the signless M+ k(p), it is not difficult to see from Equation (2) that EG(M+ k(n); x)=(−1)kEG(Mk(n); x) = k!Φ(x, 1, k + 1) −γ(k+ 1,−x) xk+1 , since the summations are independent of k. 4.2. Z-numbers We can also derive the exponential generating function of Z(n) for n∈Nand |x| ≤ R, where R > 0 is the radius of convergence, EG(Z(n); x) = ∞ X n=0 Z(n+ 1)xn n!= ∞ X n=0 1 + (1 + (−1)n)n! n+ 2 xn n!. 1Note that ordinary generating functions are of little utility in this instance, as their radius of convergence is zero.