<<

Wilson’s theorem modulo p2 derived from Faulhaber polynomials

Claire Levaillant December 17, 2019

Abstract. First, we present a new proof of Glaisher’s formula dating from 1900 and concerning Wilson’s theorem modulo p2. Our proof uses p-adic numbers and Faulhaber’s formula for the sums of powers (17th century), as well as more recent results on Faulhaber’s coefficients obtained by Gessel and Viennot. Second, by using our method, we find a simpler proof than Sun’s proof regarding a formula for (p − 1)! modulo p3, and one that can be generalized to higher powers of p. Third, we can derive from our method a way to compute the Stirling numbers  p  modulo p3, thus improving Glaisher and Sun’s own results from 120 s years ago and 20 years ago respectively. Last, our method allows to find new congruences on convolutions of divided Bernoulli numbers and convolutions of divided Bernoulli numbers with Bernoulli numbers.

1 Introduction

The paper arose from an analogy between two polynomials, namely

p−1 p−1 f(X) = X − 1 ∈ Z/p Z[X] and g(X) = X + (p − 1)! ∈ Zp[X],

where p is a , Z/p Z denotes the field with p elements and Zp denotes the of p-adic , see [23].

The analogy is concerned with the way each polynomial factors and with the congruences properties that can be derived in each case from the relations be- arXiv:1912.06652v1 [math.CO] 13 Dec 2019 tween the coefficients and the roots.

Below, we describe the analogy in details.

• First we look at the factorization of f(X) and the properties modulo p that can be derived from it. By Fermat’s little theorem we have,

p−1 k = 1 in Z/p Z

1 for all integers k with 1 ≤ k ≤ p − 1. It provides the p − 1 roots of f, and so f factors in Z/p Z[X] as f(X) = (X − 1)(X − 2) ... (X − (p − 1))

Let us introduce some notations concerning the divided factorial which shall be useful throughout the paper.

Notation 1. Let r be an with 1 ≤ r ≤ p − 2 and let i1, i2, . . . , ir be r integers with 1 ≤ ik ≤ p − 1 for all k with 1 ≤ k ≤ r.

We define the divided factorial (p − 1)!i1,..., ir as

(p − 1)! i1,..., ir (p − 1)! := Qr k=1 ik

From looking at the constant coefficient of f in both factored and expanded forms, we retrieve Wilson’s theorem which reads

(p − 1)! = −1 mod p

This constitutes one of many proofs for Wilson’s theorem. By looking at the other coefficients in both factored and expanded forms, we derive more relations, namely,

p−1 X (p − 1)!k = 0 mod p (Coefficient in X) k=1 X (p − 1)!i,j = 0 mod p (Coefficient in X2) 1≤i

1≤i1

1≤i1

The numbers to the left hand side are also the respective unsigned coeffi- cients of x2, x3, . . . , xr+1, . . . , xp−1 in the falling factorial

x(x − 1)(x − 2) ... (x − (p − 1)), that is the unsigned Stirling numbers of the first kind.

 p   p   p   p  , ,..., ,..., 2 3 r + 1 p − 1

2 We summarize the preceding equalities by

 p  ∀2 ≤ k ≤ p − 1, p | k

These numbers were introduced by James Stirling in the 18th century. The bracket notation gets promoted by Donald Knuth by analogy with binomial coefficients. Namely, we have the well-known divisibility relations

 p  ∀1 ≤ k ≤ p − 1, p | , k

a straightforward consequence of the definition of the binomial coefficients and of the Gauss lemma. Note that another equivalent definition for the unsigned Stirling numbers  n  of the first kind is the following: counts the number of permutations s of n elements that decompose into a product of s disjoint cycles, see [37] for a quantum combinatorial proof. While there exist lots of proofs for Wilson’s theorem, little is advertised about Wilson’s theorem modulo p2 or higher powers. It is even said at the end of 2 [25]: ”There is no explicit formula for (p − 1)! mod p , ie the integer n1 in 2 (p − 1)! ≡ −1 + n1p mod p is no evident function of p”. In [26], Wilson’s theorem modulo p2 is only stated as  2 p−1 2p−2 p − 1 2 (p − 1)! ≡ (−1) 2 2 ! (mod p ) 2 However, British mathematician J.W.L. Glaisher, son of meteorologist and pi- oneer both of weather forecasting and of photography James Glaisher who in particular held the world record for the highest altitude reached in a balloon, found a formula for (p − 1)! mod p2 in 1900 [22] that uses Bernoulli numbers. His method is elegant, smart and straightforward, but does not generalize to higher powers of p. A hundred years later, in 2000, Z-H Sun provides a different perspective, see [49]. His method even allows him to compute (p − 1)! mod p3, thus generalizing Glaisher’s result whose work had only led to a formula for (p−1)! mod p2. Sun’s result modulo p3 is expressed in terms of divided Bernoulli numbers. Sun’s ma- chinery is heavy but really beautiful and well exposed. First, he determines the 3 generalized harmonic numbers Hp−1,k modulo p . For that, he uses a battery of tools, namely: Euler’s theorem ; Bernoulli’s formula for the sums of powers modulo p3 together with von Staudt–Clausen theorem [53][13] that determines the fractional part of Bernoulli numbers ; K¨ummer’scongruences from 1851 involving Bernoulli numbers [36] and their generalizations modulo p2 by Sun himself [49] in the case when k ≤ p − 3, and an unpublished result of [50] giving 2 3 formulas for p Bk(p−1) modulo p and p respectively for dealing with k = p − 2 and k = p − 1 respectively. Second, he uses Newton’s formulas together with

3 Bernoulli’s formula modulo p2 in order to derive the Stirling numbers modulo p2. From there he obtains in particular a congruence for (p−1)! mod p3 that was first proven by Carlitz [9]. Likewise, by using Newton’s formulas with general- ized harmonic numbers and what Sun denotes as the conjugates of the Stirling numbers, he finds a formula for the conjugate Stirling numbers modulo p2 fol- lowed by a ”conjugate Carlitz congruence”. By combining the various identities, he then derives a pioneering formula for (p − 1)! mod p3 that is expressed only in terms of Bernoulli numbers. Yet another twenty years later, we offer a third perspective which does not make any use of the Newton formulas. The polynomial g with p-adic integer coeffi- cients introduced earlier happens to be an even more powerful tool than the polynomial f for better prime precision. It highlights once again the beauty and efficiency of p-adic numbers when investigating local properties at powers of primes.

Explicitly: • We now investigate the factorization of g(X). Let k be an integer with 1 ≤ k ≤ p − 1. First and foremost, we have

p−1 g(k) = k + (p − 1)! ∈ p Zp (1) by definition of g and by using Wilson’s theorem modulo p. Moreover, we have

0 p−2 g (k) = (p − 1) k 6∈ p Zp (2) as kp−2 = k−1 6= 0 in Z/p Z. By Hensel’s lemma [23], each nonzero k of Z/p Z lifts to a unique root xk of g such that k − xk ∈ p Zp Write xk = k + p tk with tk ∈ Zp Then g factors in Zp[X] as follows.

g(X) = (X − 1 − p t1) ... (X − (p − 1) − p tp−1)

2 We will see that by looking at the constant coefficient of g modulo p Zp, we obtain the next coefficient in the p-adic expansion of (p − 1)!, namely Theorem 1. p−1 X 2 (p − 1)! = −1 + p δ0(k) mod p , k=1

with δ0(k) defined for each 1 ≤ k ≤ p − 1 by

p−1 2 k = 1 + p δ0(k) mod p

4 Working out the sum of Theorem 1 modulo p2 by using the Faulhaber poly- nomials for the sums of powers and by using Faulhaber’s neat statement on the relationship between the two trailing coefficients of the polynomial for odd powers (work done in the 17th century, [17]), we obtain Wilson’s theorem one step further, namely modulo p2.

p(p−1) Theorem 2. Let p be an odd prime number. Set p = 2l+1 and a = 2 . Let c1(l) be the trailing coefficient in the Faulhaber polynomial

p−1 X p l+1 3 2 k = cl(l) a + ... + c2(l) a + c1(l) a (3) k=1 We have, (i) ∀ i ∈ { 1, . . . , l}, ci(l) ∈ Zp

1 2 (ii)(p − 1)! = 2 c1(l) − p mod p Corollary 1. (Glaisher 1900 [22])

2 (p − 1)! = p Bp−1 − p mod p

Corollary 1 can be derived directly from Theorem 1 by using the Bernoulli formula for the sum of powers smartly modulo p2 (like Sun did in [49], see the proof of his congruence (5.1)) together with von Staudt–Clausen theorem. For future reference, Bernoulli’s formula for the sums of powers reads:

p m X 1 X m + 1 km = B pm+1−j, m + 1 j j k=1 j=0 where we wrote the formula using Bernoulli numbers of the second type, 1 1 that is B1 = 2 instead of B1 = − 2 . As for von Staudt–Clausen’s theorem it gets described just a little further below. Corollary 1 can also be derived from Theorem 2. Indeed, the Faulhaber (l+1) coefficients of (3) are related to the coefficients Ak of [34], which can themselves be computed in terms of Bernoulli numbers by the formula first proven by Gessel and Viennot (see [18] and [34]). Edwards noticed (m) for fixed m that the coefficients Ak can be defined recursively, thus are obtainable by inverting a lower triangular matrix, see [16]. From there, Gessel and Viennot found a neat combinatorial interpretation for these coefficients. From their magnificent result, it can then be conveniently derived that some of the rational Faulhaber coefficients are p-adic integers (so are for instance the Faulhaber coefficients appearing in our Theorem 2), a useful data to have when working modulo powers of p. We will see and point out from now on that by using a result of Derby

5 [15], Glaisher’s formula provides an efficient way of computing (p − 1)! modulo p2. Finally, we note that Glaisher’s formula is consistent with the fact that

p Bp−1 = −1 mod p Zp (4) The latter fact is indeed a consequence of the previously mentioned von Staudt–Clausen theorem. This theorem dating from 1840 and indepen- dently proven by von Staudt and by Clausen asserts that the Bernoulli 1 numbers B2k sum to zero when added all the fractions q with q prime such that q − 1 divides 2k (recall that B2k+1 = 0 when k ≥ 1). Von Staudt, German mathematician, was a student of Gauss at G¨ottingen. Danish mathematician Clausen, while illiterate at age 12 and astronomer by background, was so talented that Gauss once said when Clausen was in life trouble:

”Es w¨are doch sehr zu beklagen, wenn sein wirklich ausgezeichnetes Talent f¨urabstracte Mathematik in der Verk¨ummerungso ganz zu Grunde ginge”

Amongst his many achievements, Clausen calculated in 1847 the first 247 decimals of π and in 1854 he decomposed the F6 into prime numbers, thus uncovering a prime number that was the biggest of all primes formerly known, namely 67280421310721. In mathematical words, von Staudt–Clausen’s theorem reads

X 1 B + = 0 mod 1 p−1 q q ∈ P q − 1|p − 1

Then, (multiplying by p),

X 1 p B + 1 + p = 0 mod p p−1 q Zp q ∈ P q 6= p q − 1|p − 1

Leading to the result stated in (4). Note that von Staudt–Clausen theorem specifically applied to the Bp−1 implies that the denom- inator of Bp−1 consists of p times other primes q such that q − 1|p − 1. The Agoh-Giuga conjecture, named after independent Japanese mathe- matician Takashi Agoh and Italian mathematician Giuseppe Giuga asserts that (4) holds only for prime numbers. Conjecture 1. (Agoh-Giuga [2][20]) n is prime if and only if n Bn−1 = −1 mod n

6 If Conjecture 1 holds, we must show that n Bn−1 6= −1 mod n for n composite in order to prove it. Given n composite, if n Bn−1 = 0 mod n, then we are done. Otherwise, from von Staudt-Clausen’s theorem, there must exist a prime p of n such that p − 1|n − 1. We say that n is ”Carmichael at p”. A is a composite square- free integer that is Carmichael at all its prime . Equivalently, a Carmichael number is a which is a Fermat pseudo-prime to every base [11], that is

n ∀a ∈ Z, a = a mod n In other words, the Carmichael numbers are the ”Fermat liars”. In partic- ular, a Carmichael number must be odd. The equivalence between both definitions was shown in 1899 by Korselt [35]. Giuga has linked the prop- erty of Conjecture 1 to Carmichael numbers and Giuga numbers. Definition 1. n is a if

X 1 Y 1 − ∈ p p N p ∈ P p ∈ P p|n p|n

n Equivalently, for each prime divisor p of n, we have p p − 1.

Giuga has proven the following result. Theorem. (Giuga 1950 [20]) A composite integer n satisfies nBn−1 = −1 mod n if and only if n is both a Giuga number and a Carmichael number.

In light of Giuga’s theorem, the Agoh-Giuga conjecture asserts the non- existence of composite numbers that are both Giuga numbers and Carmichael numbers. We will see in Section 3 of the paper that an odd composite Giuga number such that for any prime divisor p of n = p m, p does not divide Bm−1 would provide a counter-example to the Agoh-Giuga conjecture. Indeed, we have the following fact. Fact 1. Let n be an odd composite Giuga number. Let p ∈ P with p|n. Write n = pm, some integer m. Then,

p − 1|m − 1 or p Bm−1

In Section 3, we prove Fact 1 without reference to Adams’theorem [1][33].

Going now back to the polynomial g and looking at the respective co- efficients in X,X2,...,Xp−2 modulo p2 in both factored and expanded forms of g (just like we did with polynomial f modulo p only), we are able

7 to express the Stirling numbers one further, in terms of a difference between a sum of powers and a generalized harmonic number, like gathered in the following theorem.

Theorem 3. Let Sp−1,p−k denote the sum of the (p − k)-th powers of the first (p − 1) integers, that is

p−1 X p−k Sp−1,p−k := l l=1

Let Hp−1,k−1 denote the generalized harmonic number, using a standard notation. We have,  p  ∀ 2 ≤ k ≤ p − 1, = S − H mod p2 k p−1,p−k p−1,k−1

The proof of Theorem 3 uses a result by Bayat which is a generalization of Wolstenholme’s theorem. Wolstenholme’s theorem asserts that

2 Hp−1,1 = 0 mod p and Hp−1,2 = 0 mod p Back in 1862, Wolstenholme proved the result [55] (which is since then re- ferred to as Wolstenholme’s theorem) as an intermediate result for showing that 2p − 1 ≡ 1 mod p3 p − 1 The latter result is also commonly referred to as Wolstenholme’s theorem. A 150 years later, generalizing Wolstenholme’s theorem was still of interest to mathematicians. In 1997, Bayat generalized the part of Wolstenholme’s theorem related to the generalized harmonic numbers. He showed the following fact. Result 1. (Bayat, 1997 [5]) Let m be a positive integer and let p be a prime number with p ≥ m + 3. Then,

p−1 ( X 1 0 mod p if m is even ≡ km 0 mod p2 if m is odd k=1

Note, and this becomes important in our discussion later on, in the proof of Theorem 3, we only need Bayat’s result modulo p. From Theorem 3 and using this time a more recent generalization of Wol- stenholme’s theorem by Sun, we then derive divisibility properties or con- gruences modulo p2 for the

 p   p   p  unsigned Stirling numbers of the first kind , ,..., . 2 3 p − 1

The results get summarized in the corollary below.

8 Corollary 2. Let n be an integer and p be a prime. We have (  p  0 mod p2 if 2n + 1 ≤ p − 4 = 2n + 2 p 2 − 2 mod p if 2n + 1 = p − 2

 p 2 Bp−2n−1 mod p if p > 2n + 1 and n ≥ 1  p   2n+1 = 1 mod p2 if p = 2n + 1 2n + 1  2 p Bp−1 − p mod p if n = 0

The result of Corollary 2 also appears in the original and subtle work of Glaisher from 1900. It is stated as follows using Glaisher’s notations. Result 2. (Glaisher, 1900 [22]) Denote by Ar the sum of products of r integers among the first (p − 1) integers. We have, A 1 1 = − mod p (5) p 2 A 2k+1 = 0 mod p (6) p A V 2k = − 2k mod p (7) p 2k

The link between Glaisher’s notations and our notations is  p  = A k p−k

As for the Bernoulli numbers, his V-notation corresponds to our B-notation. Contrary to what happens with our own method for finding Wilson’s the- orem modulo p2, the formulas providing the Stirling numbers modulo p2 must be used within Glaisher’s method in order to derive Wilson’s theo- rem modulo p2. Thus, our method for proving Wilson’s theorem modulo p2 appears somewhat more straightforward than Glaisher’s way since our way uses only p-adic numbers (cf Theorem 1) and the Bernoulli’s formula modulo p2 for the sums of powers. Finally, we note that the result of Corollary 2 also appears in Sun’s work, based on Newton’s formulas and based also on divisibility properties at prime p of the sums of powers. Still using Glaisher’s notations and writing simply Sk for Sp−1,k (thus lightening our own notation from Theorem 3), Newton’s formulas relate Ak and Sk for each k = 1, . . . , p − 1 by (cf [31])

k−1 (−1)k−1  X  A = S + (−1)r A S (8) k k k r k−r r=1

9 As we know, p divides Ar for all 1 ≤ r ≤ k−1 when k ≤ p−1. Moreover, it 2 is clear from Faulhaber’s formula that p (and even p ) divides S3,...,Sp−2 for the odd indices once we know that the Faulhaber coefficients that are involved are p-adic integers. And of course p divides S1 by a direct calculation. Dealing next with the even indices, from Faulhaber’s formula applied with even powers, namely

p−1 X p − 1 + 1 k2l = 2 2c (l)a + 3c (l)a2 + ··· + (l + 1)c (l)al (9) 2l + 1 1 2 l k=1 we can show by using the work of Gessel and Viennot previously evoked that the Faulhaber coefficients that are present in Formula (9) are all p−3 p-adic integers. Thus, for each integer l with 1 ≤ l ≤ 2 , we have 1 p c (l) S = 1 mod p2 (10) 2l 2 2l + 1

In particular, it follows that p divides S2l for such l’s. Gathering these divisibility facts, we may now assert that for each k = 1, . . . , p − 1, the sum in (8) is congruent to 0 modulo p2. And so Sun obtains

(−1)k−1 A = S mod p2 ∀ k = 1, . . . , p − 1 (11) k k k Combining our Theorem 3 and Sun’s result in (11), we can now relate the generalized harmonic numbers to the sums of powers modulo p2 in the following way. Corollary 3.

 (−1)k  H = 1 + S mod p2 ∀ k = 1, . . . , p − 2 (12) p−1,p−k−1 k k

Setting k = 1, this shows in particular that

2 Hp−1,p−2 = 0 mod p (13)

2 More generally, since we have seen that p divides S3,...,Sp−2, we also have Corollary 4.

2 Hp−1,k = 0 mod p ∀k = 1, 3, . . . , p − 4, p − 2 with k odd (14)

The latter result to the exception of (13) can be found in [26] on page 103 with a proof unrelated to ours. The case k = 1 is usually referred to as Wolstenholme’s theorem.

10 Here, we have thus recovered Bayat’s result for the modulus p2 case if we gather (10), (12) and (14). Note with (13) that our result is an improve- ment to Bayat’s result since Bayat does not deal with the generalized harmonic number Hp−1,p−2. More recently in 2011, Romeo Mestrovic proved in [39] that 2p − 1 ≡ 1 − 2p H + 4p2 A∗ (mod p7), (15) p − 1 p−1,1 2

∗ where A2 denotes the conjugate of A2 using Sun’s notations. See also [40] for more complements on the topic. James P. Jones has conjectured that the converse of Wolstenholme’s theorem holds and there is past and ongoing research on the matter, see for instance in chronological order [38], [27], [28]. Closing this digression and going back to congruence (10), it rewrites in terms of Bernoulli numbers as

2 S2l = p B2l mod p see forthcoming § 2. Using this rewriting and the fact that Bj = 0 for odd j > 1, we derive further from (12) the general formula Corollary 5.  (−1)k  H = 1 + p B mod p2 ∀ k = 1, . . . , p − 2 (16) p−1,p−k−1 k k

Note the formula still holds for k = 1 though B1 6= 0.

Recall that when k ≤ p − 2, the denominator of Bk is not divisible by p since p − 1 does not divide k. Then, modulo p2, the right hand side of Equality (16) is precisely p − k − 1 p B , p − k k which is nothing else than the formula provided in Corollary 5.1 of Sun in [49]. This is a result in Sun, which though generalizable to p3, had required a fair amount of work. However, we do not reveal any congruence modulo 2 p for Hp−1,p−1 by our method, whereas Sun does deal with that case successfully. And like three mathematicians working in mirrors, Glaisher himself has worked out the generalized harmonic numbers to the modulus p2 and by times p3. He noticed from

p−1 p−2 (X − 1)(X − 2) ... (X − (p − 1)) = X − A1 X + ... − Ap−2X + Ap−1 (17) that 1 1 1 1, , ,..., 2 3 p − 1

11 are the roots of the polynomial

p−1 p−2 2 Ap−1X − Ap−2X + ··· + A2X − A1X + 1

From there, by using the Newton formulas and some divisibility properties of the Stirling numbers, namely     p  p| for every integer k with 2 ≤ k ≤ p − 1  k ,   p   p2| for every integer l with 1 ≤ l ≤ p−3  2l 2 he derives as part of his work, where his Hk is our Hp−1,k, Theorem 4. (Glaisher 1900 [22])

3 H1 ≡ −Ap−2 mod p 2 H2 ≡ 2Ap−3 mod p 3 H3 ≡ −3Ap−4 mod p . . . . 2 Hp−3 ≡ (p − 3)A2 mod p with the modulus being alternately p3 and p2, and

3 2 3 Hp−2 ≡ −p − (J − 2 ) p mod p 2 , Hp−1 ≡ −1 − (J − 1) p mod p with the value of J given by 1 J = −1 + V + , (18) p−1 p that is J is the second coefficient in the p-adic expansion of (p − 1)!. Namely, we have (p − 1)! = −1 + p J mod p2 (19)

Thus, our work for finding the Stirling numbers with (with respect to our notations) even indices modulo p2 can be deduced from Theorem 3 joint with Hardy and Wright’s congruence for generalized harmonic numbers with odd indices modulo p2 (or Bayat’s result modulo p2). Once this is achieved, finding the Stirling numbers with (with respect to our nota- tions) odd indices modulo p2 follows jointly from Theorem 3 together with Glaisher’s formulas for generalized harmonic numbers modulo p2, without reference to Sun’s later work. Glaisher actually derives explicit formulas for the generalized harmonic 3 numbers Hk modulo p for odd indices k because as part of his unlimited

12 and groundbreaking creativity, not only had he calculated the Stirling numbers modulo p2 in terms of Bernoulli numbers, but he had also found a way to lift this calculation to the next modulus p3 as far as the odd indices are concerned. He had shown in his earlier paper [21] the following fact. Result 3. (Glaisher, 1900 [21]) Let r be an odd integer with 3 ≤ r ≤ p−2. We have, p (p − r) A ≡ A mod p3 (20) r 2 r−1

When r is odd, r − 1 is even, whence by (7),

V A = −p r−1 mod p2 (21) r−1 r − 1

Gathering (20), (21) and the fact that Ar−1 = 0 mod p, it leads to Result 4. (Glaisher, 1900 [22]) Let r be an odd integer with 3 ≤ r ≤ p−2. We have, p2 r A ≡ V mod p3 (22) r 2(r − 1) r−1

If r is odd, so is p − 1 − r and if 1 ≤ r ≤ p − 4, then 3 ≤ p − 1 − r ≤ p − 2, thus by (22) and von Staudt-Clausen’s theorem, we have

p2(r + 1) A ≡ V mod p3 (23) p−1−r 2(r + 2) p−r−2

3 From Theorem 4, we have Hr = −r Ap−r−1 mod p for each odd r with 1 ≤ r ≤ p − 4. Hence,

p2 r(r + 1) H = − V mod p3 r 2(r + 2) p−r−2

We now state Glaisher’s result in our own notations, emphasizing the fact that Glaisher’s earlier result gets to the next power of p compared to Bayat’s more recent result above. Theorem 5. (Glaisher, 1900 [22]) Let m be a positive integer and let p be a prime with p ≥ m + 3. We have,

 m 2 p−1  m+1 p Bp−1−m mod p if m is even X 1  ≡ km k=1  m(m+1) 2 3 − 2(m+2) p Bp−2−m mod p if m is odd

Note, Sun in his proof of (11) and further derivation of the Stirling numbers modulo p2 does not refer to Faulhaber’s mathematics, but rather uses

13 his own congruence (5.1), see [49], that is derived from his smart use of Bernoulli’s formula. Be aware of the possible confusion here: what we just referred to as Congruence (5.1) of Sun [49] on one hand, and Corollary (5.1) of Sun [49] on the other hand are two different things, though both are congruences. From his global formula which reads

p2 p3 S = p B + m B + m(m − 1) B mod p3, (24) m m 2 m−1 6 m−2 Sun derives two things using the von Staudt-Clausen theorem. Namely the following two facts:

(i) p divides Sm as p does not divide the denominator of Bm for m even since p − 1 does not divide m when m ≤ p − 2.

2 (ii) Neither does p−1 divide m−1 nor m−2. Hence, Sm = p Bm mod p , independently from the of m.

Replacing in (11) yields: Result 5. (Sun 2000, [49])

(−1)k−1 A = p B mod p2 ∀ k = 1, . . . , p − 1 (25) k k k

Unfortunately, Sun’s ingenious method for computing the Stirling numbers modulo p2 does not generalize to the modulus p3. Indeed, when working modulo p3, the sum of (8) is no longer congruent to zero, but is rather a 2 convolution of Bernoulli numbers. We know that A2l+1 = 0 mod p when p−3 1 ≤ l ≤ 2 and p divides the Sj’s, hence only the terms in even r’s contribute to the sum modulo p3, as well as the term corresponding to r = 1 which is congruent modulo p3 to

p2 B 2 k−1 That is, the given sum is congruent modulo p3 to

b k−1 c p2 X2 B + A S (26) 2 k−1 2r k−2r r=1

k−1 2 Moreover, for odd k’s, we have when r 6= 2 that p divides Sk−2r as k − 2r is then odd and distinct from 1. Since p also divides A2r, the sum to the right hand side of (26) is then congruent modulo p3 to

p2 B k−1 , 2 k − 1

14 with only the upper index of the sum contributing. On the other hand, for even k’s, we have B A = −p 2r mod p2 and S = p B mod p2 2r 2r k−2r k−2r

3 p−1 Thus, modulo p , equality (8) reads for each k with 1 ≤ k ≤ 2 , p − 3 p2 2k + 1 (k ≤ ) A = B modp3 (27) 2 2k+1 2 2k 2k

1 bk− 2 c ! 1 X B2rB2k−2r (k 6= 1) A = − p B − p2 modp3(28) 2k 2k 2k 2r r=1 p(p − 1) and A = mod p3(29) 1 2

1 p 3 p2  (p ≥ 5) and A = − + mod p3 (30) 2 2 6 4 Formula (27) is Result 4 of Glaisher. Formula (28) is expressed in terms of a convolution involving Bernoulli numbers. Such convolutions have drawn the interest of various mathematicians. For instance, Japanese mathemati- cian Hiroo Miki comes up with an identity in 1978 which involves both a binomial convolution and an ordinary convolution of divided Bernoulli numbers, see [41]. Denoting B 1 1 B = n , and H = 1 + + ··· + n n n 2 n his identity reads:

n−2 n−2 X X n ∀n > 2, B B = B B + 2H B i n−i i i n−i n n i=2 i=2 Miki shows that both sides of the identity are congruent modulo p for suffi- ciently large p, which implies that they are equal. Another proof of Miki’s identity that uses p-adic analysis is given by Shiratani and Yokoyama [46]. Later on, Ira Gessel gives a much simpler proof of Miki’s identity based on two different expressions for Stirling numbers of the second kind, [19].

Unfortunately, we can’t resolve (28) by the same method as the one used by Sun in [49] in order to compute (p − 1)! modulo p3, when he uses the conjugates of the Aj’s and of the Sj’s. We are thus tempted to apply our own method to the next modulus p3 in order to deal with the Stirling numbers modulo p3. Going to the next modulus p3 happens to provide a much easier way than Sun’s for finding (p − 1)! modulo p3. It is time to introduce new notations since we work one p-power further.

15 Notation 2. We define δ1(k) as the third coefficient in the p-adic expan- sion of kp−1, namely,

p−1 2 3 k = 1 + p δ0(k) + p δ1(k) mod p (31)

We show the following result. Theorem 6. p−1 p−1   X 2 X (p − 1)! = −1 + p δ0(i) + p δ0(i) + δ1(i) i=1 i=1

" p−1 2 p−1 # p2  X  X − δ (i) + δ (i)2 mod p3 2 0 0 i=1 i=1 (32)

From there, it is easily seen that (p − 1)! modulo p3 can be written in terms of sums of powers and powers of sums of powers. Hence, in terms of Bernoulli numbers we get, where we put the terms in random order, Corollary 6. p 3 1 1 (p − 1)! = − p2 + (2p + 1)pB − p B − p2 B2 mod p3 (33) 2 2 p−1 2 2p−2 2 p−1 Sun’s formula from [49] reads p B p B 1p B 2 (p − 1)! = − p−1 + 2p−2 − p−1 mod p3 (34) p − 1 2(p − 1) 2 p − 1 Showing the equivalence between our formula and Sun’s formula requests a bit of effort. First and foremost, we note that (p − 1)−1 = −p2 − p − 1 mod p3 (35)

Then, by plugging (35) into (34) and using the fact that p B2p−2 = −1 mod p, namely a consequence of von Staudt-Clausen’s theorem, we get, p(p + 1) 2p + 1 (p − 1)! = −2p2 − B + p(p + 1) B − p2B2 mod p3 2 2p−2 p−1 2 p−1 (36) In order to conclude, we will need to use a consequence of a result of Sun. First we introduce some new notations.

Notation 3. Let x be a p-adic integer. We denote by (x)k the (k + 1)-th coefficient in the p-adic expansion of x, that is ∞ X j x = (x)j p j=0

16 Fact 2. By von Staudt–Clausen’s theorem, p B2p−2 and p Bp−1 are both p-adic integers of equal residue −1 modulo p. Their second coefficients of their respective p-adic expansions are related by   p B2(p−1) 1 = 2 p Bp−1 1 − 1 mod pZp (37)

Fact 2 appears to be a direct consequence of Sun’s unpublished result, Result 6. (Sun, [50]) Let k be a nonnegative integer. We have

2 p Bk(p−1) = −(k − 1)(p − 1) + k p Bp−1 mod p (38)

Result 6 of Sun is itself a special case of his Corollary 4.2 of [48], whose statement we recall here for interest and completeness. Result 7. (Sun, 1997 [48]) Let b and k be nonnegative integers. Define ( 1 if p − 1|b and B 6∈ δ(n, b, p) = n Zp 0 otherwise i.e. Bn ∈ Zp or p − 1 6 | b Then, we have

 k(p−1)+b−1 1 − p p Bk(p−1)+b

n−1 X k − 1 − rk  ≡ (−1)n−1−r 1 − pr(p−1)+b−1 p B n − 1 − r r r(p−1)+b r=0 k + (−1)n δ(n, b, p) pn−1 mod pn n Zp (39)

Unpublished Result 6 was proven prior to more recent Result 7 and is the latter result applied with b = 0, n = 2, p > 3 and k ≥ 1. Apply now Result 6 with k = 2. Obtain successively

2 p B2(p−1) = −(p − 1) + 2p Bp−1 mod p Zp, (40) and so

  2 − 1 + p p B2p−2 1 = −p − 1 + 2p p Bp−1 1 mod p Zp (41) Hence, after simplifying, obtain Fact 2. From there, concluding is just routine calculation. Our paper is structured as follows.

Section 2 is concerned with proving Theorems 1, 2, 3 and Corollaries 1, 2. Some of our proofs, more specifically for Theorem 2, use Faulhaber’s original

17 work from the 17th century, as it is the way we ourselves re-discovered Glaisher’s result from 1900 (cf Corollary 1) after we came up with the formula of Theorem 1 using p-adic numbers. Faulhaber didn’t get recognition for his pioneering work on sums of powers until much later when mathematicians and computer scientists like Edwards, Gessel, Viennot and Knuth got interested in this branch of mathematics again. They then gave Faulhaber much credit for his long and forgotten groundbreaking work that was done mostly by hand at the time when he lived. Some p-adic properties get derived in our paper from their work. The link of Faulhaber’s work with Bernoulli numbers is that there is a uniform formula for the sums of powers of integers in terms of Bernoulli numbers. This is something that Faulhaber ignored and he had distinguished between odd powers and even powers. The relationship between the coefficients from the old days and the coefficients from the newer age appears in [34] and is mostly due to [18]. It is said in [34] that the book by Faulhaber [17] is ”evidently extremely rare”, that ”no copies have ever been recorded to exist in America”. Edwards found Faulhaber’s book at Cambridge University Library, a volume that was once owned by Jacobi. The proof of Theorem 3 uses Bayat’s result (but only modulo p) which is a generalization of Wolstenholme’s theorem. A generalization one p power further by Sun for generalized harmonic numbers with even powers is needed in order to derive the result of Corollary 2. Alternatively, we can use Bayat’s result modulo p2 this time, together with Glaisher’s way of relating the generalized harmonic numbers to the Stirling numbers modulo p2. Section 3 of the paper presents discussions centered around the Agoh-Giuga conjecture and also provides some historical mathematical background. We give a proof for Fact 1. 3 In Section 4, we work modulo p Zp, still using the same polynomial g. First and foremost, we find a formula for (p − 1)! mod p3 that is only expressed in terms of sums of powers. Then, we are able to express (p − 1)! mod p3 in terms of Bernoulli numbers. Second, we show by using a congruence of Sun type that Sun’s formula and our formula are identical. Finally, Section 5 summarizes the additions of our work in comparison with Sun and Glaisher’s earlier works, evokes the forthcoming plans modulo p3 as announced in the abstract and discusses future research directions and in par- ticular in a quantum setting.

2 Wilson’s theorem modulo p2

In this part, we first work out the constant coefficient of the polynomial g modulo 2 p Zp using both the factored form and the expanded form of g. This will lead to the formula of Theorem 1. To that aim, we will first need to investigate the (0) p-adic residues of the tk’s which we will denote by tk . Using Hensel’s lifting algorithm, we show the following intermediate result. Lemma 1. Let k be an integer with 1 ≤ k ≤ p − 1. Then, we have:

(0) 2 p tk = k(1 + (p − 1)! + p δ0(k)) mod p (42)

18 Here, δ0(k) is defined as in the statement of Theorem 1, see § 1. We recall from the introduction that k ∈ Z/p Z lifts to a unique root k + ptk of g with tk a (0) p-adic integer. The second coefficient tk of the root expansion must satisfy to

(0) 2 g(k + p tk ) ∈ p Zp Hence, we must have

p−1 (0) p−2 2 k + p(p − 1)tk k + (p − 1)! ∈ p Zp (43) By definition, p−1 2 k = 1 + pδ0(k) mod p And so, p−2 −1 −1 2 k = k + pδ0(k) k mod p Replacing in (43) yields the equation of Lemma 1. Next, by looking at the constant coefficient of g modulo p2, we obtain

p−1 X (0) k 2 ptk (p − 1)! = 0 mod p (44) k=1 Then, using (42), it yields

p−1 X 2 (p − 1)! (1 + (p − 1)! + pδ0(k)) = 0 mod p (45) k=1 We derive

p−1  X  2 (p − 1)! (p − 1)(1 + (p − 1)!) + p δ0(k) = 0 mod p (46) k=1 By using Wilson’s theorem modulo p inside the bracket, we derive in turn,

p−1  X  2 (p − 1)! − 1 − (p − 1)! + p δ0(k) = 0 mod p (47) k=1 Finally, since p2 ∧ (p − 1)! = 1, we obtain the formula of Theorem 1. The latter formula can be written in terms of a sum of powers of integers as follows, p−1 X (p − 1)! = −p + kp−1 mod p2 (48) k=1 Assume point (i) of Theorem 2 holds. Then, using Faulhaber’s formula for sums of even powers as stated in Eq. (9) with 2l = p − 1, we get

p−1 X  1 p(p − 1) p2(p − 1)2  p kp−1 = p−1+ 2 c (l) +3 c (l) mod p3 (49) 2 1 2 2 4 k=1

19 Further, back in the 17th century, Faulhaber states that the two trailing coeffi- cients in Eq. (3) will have the form 4α a3 −α a2. Using this fact and simplifying, we get p−1 X 1 kp−1 = c (l) mod p2 (50) 2 1 k=1 Combining (48) and (50) leads to formula (ii) of Theorem 2. Let’s now prove (i). The starting point is Jacobi’s formula [30]. Jacobi was the first to prove Faulhaber’s formula in 1834. Using our former notation for a and letting u = 2a, Jacobi’s formula reads:

p−1 X 1  (l+1) (l+1) (l+1)  k2l+1 = A ul+1 + A ul + ··· + A u (51) p + 1 0 1 l k=1 In the most general form of the formula, the denominator p + 1 should be replaced with 2l + 2. Confronting Jacobi’s formula with Faulhaber’s formula in Eq. (3), we see that

2i+1 A(l+1) A(l+1) = 0 and c (l) = l−i (52) l i p + 1

(m) It is known that the coefficients Ak obey to some recurrence formulas. More- over, an explicit formula for these coefficients was first obtained by Gessel and Viennot in [18] and is provided by Knuth in [34]. Further, Edwards was first (m) to observe from a recursive formula defining the Ak ’s and involving binomial coefficients that these numbers can be obtained by inverting a lower triangular matrix, see [16]. From there, Gessel and Viennot expressed the coefficients in terms of a k × k determinant, namely

m−k+1 m−k+1 3 1 0 ... 0 m−k+2 m−k+2 m−k+2 ... 0 1 5 3 1 A(m) = . . . k (1 − m) ... (k − m) . . . m−1 m−1 m−1 m−1 2k−1 2k−3 2k−5 ... 1 m  m  m  m 2k+1 2k−1 2k−3 ... 3 Of interest to us here, we note that this determinant is an integer. In fact, this determinant has a neat combinatorial interpretation that is due to Gessel and Viennot. A result in [18] states that this determinant counts the number of ways to put positive integers into a k-rowed tripled staircase with numbers strictly increasing from left to right and from top to bottom and imposing also that an entry in row j is at most m − k + j.

20 Our goal is to show that ci(l) ∈ Zp. For that, we use formula (52). From the discussion above, we know that 1 A(l+1) = × an integer l−i l(l − 1)(l − 2) ... (l − (l − i − 1))

p−1 (l+1) Now l = 2 < p, hence p does not divide the denominator of Al−i . Thus, (l+1) Al−i is a p-adic integer and so is ci(l) for each i. This closes the proof of Theorem 2. We are now in a position to retrieve Glaisher’s result from 1900. By [34], 2m A(m) = B , ∀ m ≥ 2, m−2 2 2m−2 hence (l+1) 4A 4p(p + 1) c (l) = l−1 = B = 2p B (53) 1 p + 1 2(p + 1) p−1 p−1 By (48), (50) and (53), we conclude that

2 (p − 1)! = p Bp−1 − p mod p The method just exposed allows to bypass the use of von Staudt-Clausen’s theorem. Another way namely of getting Glaisher’s formula from Theorem 1 would be to use Bernoulli’s formula together with von Staudt-Clausen’s theorem as follows. A trick consists of summing the (p − 1)th powers of integers up to p instead of p − 1 since we work modulo small powers of p and the last term of the sum will not contribute anyway. This way, Bernoulli’s formula can be expressed in terms of powers of p instead of powers of (p − 1). We get

p p−1 X X p p kp−1 = B pp−j (54) j j k=1 j=0

Pp p−1 3 By (48), we need to know p k=1 k modulo p . This is why we need to know the p-divisibility properties of the denominators of the Bernoulli numbers.

21 By von Staudt-Clausen’s theorem, amongst the Bernoulli numbers present in the sum of Eq. (54), p divides only the denominator of Bp−1. We thus deduce

p−1 X p−1 2 3 p k = p Bp−1 mod p Zp (55) k=1 And so, p−1 X p−1 2 k = p Bp−1 mod p Zp (56) k=1 Glaisher’s formula follows from Eqs. (48) and (56). We note from Glaisher’s formula an improvement for calculating (p−1)! modulo p2. For instance, the one millionth Bernoulli number has 4767554 digits over 24 digits and the 1.5 millionth Bernoulli number has 7415484 digits over 55 digits. A work by Derby dating from 2015 has provided an efficient way for computing p Bp−1. We must introduce new notations.

Notation 4. Denote by PTd(n) the lower triangular matrix obtained by entering the coefficients of the Pascal triangle with the ending 1 coefficient omitted. Write

p−1 p X 1 X p + 1 kp = B (p − 1)p+1−j p + 1 j j k=1 j=0 2 p+1 = d1(p − 1) + d2(p − 1) + ··· + dp+1(p − 1) , according to Bernoulli’s formula. Derby’s result provides a way of computing the coefficients di’s by simply inverting a matrix involving the Pascal triangle. Fact 3. (Due to Derby [15]) We have

−1 (1 p . . . p 1)PTd(p + 1) = (d1, d2, . . . , dp+1), with the row to the left hand side denoting the pth row of the Pascal triangle. From there, since the second coefficient is

1 p + 1 p B = B , p + 1 p − 1 p−1 2 p−1 it provides an efficient way of computing (p − 1)! modulo p2. For interest and completeness here, we note that similar works as Derby’s and additional results involving the sums of powers and the Pascal triangle were achieved by Italian mathematician Giorgio Pietrocola and published electron- ically in 2017 under the title ”On polynomials for the calculation of sums of powers of successive integers and Bernoulli numbers deduced from the Pascal’s triangle”.

22 As announced in the introduction, our method also provides interesting con- gruences modulo p2 on the Stirling numbers. Namely, by looking at the coeffi- cients of powers of X modulo p2, we can prove Theorem 3. First, we study the even powers. We obtain the following congruence, where we used Notation 1:

 p  + 2n + 1

(0) m0 X p tm0 (p − 1)! X 1 X 1 X 1 ··· (2n)! m1 m2 m2n m0 m16=m0 m26=m0,m1 m2n6=m0,m1,...,m2n−1 = 0 mod p2 (57)

As 2n ≤ p − 3, it suffices to resolve the series of sums on m1, . . . , m2n modulo p. We resolve the sums from right to left, summing over all the terms first and subtracting the illicit terms next. By using Result 1 of Bayat, we get

  p−1 (0) p X p tm0 = −(p − 1)! mod p2 2n + 1 m2n+1 m0=1 0 Then, it follows from using Lemma 1,

  p−1 p X 1 + (p − 1)! + pδ0(m0) 2 = −(p − 1)! 2n mod p 2n + 1 m0 m0=1 After applying Wilson’s theorem modulo p to the factorial to the left, we get

  p−1 p−1 p X 1 X pδ0(m0) 2 = (1 + (p − 1)!) 2n + 2n mod p 2n + 1 m0 m0 m0=1 m0=1 The firs term is a product of two terms that are congruent to zero modulo p by Wilson’s theorem and Bayat’s result respectively. As for the second term, it can be rewritten as a difference after applying the equality

p−1 2 pδ0(m) = m − 1 mod p

We obtain p−1 p−1  p  X X 1 = mp−1−2n − mod p2 (58) 2n + 1 m2n m=1 m=1 We get the formula of Theorem 3 for odd indices k. By looking at the coefficient of X2n+1 in both factored and expanded forms, we

23 get by the same methodology as before,

(0)  p  X p t = (p − 1)! l mod p2, 2n + 2 l2n+2 l p−1 (0) X p t = − l mod p2 l2n+2 l=1 p−1 X (1 + (p − 1)! + p δ0(l)) = − mod p2 l2n+1 l=1 From there, we derive in a similar way as before using Bayat’s result that Pp−1 1 l=1 l2n+1 = 0 mod p, p−1 p−1 !  p  X X 1 = − lp−2n−2 − mod p2 (59) 2n + 2 l2n+1 l=1 l=1 Up to a minus sign, this is like in the statement of Theorem 3, for even k this time. In fact, as we will see below, the right hand side of Eq. (59) is zero. Then, the congruence of Theorem 3 holds anyhow and it thus closes the proof of Theorem 3. By using formula (24) and von Staudt-Clausen’s theorem, we have

2 Sp−k = p Bp−k mod p Moreover, by the top congruence of Sun’s Corollary 5.1 of [49], we have for every integer k with 2 ≤ k ≤ p − 1, k − 1 H = p B mod p2 p−1,k−1 k p−k

Further, when k is even, p − k is odd, hence Bp−k = 0 except when p − k = 1, that is when k = p − 1. That case gets treated as a direct calculation. We thus obtain the result of Corollary 2. We now present another method for deriving Corollary 2 from Theorem 3, one which does not use Sun’s congruences for generalized harmonic numbers modulo p2, nor Sun’s formula for the sums of powers modulo p2. First, we show that p2 divides the Stirling numbers with even indices, to the exception of index (p−1). Going back to congruence (59), we show that the two sums that are involved are both congruent to zero modulo p2. The fact that this holds for the first sum follows directly from applying Faulhaber’s formula for odd powers, joint with our point (i) of Theorem 2 which still holds when p is being replaced with any 2l + 1 such that 2l + 1 ≤ p − 2. Indeed, we have

2i+1 A(l+1) ∀1 ≤ i ≤ l − 1, c (l) = l−i and A(l+1) = 1 i 2l + 2 0 From the work of Gessel and Viennot, when 1 ≤ i ≤ l − 1, the denominator of (l+1) Al−i is, up to its sign, a product of integers ranging from i+1 to l. And so, all

24 the Faulhaber coefficients are p-adic integers when the odd power is less than or equal to p − 2 (note this is no longer necessarily true in general, but the fact still holds when the odd power is p, as we proved earlier). As for the second sum, since 2n + 1 ≤ p − 4, an application of Hardy and Wright page 103 of [26] provides the desired congruence. Once we know this extra divisibility property on the Stirling numbers, a smart application of Newton’s formulas by Glaisher allows to relate the generalized harmonic numbers to the Stirling numbers either modulo p2 or modulo p3. This is Theorem 4 of the introduction. In particular, from Glaisher’s results, we have for odd k, using our own notations,

 p  H = (k − 1) mod p2 p−1,k−1 k

Then, replacing in (58) yields the congruence for odd k,

 p  k = S mod p2, k p−1,p−k thus leading ultimately to Corollary 2 by a different proof.

3 Around the Agoh-Giuga conjecture

We have seen earlier in § 1 that two types of composite numbers play a central role around the Agoh-Giuga conjecture, namely the Carmichael numbers and the Giuga numbers. For the definition of these numbers, we refer the reader to the introduction. By a theorem of Giuga, the Agoh-Giuga conjecture states that there does not exist any composite number which is both a Carmichael number and a Giuga number. It follows from the definition that a Carmichael number is odd and has at least three prime factors. Indeed, notice that if n = p u with p prime, then

p − 1|n − 1 ⇔ p − 1|u − 1 as (n − 1) − (u − 1) = u(p − 1) In other words, n p − 1|n − 1 ⇔ p − 1| − 1 (E) p Consequently, if 2 divides a Carmichael number and p is another prime divisor of that Carmichael number, then the even number p−1 divides an odd number, which is impossible. Thus, a Carmichael number must be odd. Next, suppose for a contradiction that n is Carmichael with n = pq with p and q primes and p > q. Since p − 1 > q − 1, we have p − 1 6 | q − 1. But by (E), we n have p − 1| p − 1 = q − 1, leading to a contradiction. It also follows from the definition that a Giuga number is square-free, as oth- n n erwise, both p and p − 1 would be divisible by p when p is a prime dividing

25 n. This is impossible. Thus, we see with the latter equivalence (E) that the Agoh-Giuga conjecture reformulates as: ”There does not exist any composite n n such that for all prime divisor p of n, the integer p − 1 is divisible by both p and p − 1”. The first seven Carmichael numbers were discovered by Czech mathematician ∨ ∨ Vaclav Simerka in 1885. They are:

561 = 3.11.17 1105 = 5.13.17 1729 = 7.13.19 2465 = 5.17.29 2821 = 7.13.31 6601 = 7.23.41 8911 = 7.19.67

In 1994, Alford, Granville and Pomerance show that there exist infinitely many Carmichael numbers. Their proof appears in [4]. It is unknown whether there are finitely or infinitely many Giuga numbers. The following data on Giuga numbers are taken from the quite complete and interesting exposition of [7]. The smallest Giuga number are: 1 1 1 1 30 : + + − = 1 2 3 5 30 1 1 1 1 1 858 : + + + − = 1 2 3 11 13 858 1 1 1 1 1 1722 : + + + − = 1 2 3 7 41 1722 The smallest odd Giuga number has at least 9 prime factors since with a smaller number of prime factors, the sum 1 + ··· + 1 − 1 is smaller than 1. Whether p1 pm n an odd Giuga number does actually exist or not remains an open question. If we could show that there does not exist any such number, then the Agoh-Giuga conjecture would be proven by Giuga’s theorem since a Carmichael number must be odd. Giuga used the property that if p is a prime factor of a Carmichael number n, then for no k is kp+1 a prime factor of n (as otherwise, kp+1−1 = kp|n−1 and p divides n, a contradiction), to prove computationally that any counterexam- ple to the conjecture would have at least 1000 digits. Bedocchi in [6] furthered the number of digits to 1700 by using the same method. The authos of [7] improved on this method by reducing the number of cases to be looked at and have shown computationally that any counterexample has no less than 13800 digits. They also introduce what they call ”Giuga sequences” by no longer con- sidering primes in Definition 1, but rather considering increasing sequences of integers. Like there is an interpretation for a Giuga number in terms of divis- ibility property, there is a similar approach for Giuga sequences. Inspired by

26 that fact, they also define Carmichael sequences and show that Giuga’s con- jecture would be proved if one were to show that no Giuga sequence can be a Carmichael sequence. They list some open questions concerning Giuga’s se- quences and Giuga’s conjecture.

We now present some of our own thoughts on this interesting topic. If the Agoh-Giuga conjecture did not hold, there would exist a composite n such that n Bn−1 = −1 mod n. In particular, n is odd. Also, n Bn−1 6= 0 mod n. As we have seen in the introduction of the current paper, this implies by von Staudt- Clausen’s theorem that n has a prime divisor p such that n is Carmichael at p. In fact, we show that the converse holds if we also impose that n is square-free.

Proposition 1. Let n be composite and square-free. Then,

n Bn−1 6= 0 mod n ⇔ ∃ p|n such that p − 1|n − 1

In order to prove Proposition 1, we first state the following lemma.

Lemma 2. ( 0 mod p if p − 1 6 | n − 1 p Bn−1 = −1 mod p if p − 1 |n − 1

Lemma 2 follows from the fact that p Bk(p−1) = −1 mod p. This is simply a consequence of von Staudt-Clausen’s theorem. Let n be composite and square- free such that p is a prime number dividing n. Then, we may write Y n = p qi

qi ∈ P qi 6= p qi|n

It follows from Lemma 2 that  0 mod p if p − 1 6 | n − 1  Q − qi mod p if p − 1 |n − 1  n Bn−1 = qi ∈ P  q 6= p  i   qi|n

Thus, if p−1|n−1, then n Bn−1 6= 0 mod p and consequently n Bn−1 6= 0 mod n. We deduce a corollary. Corollary 7. Let n be composite and square-free. Suppose n is Carmichael at at least one of its prime divisors. Then, at least one of these primes p at which n is Carmichael must satisfy to p 6 | N(Bn−1).

27 The proof of Corollary 7 is as follows. By Proposition 1, we know that n Bn−1 6= 0 mod n. If for all the prime factors of the denominator of Bn−1, these primes also divide the numerator of Bn−1, then Bn−1 is an integer. Then n Bn−1 = 0 mod n, which constitutes a contradiction.

Before moving further, it is a good time to introduce irregular primes and their role in the numerators of the divided Bernoulli numbers. Definition 2. Let p be a prime number. We say that p is a if p does not divide any of B2, B4, ... , Bp−3. The prime p is said to be irregular otherwise. Regular primes were introduced by K¨ummerwhen he proved that Fermat’s last theorem is true when the exponent is a regular prime. It is unknown whether there exist infinitely many regular primes. On the other hand, Jensen proved in 1915 that the number of irregular primes is infinite [32]. He more precisely shows that there are infinitely many irregular primes that are congruent to 3 mod 4. There are only three irregular primes below 100: 37, 59 and 67. Part of Tanner’s undergraduate thesis at Harvard under John Tate searches for irregular primes p with 125 000 < p < 150 000. The results appear in [52]. There are only four such primes which each divide four Bernoulli numbers, that is there are four associated irregular pairs for each of these four irregular primes. We say that the index of irregularity of these primes is 4. Tanner and Tate proved Fermat’s last theorem for these irregular primes. Previously in [54], Wagstaff had determined the irregular primes up to 125 000. Other known facts on irregular primes include the fact that the only irregular pairs (p, p − 3) for p < 109 are obtained for p = 16 843 (result of Selfridge and Pollack [44]) and for p = 21 24 679 (result of Buhler, Crandall, Ernvall and Mets¨anky¨a[8]). Such a prime is called a as for these primes, p divides the Wolstenholme quotient, namely

2p−1 2p − 1 − 1 = 1 mod p4 ⇔ p |W = p−1 ⇔ H = 0 mod p3 p − 1 p p3 p−1,1 2 ⇔ Hp−1,2 = 0 mod p

2 In the general case, Glaisher had shown that Wp = − 3 Bp−3 mod p. Like mentioned at the beginning of the paragraph, the main interest of distinguishing between regular primes and irregular primes when dealing with Bernoulli numbers relies on the following fact. Fact 4. ! ( B 1 when n = 2, 4, 6, 8, 10, 14 Numer n = n A product of powers of irregular primes otherwise

In what follows, we will make use of K¨ummer’scongruences which we recall below.

28 Theorem 7. (K¨ummer’scongruences, 1850 [36]) Let p be an odd prime and let b > 0 be an even integer such that p−1 6 | b. Then, we have for all nonnegative integer k, B B k(p−1)+b ≡ b mod p k(p − 1) + b b

Note, in [49], Sun generalizes these congruences to the moduli p2 and p3. Carlitz gave a proof that there exist infinitely many irregular primes, using K¨ummer’scongruences [10]. We outline his proof below. Let {p1, . . . , ps} be the set of irregular primes and set n = k(p1 − 1) ... (ps − 1), with k chosen even and so that B  v n > 0 p n for some prime p (recall that | B2m | −→ +∞). 2m m→+∞ If p−1|n, then n = (p−1)l for some integer l. By von Staudt-Clausen’s theorem, pBl(p−1) = −1 mod p. But since B l(p−1) = p u, l(p − 1)

2 for some u ∈ Zp, we see that p Bl(p−1) = p u l(p−1) = 0 mod p, a contradiction. Hence p − 1 6 | n and in particular p is none of the pi’s. We conclude by showing that p is irregular. Write n = (p − 1)s + t with 0 < t < p − 1. We notice that t is even as n is even. Moreoever, p − 1 6 | t. Then, we are under the conditions of application of K¨ummer’s congruences. It yields: B B n ≡ t mod p n t

This forces that p|Bt with t ≤ p − 3. Thus, p is irregular.

In light of K¨ummer’s congruences, we are now prepared for proving Fact 1 of the introduction. Fact 1 asserts that if n is an odd composite Giuga number, then for a divisor p of n, either n is Carmichael at p or p divides B n . p −1 We prove this fact below. Let n = m p with n Giuga and odd. In particular n is square-free (from being Giuga). Since n is Giuga, we have by definition p|m − 1. Since n is odd, m must be also odd, and so m − 1 is even. Suppose n is not Carmichael at p, that is p − 1 6 | m − 1 by (E). Then, an application of Theorem 7 yields for all nonnegative integer k : B B m−1 ≡ k(p−1)+m−1 mod p m − 1 k(p − 1) + m − 1

Pick k such that p 6 |k. Then vp(m − 1 + k(p − 1)) = 0, where vp denotes the p-adic valuation. Also, since p − 1 does not divide m − 1 + k(p − 1), we

29 know by von Staudt-Clausen’s theorem that p does not divide D(Bm−1+k(p−1)). Then the right hand side of the latter congruence is a p-adic integer. Then, the congruence itself imposes that the left hand side of the congruence is also a p- adic integer. However, p divides m−1. It then forces p|Bm−1, just like expected.

We note that Fact 1 appears as a straightforward consequence of Adams’theorem. We recall Adams’statement below. Theorem 8. (Adams’theorem [1] 1878) Let p be an odd prime with p > 3. l l If p |n and p − 1 6 | n, then p |Bn Note, Adams’theorem does not apply when p = 3. But when p = 3, since n n is odd, 3 − 1 is even and so 2 divides n − 1. Thus, n is Carmichael at 3 and Fact 1 holds. There exists a more recent version of Adams theorem stated by Thangadurai as a conjecture. By pa||n, he means that pa|n, but pa+1 6 |, n. Conjecture 2. (Thangadurai [51], 2004) Let p > 3 be a prime such that pl||n for some even positive integer n and p − 1 6 |, n. β Then, p ||N(Bn) implies that β ≤ l + 1 Thangadurai shows that his conjecture holds for regular primes and for ir- regular primes less than 12 millions. While Adams does not provide any proof for his theorem in his own paper, there exist a few proofs, see [33] and [29]. None of these two proofs is based on K¨ummer’scongruences. The proof of [29] uses Voronoi’s congruences.

4 Wilson’s theorem modulo p3

Like we did in the modulus p2 case, we must lift the root residues of g one p power further. First, we introduce a new notation.

(1) Notation 5. Define tk as the p-adic residue such that

(0) 2 (1) 3 xk = k + p tk + p tk mod p The following lemma will be useful to the proof of Theorem 6. We used Notation 2 from § 1. Lemma 3.

p−1 !2 p−1 (1)  X X  tk = k δ0(k) + δ1(k) + δ0(i) + (1 + δ0(k)) δ0(i) mod p i=1 i=1 Hensel’s lifting algorithm is so that

(0) 2 (1) 3 g(k + p tk + p tk ) ∈ p Zp,

30 that is (0) 2 (1) p−1 3 (k + p tk + p tk ) + (p − 1)! ∈ p Zp Expanding yields:

(p − 1)(p − 2) 2 kp−1 + p(p − 1)t(0)kp−2 + p2t(0) kp−3 k 2 k 2 (1) (0) p−2 3 + p (p − 1)tk (k + p tk ) + (p − 1)! ∈ p Zp Another round of simplifications modulo p3 lead to

p−1 (0) p−2 2 (1) p−2 2 (0)2 p−3 3 k + p tk (p − 1)k − p tk k + p tk k + (p − 1)! ∈ p Zp

(0) (0) 2 (0) Notice that since 0 ≤ tk ≤ p − 1, we have tk mod p = tk mod p. It follows (0) 3 (0) 2 that ptk mod p = p tk mod p . Thus, we have by Lemma 1,

(0) 3 ptk = k(1 + (p − 1)! + p δ0(k)) mod p We get

2 (1) −1 p−1 2 p tk k = k 1 + (p − 1)(1 + (p − 1)! + pδ0(k)) + (1 + (p − 1)! + pδ0(k)) + (p − 1)! mod p3

After replacing p−1 2 3 k = 1 + pδ0(k) + p δ1(k) mod p , using Theorem 1 when appropriate and simplifying modulo p3, we obtain the expression of the lemma. Theorem 6 of § 1 is then derived by looking at the constant coefficient of g modulo p3 in both factored and expanded forms. We have, using our Notation 1

p−1 p−1 X (0) k X 2 (1) k (p − 1)! = (p − 1)! + p tk (p − 1)! + p tk (p − 1)! k=1 k=1 X (0) (0) i,j 3 + pti ptj (p − 1)! mod p i6=j Then, factoring (p − 1)! and using Lemma 1 and Lemma 3, we get

p−1 p−1 X 2 X (p − 1)! (1 + (p − 1)! + pδ0(k)) + p (δ0(k) + δ1(k)) k=1 k=1  p−1 2  p−1  p−1 2 X 2 X X − p δ0(i) + p δ0(i) (1 + δ0(k)) i=1 i=1 k=1 ! X   3 + 1 + (p − 1)! + pδ0(i) 1 + (p − 1)! + pδ0(j) = 0 mod p i6=j

31 We derive,

p−1 p−1 p−1 2 X X 2 X (p − 1)! p δ0(i) − 1 − (p − 1)! + p δ0(i) + p (δ1(i) + δ0(i)) i=1 i=1 i=1  p−1 2 p−1  p−1 2 2 X 2 X 2 X − p δ0(i) − p δ0(i) + p δ0(i) i=1 i=1 i=1 p−1 ! 1 X X + 1 + (p − 1)! + pδ (i)1 + (p − 1)! + pδ (j) = 0 mod p3 2 0 0 i=1 j6=i

In the left hand side above, some terms simplify. Denote by S the double sum. We evaluate it as follows.

p−1 p−1 1 X X S = (1 + (p − 1)! + pδ (i)) (1 + (p − 1)! + pδ (j)) 2 0 0 i=1 j=1 p−1  2! X 3 − 1 + (p − 1)! + pδ0(i) mod p i=1 A quick inspection shows that the first term of the difference above is zero modulo p3. Thus, modulo p3, the double sum S reduces to

p−1 2 p−1 ! p2  X  X S = − δ (i) + δ (i)2 mod p3 2 0 0 i=1 i=1 By gathering the different parts, we obtain the formula of Theorem 6. It remains to express (p − 1)! modulo p3 in terms of sums of powers and powers of sums of powers. From there, we will derive the formula of Corollary 6, that is Wilson’s theorem modulo p3. We prove the following lemma. Lemma 4.

p−1 2 p−1 ! p−1 1  X  X X (p − 1)! = −1 − ip−1 + (ip−1)2 + (2p + 1) ip−1 2 i=1 i=1 i=1 3 − (p − 1)( p + 1) mod p3 2 Start from the formula of Theorem 6. First and foremost, we group the terms so as to use the expansion

p−1 2 3 i = 1 + pδ0(i) + p δ1(i) mod p

32 We get,

p−1 p−1 X 2 2 X (p − 1)! = −1 + (pδ0(i) + p δ1(i)) + p δ0(i) i=1 i=1 p−1 p−1 p−1 !2 1 X 1 X X − (ip−1 − 1 − p2δ (i))2 − ip−1 − (p − 1) − p2 δ (i) (60) 2 1 2 1 i=1 i=1 i=1

Denote the last two sums of the latter expression respectively by S3 and S4. We proceed to the evaluation of these two sums. We have by expanding the square of S3,

p−1 p−1 p−1 1 X 1 X X   S = − i2p−2 − (p − 1) + ip−1 + p2 δ (i) ip−1 − 1 3 2 2 1 i=1 i=1 i=1

2 3 Then, using the expression for p δ1(i) modulo p and replacing, it comes

p−1 p−1 p−1 1 X 1 X X S = − i2p−2 − (p − 1) + ip−1 + (ip−1 − 1 − pδ (i))(ip−1 − 1) 3 2 2 0 i=1 i=1 i=1 By expanding the factor of the last sum and regrouping the terms, it follows that

p−1 p−1 p−1 p−1 1 X 1 X X X S = i2p−2 + (p − 1) − ip−1 + p δ (i) − p δ (i)ip−1 3 2 2 0 0 i=1 i=1 i=1 i=1 Now, notice that

p−1 3 pδ0(i) pδ0(i) = pδ0(i)(i − 1) mod p

Hence, the combination of the last two terms of the latter expression giving S3 is nothing else than 2 S3. It follows that

p−1 p−1 1 X X 1 S = − i2p−2 + ip−1 − (p − 1) mod p3 (61) 3 2 2 i=1 i=1

We now deal with S4. Firs, we expand the square. It yields:

p−1 2 p−1 1 X  1 X S = − ip−1 − (p − 1)2 + (p − 1) ip−1 4 2 2 i=1 i=1  p−1  p−1  2 X X p−1 3 + p δ1(i) i − (p − 1) mod p i=1 i=1

33 2 Next, by replacing p δ1(i), it comes:

p−1 2 p−1 1 X  1 X S = − ip−1 − (p − 1)2 + (p − 1) ip−1 4 2 2 i=1 i=1 p−1 ! p−1 ! X p−1  X p−1 3 + i − 1 − pδ0(i) i − (p − 1) mod p i=1 i=1 Expanding the last term and simplifying leads in turn to

p−1 2 p−1 1 X  1 X S = ip−1 + (p − 1)2 − (p − 1) ip−1 + 2 S mod p3, 4 2 2 4 i=1 i=1 from which we finally derive

p−1 2 p−1 1 X  1 X S = − ip−1 − (p − 1)2 + (p − 1) ip−1 mod p3 (62) 4 2 2 i=1 i=1

By plugging the respective expressions (61) and (62) for S3 and S4 into (60) and simplifying, we obtain the formula of Lemma 4. From there, concluding to Wilson’s theorem modulo p3 as in our Corollary 6 is simply a matter of applying von Staudt-Clausen’s theorem and Sun’s congru- ence (24), which is itself a consequence of Bernoulli’s formula and von Staudt- Clausen’s theorem. The a priori non trivial equivalence between our formula and Sun’s formula dating from 2000 got established in the introduction of the current paper.

5 Concluding words

Because the introduction was quite comparative and interactive, by times in- tertwining, between Glaisher’s pioneering and subtle work, Sun’s technical and highly beautiful work a hundred years later and our current work another twenty years later, we felt the need to gather a final conclusion regarding the different approaches. Thus, the forthcoming lines echo very much what was said in the lengthy introduction and draw a short synthesis. First we discuss about Wilson’s theorem. It appears to us that our approach is the most natural one and the most straightforward one for proving Glaisher’s original result from 1900 on Wilson’s theorem modulo p2. Indeed, Glaisher’s own proof for the factorial uses the knowledge of the Stirling numbers modulo p2 which he computes by quite original means. Moreoever, Glaisher’s method does not generalize to the modulus p3. Sun’s method leads to the next modulus p3, but it involves a lot of different works like finding the generalized harmonic num- bers modulo p3. Also, his method does not generalize further, to the modulus p4 for instance, while ours does.

34 Now we discuss about the three works involving the Stirling numbers and the generalized harmonic numbers, and their interconnection. Sun’s way based on Newton’s formulas for computing the Stirling numbers mod- ulo p2 is by far the most elegant and efficient. Once this is achieved, our method allows to relate modulo p2 the Stirling numbers as a difference of a sum of pow- ers and of a generalized harmonic number. We use Bayat’s result (only modulo p) which is a generalization of Wolstenholme’s theorem to generalized harmonic numbers. Thus, we deduce the generalized harmonic numbers modulo p2 by a simpler method than Sun’s. However, our method this time does not generalize to the modulus p3 whereas Sun’s sophisticated method does. In fact his method exposed in [49] even generalizes to the modulus p4 (the result gets provided in his Remark 5.1 without details of his calculation). Also, our method does not deal with Hp−1,p−1 whereas Sun treats that case as well. Our method allows to improve Bayat’s result (or Hardy and Wright’s) modulo p2 since we show that 2 Hp−1,p−2 = 0 mod p and that case is not contained in the works of the latter authors. Recall that in order to obtain our result we only use Bayat’s result modulo p. Going back to the Stirling numbers, Sun’s method does not generalize to the modulus p3, unfortunately. In fact, it does, but only for the even indices (with respect to our notations). This was done by us in § 1, see Eq. (27) using his strategy modulo p2. Glaisher also obtains the Stirling numbers modulo p3, again limited to the even indices. In a forthcoming paper, we will deal with all the indices, even and odd, following the method presented in this paper. As part of our work, we will resolve some congruences concerning some convolutions involving Bernoulli numbers. Glaisher’s work for finding the Stirling numbers modulo p3 for even indices leads him to knowing the generalized harmonic num- bers modulo p3 for odd indices. Namely, Glaisher succeeds to relate the Stirling numbers and the harmonic numbers modulo p2 (resp p3) for even (resp odd) indices (with respect this time to his own notations). His proof involves a smart use of Newton’s formulas and knowing the p2 divisibility property of the Stirling numbers with even indices. He knew these divisibility properties from his origi- nal work on the Stirling numbers modulo p2 which had led to his 1900 formula for the factorial modulo p2. We note once again like in § 2 that an alternative to Sun’s way for finding the Stirling numbers modulo p2 is our method joint with Bayat’s result modulo p2 for determining the Stirling numbers with even indices modulo p2. Then the odd indices can be resolved by using Glaisher’s relationship and our relationship from Theorem 3. The least efficient way for determining the Stirling numbers modulo p2 consists of using our Theorem 3 and Sun’s congruences for generalized harmonic numbers modulo p2. In brief, Wilson’s theorem should be worked out using our p-adic method. The Stirling numbers modulo p2 should be determined following Sun. Then the generalized harmonic numbers modulo p2 can be derived by our Theorem 3. For odd indices, Glaisher’s way is the best to determine the generalized har- monic numbers modulo p3. For even indices, Sun’s heavy machinery can’t be bypassed. The Stirling numbers modulo p3 with even indices can be obtained by our method built on Sun’s method, or can be determined from the Stirling

35 numbers modulo p2 with odd indices by using Glaisher’s method. The Stirling numbers with odd indices modulo p3 would benefit from further investigations.

The research related to the current paper has drawn the attention of mathe- maticians over several centuries and is still ongoing research. A sign also of the vibrant interest in the topics presented here is the fact that many authors have been working on quantum analogs. In the literature, people have for instance studied quantum harmonic numbers

p−1 X 1 Hp−1(q) = and |q| < 1, [k]q k=1 with [k]q the so-called quantum integer defined by

1 − qk [k] = = 1 + q + ··· + qk−1 q 1 − q

In 1999, G.E. Andrews shows in [3] the interesting congruence Result 8. (Andrews 1999 [3]) p − 1 H (q) ≡ (1 − q) mod [p] (63) p−1 2 q His work gets enriched modulo the squared quantum integer by L.L. Shi and H. Pan in 2007 [45]. Shi and Pan’s result is even a generalization of Wolstenholme’s theorem at the next higher power of quantum integers, namely

Result 9. (Shi and Pan 2007 [45])

2 H (q) ≡ p−1 (1 − q) + p −1 (1 − q)2 [p] mod [p]2 p−1 2 24 q q

(p−1)(p−5) 2 Hp−1,2(q) ≡ − 12 (1 − q) mod [p]q

And in fact, in [14], Dilcher even tackles congruences with generalized quantum harmonic numbers. He defines two key determinants both involving binomial coefficients. Definition 3. (Dilcher’s determinants) Let

p+1 2 p 0 ... 0 p+1 p+1 p . . . 0 3 2 ...... Dk(p) = . . . . . p+1 p+1 p+1 k k−1 k−2 . . . p p+1 p+1 p+1 p+1 k+1 k k−1 ... 2

36 and p p 2 1 0 ... 0 p p p ... 0 3 2 1 ˜ ...... Dk(p) = . . . . . p p  p  p k k−1 k−2 ... 1 p  p p  p k+1 k k−1 ... 2 Notation 6.

p−1 p−1 X 1 X qj H (q) := and H˜ (q) := , p−1,k [j]k p−1,k [j]k j=1 q j=1 q

From Dilcher, the second sum is more natural to deal with. It is the reason why Dilcher introduces it. Dilcher shows that Result 10. (Dilcher 2008 [14])

k−1 (−1) k Hp−1,k(q) ≡ pk Dk(−p)(1 − q) (mod [p]q)

˜ 1 ˜ k Hp−1,k(q) ≡ − pk Dk(p)(1 − q) (mod [p]q) Even more recently in 2015, researchers at the Fields Institute deal with q- analogues for congruences involving multiple harmonic sums, after dealing them- selves with multiple harmonic sums in a non quantum setting [42]. In [43], the authors introduce multiple q-harmonic sums which they define as

X qk1t1+···+kktl Hp−1(s, t) = s1 sl [k1]q ... [kl]q 1≤k1<···

37 A quantum analogue of the binomial Wolstenholme theorem does exist since 2011, provided by A. Straub [47]. An equivalent form for Wolstenholme’s theorem is the following. 2p ≡ 2 mod p3 p np  Congruences involving binomial coefficients mp for p prime have been studied by mathematicians for decades. The most recent result that is now known is due to Helou and Terjanian [27]. They showed in 2008 that for p prime with p ≥ 5 and integers n and m such that 0 < m ≤ n, we have  np   n  ≡ mod ps mp m 3 n  with s the highest power of p dividing p m(n − m) m . Quantum wise, Clark was the first to tackle quantum binomial congruences. He showed in 1995 [12] that     np n 2 ≡ mod [p]q, mp q m qp2 where the binomial coefficients are defined with the quantum factorials. Fifteen years later, Straub improves Clark’s congruence by showing under the same conditions as before that        2 np n n m + 1 p − 1 p 2 3 ≡ − (q − 1) mod[p]q mp m qp2 m + 1 2 12 The case n = 2 and m = 1 provides a q-analogue for the binomial Wolstenholme theorem, namely Theorem. (Straub 2011, q-analogue for Wolstenholme’s theorem)   2 2p p − 1 p 2 3 ≡ [2]qp2 − (q − 1) mod [p]q (64) p q 12 Note that Andrews [3] had already contributed modulo the squared power by showing that   2p − 1 p(p−1) 2 ≡ q 2 mod [p] p − 1 q It is to expect that there will be many more generalizations of these results. Most importantly, in what setting could we use these generalizations ? Time shall also provide an answer to that question. On a final note, going back to the recently honored mathematician from the title, it is quite pleasant to mention that Faulhaber has a quantum analogue for his formula that is due to V.J.W. Guo and J. Zeng, see [24]. Also, classically, it would be nice to understand his coefficients better p-adically. We think that the methods of this paper can contribute to it.

Email address: [email protected]

38 References

[1] J-C. Adams, Table of the values of the first sixty two numbers of Bernoulli, Journal f¨urdie reine und angewandte Mathematik 85 (1878) 269 − 272 [2] T. Agoh, Congruences involving Bernoulli numbers and Fermat-Euler quo- tients, J. 94 (2002) 1 − 9 [3] G.E. Andrews, q-analogs of the binomial coefficient congruences of Babbage, Wolstenholme and Glaisher, Discrete Math. 204 (1999) 15 − 25 [4] W. R. Alford, A. Granville and C. Pomerance, There are infinitely many Carmichael numbers, Ann. Math. 140 (1994) 703 − 722 [5] M. Bayat, A generalization of Wolstenholme theorem, Amer. Math. Monthly 104 (1997) 557 − 560 [6] E. Bedocchi, Nota ad una congettura sui numeri primi, Riv. Mat. Univ. Parma 11 (1985) 229 − 236 [7] D. Borwein, J.M. Borwein, P.B. Borwein, R. Girgenshon, Giuga’s conjecture on primality, Amer. Math. Monthly 103 (1996) 40 − 50 [8] J. Buhler, R. Crandall, R. Ernvall and T. Mets´ankyl´a,Irregular primes and cyclotomic invariants to four million, Math. of Computation 61 (1993) 151 − 153 (special issue dedicated to Lehmer) [9] L. Carlitz, A theorem of Glaisher, Can. J. Math. 5 (1953) 306 − 316 [10] L. Carlitz, Note on irregular primes, Proc. Amer. Math. Soc. 82 (1954) 329 − 331 [11] R.D. Carmichael, On composite numbers P which satisfy the Fermat con- gruence ap−1 = 1 mod P, Amer. Math. Monthly, Vol 19 No. 2 (1912) 22−27 [12] W.E. Clark, q-analog of a binomial congruence, Int. J. Math and Math. Sci. 18 (1995) 197 − 200 [13] T. Clausen, Theorem, Astronomische Nachrichten 17 (1840) (22) 351 − 352 [14] K. Dilcher, Determinant expressions for q-harmonic congruences and de- generate Bernoulli numbers, The Electronic Journal of Combinatorics 15 (2008), R63 [15] N. Derby, A search for sums of powers, The Mathematical Gazette 2015 [16] A.W.F. Edwards, A quick route to sums of powers, Amer. Math. Monthly 93 (1986) 451 − 455 [17] J. Faulhaber, Academia Algebrae, Darinnen die miraculosische Inven- tiones zu den h¨ochsten Cossen weiters continuirt und prolifiert werden 1631, QA154.8 F 3 1631afMAT H at Stanford University Libraries by courtesy of Donald E. Knuth.

39 [18] I. Gessel and G. Viennot, Determinants, paths and plane partition, Bran- deis University report, July 1989, Unpublished [19] I. Gessel, On Miki’s identity for Bernoulli numbers, J. Number Theory 110 (2005) 75 − 82

[20] G. Giuga, Su una presumibile proprieta caratterista dei numeri primi, Ist. Lombardo Sci. Lett. Rend. A83 (1950) 511 − 528 [21] J.W.L. Glaisher, Congruences relating to the sums of products of the first n numbers and to the other sums of products, Quarterly J. Math. 31 (1900) 1 − 35

[22] J.W.L. Glaisher, On the residues of the sums of products of the first p − 1 numbers and their powers, to modulus p2 or p3, Quarterly J. Math. 31 (1900) 321 − 353 [23] F. Gouvea, p-adic numbers, An introduction, Second Edition, Springer 1993

[24] V.J.W. Guo and J. Zeng, A q-analog of Faulhaber’s formula for sums of powers, The Electronic Journal of Combinatorics, Vol. Special issue in honor of Richard Stanley on the occasion of his 60th birthday [25] D. B. Gr¨unberg, Integrality of open instantons numbers, arXiv:hep- th/0305057

[26] G.H. Hardy and E.M. Wright, An introduction to the theory of numbers, Oxford Science Publications 1979 [27] C. Helou and G. Terjanian, On Wolstenholme’s theorem and its converse, J. Number Theory 128 (3) (2008) 475 − 499

[28] S. Hussein, A note on the converse of Wolstenholme’s theorem, Integers 18 (2018) Paper No. A94, 3pp [29] K. Ireland and M. Rosen, A classical introduction to modern number the- ory, Springer NY 1982 [30] C.G.J. Jacobi, De usu legitimo formulae summatoriae Maclaurinianae, Journal fr die reine und angewandte Mathematik (1834) 12: 263272 [31] N. Jacobson, Basic Algebra I, 2nd Edition 1985 p. 140 [32] K.L. Jensen, Om talteoretiske Egenskaber ved de Bernoulliske Tal, Nyt Tidsskr. Mat. B 26 (1915) 73 − 83

[33] W. Johnson, p-adic proofs of congruences for the Bernoulli numbers, J. Number Theory v. 7 (1975) 251 − 265 [34] D.E. Knuth, Johann Faulhaber and sums of powers, Math. of Computation 61 1993 203:277 − 294

40 [35] A.R. Korselt, Probl`emechinois, L’interm´ediairedes math´ematiques,Vol 6 (1899) p. 143 [36] E.E. K¨ummer, Uber die Erg¨anzungss¨atze zu den allgemeinen Re- ciprocit¨atsgesetzen,J. Reine Angew. Math. 44 (1852) 93 − 146

[37] C. Levaillant, A quantum combinatorial approach for computing a tetra- hedral network of Jones-Wenzl projectors, arXiv:1301.1733 [38] R.J. McIntosh, On the converse of Wolstenholme’s theorem, Acta Arith- metica 71 No. 4 (1995) 381 − 389

7 2p−1 [39] R. Mestrovic, On the mod p determination of p−1 , Rocky Mountain Journal of Mathematics 44, No. 2 (2014) 633 − 648

[40] R. Mestrovic, Wolstenholme’s theorem: its generalizations and extensions in the last hundred and fifty years (1862 − 2012), arXiv:1111.3057 [41] H. Miki, A relation between Bernoulli numbers, J. Number Theory, 10 (1978) 297 − 302 [42] K.H. Hessami Pilehrood, T. Hessami Pilehrood and R. Tauraso, New prop- erties of multiple harmonic sums modulo p and p-analogues of Leshchiner’s series, Trans. Amer. Math. Soc. 366 (2014), no. 6 3131 − 3159 [43] K.H. Hessami Pilehrood, T. Hessami Pilehrood and R. Tauraso, Some q- congruences for homogeneous and quasi-homogeneous multiple q-harmonic sums, The Ramanujan Journal Vol 43, Issue 1 (2017) 113 − 139

[44] J.L. Selfridge and B.W. Pollack, Fermat’s last theorem is true for any exponent up to 25, 000, Notices of the AMS 11 (1964) 97 [45] L.-L. Shi and H. Pan, A q-analogue of Wolstenholme’s harmonic series congruence, Amer. Math. Monthly 114 (2007) 529 − 531

[46] K. Shirantani, S. Yokoyama, An application of p-adic convolutions, Mem. Fac. Sci. Kyushu Univ. Ser. A (36) (1982) 73 − 83 [47] A. Straub, A q-analog of Ljunggren’s binomial congruence, Proceedings of the 23rd International Conference on Formal Power Series and Algebraic Combinatorics (FPSAC 2011), Reykjavik, Iceland 897 − 902

[48] Z-H. Sun, Congruences for Bernoulli numbers and Bernoulli polynomials, Discrete Math. 163 (1997) 153 − 163 [49] Z-H. Sun, Congruences concerning Bernoulli numbers and Bernoulli poly- nomials, Discrete Applied Math. 105 (2000) 193 − 223

[50] Z-H. Sun, A note on Wilson’s theorm and Wolstenholme’s theorem, Un- published

41 [51] R. Thangadurai, Adams theorem on Bernoulli numbers revisited, J. Num- ber Theory 106 (2004) 169 − 177 [52] J.W. Tanner and S.S. Wagstaff, New congruences for the Bernoulli num- bers, Math. Comp. Vol.48 Number 177 (1987) 341 − 350

[53] C. Von Staudt, Beweis eines Lehrsatzes, die Bernoullischen Zahlen betref- fend, Journal f¨urdie Reine und Angewandte Mathematik 21 (1840) 372−374 [54] S.S. Wagstaff, The irregular primes to 125000, Math. Comp. v. 32 (1978) 583 − 591 [55] J. Wolstenholme, On certain properties of prime numbers, Quaterly J. of Pure and Applied Math. Vol 5 (1862) 35 − 39

42