<<

arXiv:2012.04615v3 [math.NT] 1 Apr 2021 s o n oiieintegers positive any for where r rmr beto hsppri oitouea introduce to is paper this of object primary otu ijitfo h eaiera xswihbgn tanonz a at begins which axis real negative the number from disjoint contour a am ucin h nopeegmafnto Γ( function gamma incomplete The function. gamma Then satisfying h nqefil ooopimsatisfying homomorphism field unique the ucino w aibe bandb nertn h differential the integrating by obtained variables two of function hoe 1.1. Theorem values. these interpolates which function continuous Γ( , ∈ n17,Mrt icvrda discovered Morita 1975, In e od n phrases. and words Key 2020 Date Z ,r n, p τ exp pi ,2021. 2, April : ahmtc ujc Classification. Subject Mathematics onigdrneet n ragmnsi h rahproduct wreath . symmetric the a in s with combinatorial arrangements group of and family related derangements closely counting a introduce also We function. Abstract. p and Γ( z sartoa utpeo 1 of multiple rational a is ) p n nsa + at ends and ,r n, r sthe is eagmnsadthe and Derangements ∈ sa is ) + 1 NRWODSYADDVDHRYRICHMAN HARRY DAVID AND O’DESKY ANDREW hr xssacniuu function continuous a exists There p eitoueanew a introduce We ai xoeta function. exponential -adic p p Γ Z ai ubradw a s o h xsec fa of existence the for ask may we and number -adic p p ( eagmns nopeegmafunction, gamma incomplete derangements, ,r s, ehv h formula the have we ∞ n tcnb hw htfraypstv positive any for that shown be can It . exp = ) and Γ am function gamma p : Γ 1. Z p r ( p p Introduction ,r n, p satisfying ai nlgeo h am ucin The function. gamma the of analogue -adic × ( pr p /e 1+ (1 = ) ai nlgeo h nopeegamma incomplete the of analogue -adic 32,1S0 17,05A05. 11B75, 11S80, 33B20, ) r X 1 k ∞ =0 c.( (cf. τ p p τ Z Γ( r p p s (1 p r − ,r n, ) ai incomplete -adic k p /e ≡ 15 → − ai nlgeo h incomplete the of analogue -adic 1 + 1 = ) ) ) Let )). (mod 1 k Z !  p s − k ,z s, p 1 τ p  p + stemeromorphic the is ) ) : xlcty o any for Explicitly, . p Q p 2 ai analysis. -adic / ( e !+ 2! facyclic a of ) z equences s → − r complex ero p 1 e 3 Q − / !+ 3! z p dz denote p n -adic · · · over and . 2 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

We also prove the following curious formula for Γp involving the floor function. For any n ∈ N and r ∈ Z satisfying r ≡ 1 (mod p),

1/r n 1 −n ⌊e r n!+ 2 ⌋ if r < 0, Γp(n +1, 1/r)= r expp(p/r) · 1/r n (⌊e r n!⌋ if r > 0. This formula is rather surprising as it expresses a p-adically continuous function in terms of a function which crucially uses the linear ordering on the real numbers. 1.1. Combinatorial interpretation using wreath products. The second ob- ject of this paper is to give a combinatorial interpretation for the integral values of the incomplete gamma function. Just as the values of the gamma function at positive integers count permutations, we show that the values of the incomplete gamma function at integral pairs (n, r) ∈ N>0 × Z count more sophisticated com- binatorial gadgets involving the wreath products of symmetric groups with cyclic groups, an interesting and well-studied family of groups. Let Cr denote the of r and let Sn denote the of degree n. The permutation action of Sn on [n] := {1, 2,...,n} extends naturally to a permutation action of Cr ≀ Sn on the set Cr × [n] (for details see §3.1). An r-cyclic derangement of degree n is an element of Cr ≀ Sn whose action on Cr × [n] has no fixed point. An r-cyclic arrangement of degree n is a choice of subset A ⊂ [n] and an element of Cr ≀S|A| (r-cyclic derangements were introduced by Assaf [4] while r-cyclic arrangements appear to be a new notion). We assemble these into a single count by defining, for any nonzero r, the quantity (−1)n(# of |r|-cyclic derangements of degree n) if r< 0, a(n, r) := (1) (# of r-cyclic arrangements of degree n if r> 0. By use of an inclusion-exclusion argument one can prove the algebraic identity n n a(n, r)= k! rk . k Xk=0   This identity holds for positive and negative r, which serves as motivation for combining these two counts into one. This identity also allows for rapid calcula- tion of a(n, r). For instance, a(1, 2)=3 and a(2, −2) = 5. The values of the incomplete gamma function at integral values are closely related to a(n, r). In analogy to the classical formula Γ(n+1) = n!, one can show that for any nonzero integer r and nonnegative integer n, Γ(n +1, 1/r)= a(n, r)r−ne−1/r. Thus the incomplete gamma function essentially interpolates the counts of cyclic arrangements and cyclic derangements (up to the factor r−ne−1/r). The presence of this factor means that the two problems of p-adic interpolation for the functions DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 3

Γ(n +1, 1/r) and a(n, r) are not the same. Nonetheless we will show that the function a(n, r) also interpolates p-adically in both variables. Theorem 1.2. For any (n, r) ∈ N × Z let a(n, r) ∈ Z be defined by (1). (1) For any fixed nonzero integer r, the function n 7→ a(n, r) extends to a locally analytic metric map on Zp. Furthermore, n 7→ a(n, r) extends to an analytic function on Zp if and only if p divides r. (2) As a function of two variables, (n, r) 7→ a(n, r) extends to a continuous map ap : Zp × Zp → Zp satisfying the inequality

|ap(x, r) − ap(y,s)|p ≤ max{|x − y|p, |r − s|p}

for any (x, r), (y,s) ∈ Zp × Zp. Connection with pseudo-polynomials. The existence of a p-adic metric map inter- polating a(n, r) means that the values of a(n, r) satisfy rather special congruences. In two prominent cases these congruences have been noticed before. One such case concerns derangements of degree n, which are permutations on n letters without a fixed point. Let dn = a(n, −1) denote the number of derangements of degree n. This defines a whose first few terms are 1, 0, 1, 2, 9, 44, 265, 1854, 14833, 133496, .... The arithmetic properties of this sequence have been the subject of some recent interest, e.g. [30], [29], [18], [28]. It was observed in [14, §2.4] that for any positive integer m, a b (−1) da ≡ (−1) db (mod m) if a ≡ b (mod m). (2) The other prominent case, which is in some sense dual to derangements, concerns arrangements of degree n, which are pairs (A, σ) consisting of a subset A ⊂ [n] and a permutation σ of A. Indeed it was observed in [11] that for any positive integer m, the number an = a(n, 1) of arrangements of degree n satisfies the congruence ac ≡ ad (mod m) if c ≡ d (mod m). (3)

In general, a function f : N → Z satisfying the congruence fa ≡ fb (mod m) whenever a, b, m ∈ N satisfy a ≡ b (mod m) is called a pseudo-polynomial. The first half of Theorem 1.2 says that n 7→ a(n, r) is a pseudo-polynomial for any fixed nonzero integer r. In other words, for any fixed nonzero integer r, a(c,r) ≡ a(d,r) if c ≡ d (mod m). The congruences (2) and (3) follow from the first half of Theorem 1.2 by taking r = −1 and r = 1, respectively. Other special cases of Theorem 1.2. The assertion in the first half of Theorem 1.2 that n 7→ a(n, r) is p-adic locally analytic also appears in the literature for the special cases r ∈ {±1}. The fact that n 7→ a(n, −1) (counting derangements) extends to a p-adic locally analytic function was first proven by Barsky [5] using the formal Laplace transform. The fact that n 7→ a(n, 1) (counting arrangements) 4 ANDREWO’DESKYANDDAVIDHARRYRICHMAN extends to a p-adic locally analytic function was proven more recently by Pa¸sol– Zaharescu [23]. 1.2. Permutations with restricted cycle lengths. The third object of this paper is to demonstrate p-adic interpolation properties for permutations with restricted cycle lengths. This gives a complementary generalization of the con- gruence (2) for derangements which is distinct from its generalization to wreath products in Theorem 1.2. A derangement may be thought of as a permutation with no cycle of length one. We generalize this restriction by letting L ⊂ N>0 be any subset, which we consider as the set of ‘permitted’ cycle lengths. Define the count of ‘permissible’ permutations, L dn := #{σ ∈ Sn : every cycle length of σ is in L}. L We prove the following p-adic interpolation result for n 7→ dn . L Theorem 1.3. Let L be a set of positive integers, and let dn denote the number of permutations in Sn whose cycle lengths are in L. L (a) Suppose 1 ∈ L. Then the function n 7→ dn extends to a p-adic continuous function on Zp if and only if p 6∈ L. n L (b) Suppose 1 6∈ L. Then the function n 7→ (−1) dn extends to a p-adic contin- uous function on Zp if and only if p ∈ L. This theorem encompasses a large class of . To illustrate, we record a few examples here; the reader may find more examples in §5. For brevity, we write PL for the set of primes for which the displayed sequence (depending on L) extends to a p-adic continuous function on Zp.

Example 1 (Squares). If L1 := {1, 4, 9, 16,...} consists of the perfect squares, then L1 (dn )=(1, 1, 1, 1, 7, 31, 91, 211, 1681, 52417,...) and PL1 = {all primes}. >0 Example 2 (Non-squares). If L2 := N \ L1, then

n L2 ((−1) dn )=(1, 0, 1, −2, 3, −44, 175, −1434, 12313, −59912,...) and PL2 = {all primes}.

Example 3 (Powers of 3). If L3 := {1, 3, 9, 27,...}, then

L3 (dn )=(1, 1, 1, 3, 9, 21, 81, 351, 1233, 46089,...) and P3 = {all primes except 3}. >0 Example 4 (Complement of powers of 3). If L4 := N \ L3, then

n L4 ((−1) dn )=(1, 0, 1, 0, 9, −24, 225, −1224, 11025, −53136,...) and P4 = {all primes except 3}. DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 5

Example 5 (Classical derangements). If L0 := {2, 3, 4, 5,...}, then

n L0 ((−1) dn )=(1, 0, 1, −2, 9, −44, 265, −1854, 14833, −133496,...) are the classical derangement numbers (up to sign) and PL0 = {all primes}. 1.2.1. The Artin–Hasse exponential. Within the large class of combinatorial se- quences in Theorem 1.3, some have particularly strong arithmetic interest. One notable case is when 2 3 Lp := {1,p,p ,p ,...},

Lp the set of powers of a given prime p. We prove that dn is equal to the nth Taylor coefficient of the Artin–Hasse exponential function, Xp Xp2 E (X) = exp X + + + ··· . p p p2   In this case, Theorem 1.3 leads to the striking conclusion that the Taylor coeffi- cients of Ep(X) admit ℓ-adic interpolation for primes ℓ distinct from p. Corollary 1.4. Let ℓ and p be primes. The Taylor coefficients of the Artin–Hasse exponential Ep(X) extend to an ℓ-adic continuous function on Zℓ if and only if ℓ =6 p. For example, for p = 3 we have 1 1 3 7 9 39 E (X)=1+ X + X2 + X3 + X4 + X5 + X6 + X7 + O(X8). 3 2 2 8 40 80 560 X2 X3 X4 X5 X6 X7 =1+ X + +3 +9 + 21 + 81 + 351 + O(X8). 2! 3! 4! 5! 6! 7! Compare with Example 3; note that the ℓ-adic properties appear rather differently when considering coefficients of Xn rather than Xn/n!.

Notation. We use N to denote the set of nonnegative integers and N>0 for the set of positive integers. We let Zp (resp. Qp) denote the ring of p-adic integers (resp. field of p-adic numbers). We use |·|p (resp. vp) to denote the field norm (resp. p-adic additive valuation) on Qp. We let Cp denote the metric completion of an algebraic closure of Qp. The p-adic valuation vp and the norm |·|p on Qp both extend uniquely to Cp and are denoted by the same symbols.

2. Standard results of p-adic analysis In this section we briefly recall a few standard results from p-adic analysis for the reader’s convenience. For more background on nonarchimedean analysis we refer the reader to [25]. Let p denote a . Given a function f : N → Cp, the basic question of p-adic interpolation is whether f extends to a p-adic continuous mapping (or p-adic Lipschitz function, 6 ANDREWO’DESKYANDDAVIDHARRYRICHMAN p-adic locally analytic function, p-adic analytic function, etc.). In other words, whether there exists a function fp fitting into a commutative diagram:

f N Cp

⊂ =

fp Zp Cp where fp is continuous in the p-adic topology. If a continuous extension fp exists then it must be unique. This question of p-adic interpolation is answered by using finite differences. The nth finite difference c(n) of f (at zero) is defined by

n n c(n) := (−1)n−k f(k) for all n ≥ 0. k Xk=0   This admits an inverse relation given by

n n f(n)= c(k) for all n ≥ 0. (4) k Xk=0   A classical theorem of Mahler [17] says that f extends to a p-adic continuous function on Zp if and only if |c(n)|p → 0 as n → ∞. More generally, faster rates of p-adic decay for the finite differences c(n) correspond to stronger p-adic properties of f. For our purposes, the relevant classes of functions are metric maps (Lipschitz functions with Lipschitz constant one), p-adic locally analytic functions, and p-adic analytic functions. We now consider the corresponding conditions on finite differences for each of these in turn. Definition 2.1. A function f : X → Y of metric spaces is a metric map if

dY (f(x), f(y)) ≤ dX (x, y) for all x, y ∈ X. Equivalently, f is a Lipschitz continuous map with Lipschitz constant one. The condition for a sequence to extend to a metric map on Zp is well-known.

Theorem 2.2. Let f : N → Cp be a function. Then f extends to a metric map on Zp if and only if log n ⌊ p ⌋ sup |c(n)|p p log ≤ 1. n≥1 For a proof, see [24, §5.1], or [22, Proposition 2] for a generalization. In the next definition, we take K ∈{Qp, Cp}. An open disk D of K is any subset of the form D = {a ∈ K : |a − a0|p

Definition 2.3. If D is any open disk of K, a function f : D → Cp is analytic if there are elements a0 ∈ D and c0,c1,... ∈ Cp such that ∞ n f(x)= cn(x − a0) for all x ∈ D. n=0 X Let U be an open subset of K. A function f : U → Cp is locally analytic if for each a ∈ U there is an open disk D ⊂ U containing a such that f|D is analytic. The class of p-adic locally analytic functions is closed under finite sums and finite products. The classes of p-adic analytic and locally analytic functions are both relevant for interpolating the count of cyclic derangements and cyclic arrangements in wreath products (see Theorem 3.3). The criterion on finite differences for admitting an extension to a p-adic analytic function on the closed unit disk is well-known (see [25, Theorem 54.4]).

Theorem 2.4. Let f : N → Cp be a function. Then f extends to a p-adic analytic function on the closed unit disk if and only if

|c(n)/n!|p → 0 as n →∞. The following theorem of Amice [2] characterizes the sequences which extend to p-adic locally analytic functions on Zp.

Theorem 2.5 (III, §10, Corollaire 2, p. 162, [2]). Let f : N → Cp be a function. Then f extends to a p-adic locally analytic function on the closed unit disk if and only if v (c(n)) lim inf p > 0. n→∞ n   Example 6. Let u ∈ Cp and suppose that |u − 1|p < 1. Then the function n n f : N → Cp given by n 7→ u has finite differences equal to c(n)=(u − 1) . We vp(c(n)) see that lim inf = vp(u − 1) > 0. By Amice’s theorem, f extends to a n→∞ n locally analytic function on the closed unit disk. 3. Cyclic arrangements and derangements In this section we prove Theorem 1.2 and demonstrate a formula for a(n, r) involving the floor function. The results of this section will be used to construct our p-adic analogue of the incomplete gamma function in §4.

3.1. Wreath products. Let r and n be positive integers. Let Cr denote the cyclic group of order r. The symmetric group Sn acts by precomposition on the set Fun([n],Cr) = {f :[n] → Cr} of functions, which is itself a group under pointwise operations. The wreath product is defined by

Cr ≀ Sn := Fun([n],Cr) ⋊ Sn. 8 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

This group has a natural permutation action on the set Cr × [n] given by (f, σ)(s, m)=(s + f(σ(m)), σ(m)).

Alternatively, the group Cr ≀ Sn is isomorphic to the set of complex n × n matrices which are a product of a diagonal matrix with rth roots on unity on the diagonal and a permutation matrix under usual matrix multiplication. In this representation, the action on the set Cr × [n] defined above is isomorphic to i matrix multiplication on the vectors {ζ ej : i = 0, 1,...,r − 1, j = 1, 2,...,n} n where ζ is a primitive rth root of unity and ej is a standard basis vector of C .

Definition 3.1. An r-cyclic derangement of degree n is an element of Cr ≀ Sn whose action on Cr × [n] has no fixed point. An r-cyclic arrangement of degree n is a choice of subset A ⊂ [n] and an element of Cr ≀ S|A|. In terms of matrices, an r-cyclic derangement of degree n is represented by an n × n complex matrix with exactly one nonzero entry in every row and column, where those entries are taken from the set of rth roots of unity, and which has no ones on the diagonal. An r-cyclic arrangement is represented by a subset A ⊂ [n] together with an |A|×|A| complex matrix with exactly one nonzero entry in every row and column, where those entries are taken from the set of rth roots of unity. Example 7. There are five 2-cyclic derangements of degree 2. They are given by the matrices 0 1 0 −1 0 1 0 −1 −1 0 , , , , . 1 0 1 0 −1 0 −1 0 0 −1           There are three 2-cyclic arrangements of degree 1. In the notation (A, f) with f ∈ Cr ≀ S|A| in its matrix form, they are given by ∅, () , [1], (1) , [1], (−1) . Recall that we define the counting function    # of r-cyclic arrangements of degree n if r > 0, a(n, r) := n ((−1) (# of |r|-cyclic derangements of degree n) if r < 0. We begin by extending the definition of a(n, r) to nonintegral values of r. Definition 3.2. For any element r in a ring and n ∈ N, let n n a(n, r) := k!rk. (5) k Xk=0   This formula agrees with the earlier definition of a(n, r) whenever r is a nonzero integer. Indeed, when r is a positive integer this follows by summing the quantity n #(Cr ≀ Sk) over the possible cardinalities k of the k choices of subset A ⊂ [n]. When r is a negative integer the formula (5) counts derangements by inclusion-  exclusion as follows. First observe that (f, σ) ∈ C|r| ≀ Sn fixes (s, m) if and only DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 9 if σ(m)= m and f(m) = 0. This condition is independent of s which shows that the set of fixed points of (f, σ) is equal to C|r| × A where A = {m ∈ [n]: σ(m)= m, f(m)=0}. Thus, for any positive integer n, by using inclusion-exclusion we obtain

#(|r|-cyclic derangements) = #(x ∈ C|r| ≀ Sn) − #(x which fix C|r| ×{i}) iX∈[n] + #(x which fix C|r| ×{i, j}) −··· {i,jX}⊂[n] n k = (−1) #(x ∈ C|r| ≀ Sn which fix C|r| × A). k=0 A⊂[n] X |AX|=k

For any subset A ⊂ [n] of cardinality k, the of C|r| ≀ Sn fixing ev- ery element of C|r| × A can be identified with C|r| ≀ Sn−k, which has cardinality |r|n−k(n − k)!. Thus n n #(|r|-cyclic derangements) = (−1)k |r|n−k(n − k)!, k Xk=0   which can be reindexed to obtain the identity n n #(|r|-cyclic derangements) = (−1)n rkk!=(−1)na(n, r). k Xk=0   Example 8. Using (5) we see that there are five 2-cyclic derangements of degree 2 since 2 2 2 a(2, −2) = 0!(−2)0 + 1!(−2)1 + 2!(−2)2 =5. 0 1 2       Compare with Example 7. 3.2. Proof of Theorem 1.2. We will prove the two parts of Theorem 1.2 sepa- rately. Initially we will consider the p-adic interpolation of n 7→ a(n, r) for fixed × r ∈ Cp (Theorem 3.3). Afterwards we will prove interpolation of a(n, r) in two variables (Theorem 3.5). Let p be a prime integer. The next theorem is our main result about the p-adic interpolation of n 7→ a(n, r). × Theorem 3.3. Let r ∈ Cp and let a( · ,r): N → Cp be defined by (5). Then, ⋄ n 7→ a(n, r) extends to a p-adic analytic function on the closed unit disk if and only if |r|p < 1; ⋄ n 7→ a(n, r) extends to a metric map on the closed unit disk if and only if

|r|p ≤ 1; 10 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

⋄ n 7→ a(n, r) extends to a p-adic locally analytic function on the closed unit disk if and only if (p−1)−1 |r|p

⋄ n 7→ a(n, r) does not extend to a continuous function on Zp if (p−1)−1 |r|p ≥ p . This theorem immediately proves the first half of Theorem 1.2. As the inequal- (p−1)−1 ities |r|p ≤ 1 < p are always satisfied whenever r is an integer, we obtain the following corollary. Corollary 3.4. For any prime number p and integer r, the function n 7→ a(n, r) extends to a p-adic locally analytic metric map on Zp. If p divides r, then n 7→ a(n, r) extends to a p-adic analytic metric map on Zp. Proof of Theorem 3.3. We have n n a(n, r)= rkk! . k Xk=0   Let c: N → Cp be the sequence of finite differences of a( · ,r), meaning n n n n c(n)= (−1)n−k a(k,r) or equivalently a(n, r)= c(k) . k k Xk=0   Xk=0   We see immediately that c(k)= rkk!. By Theorem 2.4, a(n, r) extends to a p-adic analytic function on the closed unit n disk if and only if |c(n)/n!|p = |r|p → 0 as n →∞, and this occurs if and only if |r|p < 1. This proves the first equivalence. ⌊ log n ⌋ Now we prove the second equivalence. First observe that p log p is the largest power of p that is less than or equal to n. It follows that

log n ⌊ p ⌋ sup |n!|p p log ≤ 1. n≥1

Clearly, if |r|p ≤ 1 then we have

log n log n ⌊ p ⌋ n ⌊ p ⌋ sup |c(n)|p p log = sup |r n!|p p log ≤ 1, n≥1 n≥1 in which case a(n, r) extends to a metric map on Zp by Theorem 2.2. On the other hand, if |r|p > 1 then

log n n ⌊ p ⌋ sup |r n!|p p log ≥|r|p > 1, n≥1 showing that a(n, r) does not extend to a metric map on Zp. DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 11

Now we prove the third equivalence. Using the well-known formula for the p-adic valuation of n! we obtain −1 −1 vp(c(n)) = n (p − 1) + vp(r) − sp(n)(p − 1) where sp(n) is the sum of the digits of n in base- p. In particular, we have −1 vp(c(n)) = n (p − 1) + vp(r) − O(log n). (6) Thus  vp(c(n)) −1 lim inf =(p − 1) + vp(r). n→∞ n   By Amice’s theorem (Theorem 2.5), a(n, r) extends to a p-adic locally analytic −1 function on the closed unit disk if and only if (p−1) +vp(r) > 0, or equivalently, (p−1)−1 |r|p

p . On the other hand, if (p − 1) + vp(r)=0 then −1 vp(c(n)) = −sp(n)(p − 1) . N Since sp(p ) = 1 for any positive integer N, we see that in this case vp does not go to ∞ as n → ∞. We conclude that a(n, r) does not admit an extension to a (p−1)−1 continuous function on Zp when |r|p ≥ p . 

Now we turn to the problem of joint continuity. We say a function f : Zp×Zp → Zp is a metric map if it satisfies

|f(x, r) − f(y,s)|p ≤ max{|x − y|p, |r − s|p} for all (x, r), (y,s) ∈ Zp × Zp. >0 Theorem 3.5. The function N×N → Zp : (n, r) 7→ a(n, r) extends to a metric map ap : Zp × Zp → Zp. Explicitly, it is given by the convergent series ∞ k ap(y,r)=1+ r y(y − 1) ··· (y − k + 1) for (y,r) ∈ Zp × Zp. (7) Xk=1 Proof. Let (x, r), (y,s) ∈ Zp × Zp. The function n 7→ a(n, r) admits a continuous extension in the first variable (denoted ap( · ,r)) by Theorem 3.3. By Definition (5), the Mahler series of ap( · ,r) is ∞ y ∞ a (y,r)= rkk! =1+ rkyk (8) p k Xk=0   Xk=1 k where y := y(y−1) ··· (y−k+1). This sum is absolutely convergent since ap( · ,r) is continuous. This shows that the assignment (y,r) 7→ ap(y,r) is well-defined. By absolute convergence we can rearrange (8) to obtain ∞ k k k |ap(y,r) − ap(y,s)|p = (r − s )y (9) p k=1 X

12 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

k k k ≤ max |r − s |p |y |p k≥1

≤|r − s|p.  k k k In the last inequality, we have used that |r − s |p ≤ |r − s|p and |y |p ≤ 1 for k ≥ 1 and y,r,s ∈ Zp. We have the inequality |ap(x, r) − ap(y,r)|p ≤|x − y|p since ap( · ,r) is a metric map by Theorem 3.3. Combining this inequality with (9) we obtain

|ap(x, r) − ap(y,s)|p ≤ max{|ap(x, r) − a(y,r)|p, |ap(y,r) − ap(y,s)|p}

≤ max{|x − y|p, |r − s|p}. This inequality completes the proof.  3.3. A formula for a(n, r). The conclusion of Theorem 1.2 is rather surprising in view of the following beautiful formula for a(n, r) in terms of the floor function. Theorem 3.6. Let r be a nonzero integer and let n be a positive integer. Then

1/r n 1 ⌊e r n!+ 2 ⌋ if r< 0, a(n, r)= 1/r n (10) (⌊e r n!⌋ if r> 0. The cases r ∈ {±1} are known, see e.g. Hassani [12]. The function a(n, r) thus exhibits a surprising harmony between the p-adic topologies and the real topology, the latter of which is used crucially in (10) to define the ordering on R. For clarity, we split up the proof into two cases depending on whether r is positive or negative. Proposition 3.7. Let r be a positive integer and let a(n, r) denote the number of r-cyclic arrangements of degree n. Then 1 a(n, r)= ⌊e r rnn!⌋ (n ∈ N>0). Proof. Recall that an r-cyclic arrangement of degree n is a subset A ⊂ [n] and an element of Cr ≀ S|A|. Thus n n a(n, r)= rkk!. k Xk=0   Observe that 1 r−2 r−3 e r rnn!= rnn! 1+ r−1 + + + ··· 2! 3!  n  n n = rnn!+ rn−1(n − 1)! + rn−2(n − 2)! + ··· + r +1 1 2 n − 1       r−1 r−2 + + + ··· . n +1 (n + 1)(n + 2) DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 13

Let Rr,n denote the ‘remainder term’ n! r−1 r−2 R = r−k = + + ··· . (11) r,n (n + k)! n +1 (n + 1)(n + 2) Xk≥1 1/r n We have e r n!= a(n, r)+Rr,n. Each summand of Rr,n is a decreasing function of r and a decreasing function of n. Since r, n ≥ 1, we have Rr,n ≤ R1,1 = e − 2 < 1. It follows that 1 n ⌊e r r n!⌋ = ⌊a(n, r)+ Rr,n⌋ = a(n, r).  Proposition 3.8. Let r be a negative integer and let a(n, r) denote the quantity (−1)n(number of |r|-cyclic derangements of degree n). Then 1 r n 1 >0 a(n, r)= ⌊e r n!+ 2 ⌋ (n ∈ N ).

Proof. Recall that an |r|-cyclic derangement of C|r| × [n] is an element of C|r| ≀ Sn whose action on C|r| × [n] has no fixed point. By using inclusion-exclusion we have n n n n a(n, r)=(−1)n (−1)n−k (−r)kk! = rkk!. k ! k Xk=0   Xk=0   1/r n We continue to let Rr,n be as it was defined in (11) so that e r n!= a(n, r)+Rr,n. For all positive integers n we have |r|−1 |r|−2 |r|−3 −R = − + −··· r,n n +1 (n + 1)(n + 2) (n + 1)(n + 2)(n + 3) ∞ |r|−2ℓ+1 = (n +2ℓ) −|r|−1 . (12) (n + 1)(n + 2) ··· (n +2ℓ) Xℓ=1   Clearly each summand of (12) is positive, so Rr,n is negative. We will show that |Rr,n| is a decreasing function of n by considering each summand individually. Regarding the summand of (12) as a function of a continuous variable n, the expression has log-derivative

d 2ℓ log(|r|−2ℓ+1) + log(n +2ℓ −|r|−1) − log(n + k) dn  Xk=1  1 2ℓ 1 = − . (13) n +2ℓ −|r|−1 n + k Xk=1 Since |r| ≥ 1, we have the bounds 1 1 2ℓ 1 ≤ < , n +2ℓ −|r|−1 n +2ℓ − 1 n + k Xk=1 14 ANDREWO’DESKYANDDAVIDHARRYRICHMAN which imply that (13) is negative. Therefore each (positive) summand in (12) is decreasing as a function of n. This shows in particular that |Rr,n|≤|Rr,1|. We have 1 r 1 |Rr,1| =1+ r − re ∈ (0, 2 ) for r ≤ −1. Thus we have 1 n e r r n!= a(n, r)+ Rr,n 1 with Rr,n ∈ (− 2 , 0). This shows that for all n ≥ 1, 1 r n 1 1  ⌊e r n!+ 2 ⌋ = ⌊a(n, r)+ Rr,n + 2 ⌋ = a(n, r).

4. The p-adic incomplete gamma function In 1975, Morita [19] discovered a p-adic counterpart to the gamma function. In this section, we show that the incomplete gamma function also has a p-adic counterpart. 4.1. The classical incomplete gamma function. First we recall the construc- tion of the incomplete gamma function. Let s ∈ C. Let ωs denote the differential given by dt ω (t) := tse−t s t where we take the principal value for ts = exp(s log t). We choose the branch cut to be (−∞, 0] so that ωs is holomorphic and single-valued on the domain U = C \ (−∞, 0]. For any oriented half-infinite curve γ in U tending towards positive infinity, the integral γ ωs converges and defines a holomorphic function of s. We obtain, for any complex number z ∈ U, the entire function of s given by R

Γ(s, z) := ωs Zγ where γ is any curve in U beginning at z and tending to positive infinity. This defines the incomplete gamma function Γ: C × U → C. By Hartog’s theorem, Γ(s, z) is an analytic function of two variables. The incomplete gamma function also admits the series expression [6, Eq. 2.6.3] ∞ (−z)n Γ(s, z)=Γ(s) − zs , z ∈ U, s 6∈ {0, −1, −2,...}. n!(n + s) n=0 X Clearly the incomplete gamma function recovers the gamma function in the limit as z goes to zero: lim Γ(s, z)=Γ(s). z→0+ DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 15

In general, the incomplete gamma function takes different values as z ap- proaches the branch cut from the positive- and negative-imaginary directions. Explicitly, for arbitrary s ∈ C and z on the negative real axis we have Γ(s, z + i0+)= e2πisΓ(s, z − i0+)+(1 − e2πis)Γ(s) (14) where we use the notation f(0+) = lim f(ǫ); see [8, Eq. 8.2.9]. If we restrict s to ǫ→0+ be a positive integer, then this formula shows that Γ(s, z) extends continuously in the second variable across the branch cut, so the incomplete gamma function extends to the domain Γ: (C × U) ∪ (N>0 × C) → C. The incomplete gamma function is closely related to the combinatorial function a(n, r) counting cyclic derangements and arrangements. Just as the count of all permutations is interpolated by the gamma function, the counts of cyclic derangements and cyclic arrangements are interpolated by the incomplete gamma function (up to an explicit entire function). Recall from §3 that we extended the combinatorial definition of a(n, r) to n n a(n, r)= k!rk k Xk=0   for arbitrary r. Proposition 4.1. Let z ∈ C× be fixed. The function defined by s 7→ Γ(1 + s, z)z−sez is entire and equal to a(s, 1/z) whenever s ∈ N. Note that by (14), the expression Γ(1 + s, z) is defined for (s, z) ∈ N>0 × C× even if z is on the negative real axis. Proof. The function z−s = exp(−s log z) is entire in the argument s, where we take the principal value for the logarithm to determine the constant log z, and Γ(1 + s, z) is entire in s. This proves the first part of the proposition. By [8, Eq. 8.7.3], for any (s, z) ∈ N>0 × C we have

∞ zk Γ(s, z)=Γ(s) 1 − zse−z . Γ(s + k + 1)! Xk=0 Using that Γ(s + k +1)Γ(s)−1 =(s + k) ··· (s +1)s and writing s =1+ n we have

∞ zk Γ(1 + n, z)= n! 1 − z1+ne−z (n + k + 1)!! Xk=0 ∞ zk = n! 1 − e−z k! ! k=Xn+1 16 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

∞ zk = n!e−z ez − k! ! k=Xn+1 n zk = n!e−z k! Xk=0 n n! = e−z zn−k = a(n, 1/z)zne−z. (n − k)! Xk=0 Rearranging terms proves the proposition.  Remark 1. The proposition shows that for any r ∈ C× and positive integer n, n n! Γ(n +1, 1/r)= e−1/r rk−n = a(n, r)r−ne−1/r. (15) (n − k)! Xk=0 Thus the incomplete gamma function essentially interpolates the counts of cyclic arrangements and cyclic derangements (up to the factor r−ne−1/r), similarly to how the gamma function interpolates the count of all permutations in Sn. Corollary 4.2. For any z ∈ C×, Q({Γ(n, z): n ∈ N>0})= Q(z, ez). Proof. From Proposition 4.1 it is easily seen that for any positive integer n, Γ(n, z) is a polynomial function in z and ez. This shows that Q({Γ(n, z): n ∈ N>0}) ⊂ Q(z, ez). Moreover, we also find that

z Γ(2,z) e = Γ(1, z) and z = Γ(1,z) − 1, proving that Q(z, ez) ⊂ Q({Γ(n, z): n ∈ N>0}). 

4.2. The p-adic incomplete gamma function. We will interpolate the in- complete gamma function on its integral values (n, r) ∈ N>0 × Z. Before doing so, it is necessary to realize the integral values of the incomplete gamma function (which are transcendental) as p-adic numbers. As we shall see, there is a natural way of doing this. The field generated by the integral values of the incomplete gamma function is Q({Γ(n, r):(n, r) ∈ N>0 × Z})= Q(e) by Corollary 4.2. Therefore, to obtain a homomorphism from the field generated by {Γ(n, r):(n, r) ∈ N>0 ×Z} to the field of p-adic numbers, it suffices to specify a transcendental element of Qp corresponding to e. Let τp : Q(e) → Qp be the unique field homomorphism satisfying −1 2 3 τp(e ) = expp(p)=1+ p + p /2!+ p /3! + ··· .

The element expp(p) ∈ Qp is transcendental over Q (cf. [1, §3]). We now proceed to prove the existence of a p-adic analogue of the incomplete gamma function. DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 17

Theorem 4.3 (Theorem 1.1). There exists a continuous function

Γp : Zp × (1 + pZp) → Zp satisfying

Γp(n, r)= τpΓ(n, r) for any positive integers n and r satisfying r ≡ 1 (mod p). Proof. We have that

n−1 −r n−1 −r τpΓ(n, r)= τp a(n − 1, 1/r)r e = a(n − 1, 1/r)r τp(e ) by Proposition 4.1. We will show that each of the three functions (n, r) 7→ n−1 −r a(n − 1, 1/r), (n, r) 7→ r , and r 7→ τp(e ) is interpolated by a uniformly continuous function in the p-adic topology. We have already proven in Theorem 3.5 that (n, r) 7→ a(n, r) extends to the metric map Zp × Zp → Zp given by the Mahler series (8)

∞ y a(y,s)= skk! for (y,s) ∈ Z × Z . k p p Xk=0   This suffices to prove that (n, r) 7→ a(n − 1, 1/r) is interpolated by a metric map, hence interpolated by a uniformly continuous map. Let expp : Zp → 1+ pZp (resp. logp :1+ pZp → Zp) denote the p-adic ex- ponential (resp. p-adic logarithm). Then, for any positive integers n and r n satisfying r ≡ 1 (mod p), we have that r = expp(n logp r). Therefore the func- tion Zp × (1 + pZp) → Zp : (x, s) 7→ expp(x logp s) is a continuous extension of >0 n N × (1 + pN) → Zp : (n, r) 7→ r which is also uniformly continuous since Zp × (1 + pZp) is compact. >0 −r r Finally, N → Zp : r 7→ τp(e ) = expp(p) is interpolated by the p-adic locally analytic function Zp → Zp : r 7→ expp(pr) (cf. Example 6), which is also uniformly continuous since Zp is compact. Any uniformly continuous function f : U → Y mapping to a complete metric space Y and defined on a dense subset U ⊂ X of a topological space X extends uniquely to a uniformly continuous function X → Y . We conclude that τpΓ(n, r) is interpolated by the uniformly continuous function

y−1 Γp(y,r)= r expp(pr)a(y − 1, 1/r) (16) for (y,r) ∈ Zp × (1 + pZp). 

We now prove a few facts about the p-adic incomplete gamma function.

Theorem 4.4. Let Γp : Zp ×(1+pZp) → Zp denote the p-adic incomplete gamma function. 18 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

(1) For any y ∈ Zp and r ∈ 1+ pZp we have the series expression ∞ y − 1 Γ (y,r)= ry−k−1 exp (pr)k! . p p k Xk=0   (2) For any n ∈ N and r ∈ Z satisfying r ≡ 1 (mod p), we have

1/r n 1 −n ⌊e r n!+ 2 ⌋ if r< 0, Γp(n +1, 1/r)= r expp(p/r) · 1/r n (⌊e r n!⌋ if r> 0.

(3) For any n ∈ N and r ∈ 1+ pZp, we have

Γp(n +1,r) = expp(pr)n!fn(r)

where fn(X) is the nth truncated exponential polynomial 1 2 1 n fn(X) := 1 + X + 2! X + ··· + n! X (n ≥ 1). Proof. The first formula follows at once from (16) and (8). The second formula follows from (16) and (10). The third formula follows from (16) and the formula n n! n 1 a(n, r)= rk = rnn! r−k = rnn!f (1/r).  (n − k)! k! n Xk=0 Xk=0 Theorem 4.5. Γp has finitely many zeros in Zp × (1 + pZp).

Observe that if (y,r) ∈ Zp × (1 + pZp) is a zero of Γp, then the formula y−1 Γp(y,r) = r expp(pr)a(y − 1, 1/r) shows that (y − 1, 1/r) is a zero of a (the y −y formulas 1 = r r = expp(x) expp(−x) show that the other terms never vanish). The result now follows from the next proposition.

× (p−1)−1 Proposition 4.6. Let r ∈ Cp and suppose |r|p

finitely many zeros (cf. e.g. [20, §9]). Thus the restriction of a( · ,r) to D is identically zero. Let m and n be distinct integers chosen from D ∩ N (this is possible because N is dense in Zp). By assumption a(m, r)= a(n, r) = 0. We have n n! n 1 a(n, r)= rk = rnn! r−k = rnn!f (1/r). (17) (n − k)! k! n Xk=0 Xk=0 This implies that 1/r is a root of fm(X) as well as fn(X). These polynomials are both irreducible over Q by a classical theorem of Schur [27], implying that the degree of 1/r as an algebraic number is simultaneously equal to m and n, a contradiction. This implies S is finite.  Remark 2. Formula (17) shows that for any given r, a(s,r) has at most one zero in N, and that a(n, r) = 0 if and only if 1/r is a root of the nth truncated exponential polynomial 1 1 f (X)=1+ X + X2 + ··· + Xn. n 2! n!

For instance, f1(X)=1+X and a(1, −1) = 0. Combinatorially, this corresponds to the fact that the trivial symmetric group S1 has no permutations without a fixed point. By Schur’s irreducibility result, this is the only solution in (r, n) ∈ Z × N to the equation a(n, r) = 0.

5. Cycle-restricted permutations A classical derangement may be thought of as a permutation with no cycle of length one. Let L ⊂ N>0 be any subset, which we consider as the set of ‘permitted’ cycle lengths. Define the count of ‘permissible’ permutations, L dn := #{σ ∈ Sn : every cycle length of σ is in L}. The main result of this section is the following theorem. Theorem 5.1 (Theorem 1.3). Let L be a set of positive integers. L (a) Suppose 1 ∈ L. Then the function n 7→ dn is p-adically continuous if and only if p 6∈ L. n L (b) Suppose 1 6∈ L. Then the function n 7→ (−1) dn is p-adically continuous if and only if p ∈ L. We explicitly record a corollary for the cases when L either contains all primes or no primes. Corollary 5.2. Let L be a set of positive integers. If L does not contain any L∪{1} prime number, then the function n 7→ dn is p-adically continuous for every n L\{1} prime p. If L contains every prime number, then n 7→ (−1) dn is p-adically continuous for every prime p. 20 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

Particular instances of this general class of combinatorial sequences have been Lp studied before. We have already mentioned that the function n 7→ dn for Lp = {1,p,p2,p3,...} has appeared in connection with the Artin–Hasse exponential. Daniel Barsky informed us of another instance appearing in the literature. In {1,p} {1,p} [13], the p-adic valuation of n 7→ dn is studied (the permutation count dn is equal to the number of homomorphisms from Z/pZ to Sn, which is equivalent to the count in their title). We record a few more examples of Theorem 5.1 in addition to the examples in the introduction. For brevity, we write PL for the set of primes for which the displayed sequence (depending on L) extends to a p-adic continuous function on Zp. Example 9 (Prime numbers and complement). If L := {2, 3, 5, 7,...} consists of the prime numbers, then n L ((−1) dn )=(1, 0, 1, −2, 3, −44, 55, −1434, 3913, −39752,...) and PL = {all primes}. If L′ := N>0 \ L, then

L′ (dn )=(1, 1, 1, 1, 7, 31, 211, 1051, 10081, 107857,...) and PL′ = {all primes} also.

2 3 n L(p) Example 10 (Artin–Hasse again). If L(p) = {p,p ,p ,...}, then (−1) dn is X the nth Taylor coefficient of e Ep(−X) and PL(p) = {p}. For instance, if p = 3 we have 1 1 19 73 181 eX E (−X)=1 − X3 + X6 − X9 + X12 − X15 + O(X18) 3 3 18 162 1944 29160 and

n L(3) ((−1) dn )=(1, 0, 0, −2, 0, 0, 40, 0, 0, −42560, 0, 0, 17987200, 0, 0,...). 5.1. Infinite products of exponentials. For the proof of Theorem 5.1 we shall need to consider infinite products of exponentials of the form Xr mr exp r r≥1 Y   for any sequence of integers m1, m2,.... Any such product defines a formal power series with rational coefficients. While the convergence of this product is auto- matic in the X-adic topology, we shall need to consider convergence with respect to a finer topology for which the convergence of this product is not guaranteed. This topology comes from a certain Banach Qp-algebra that we now define. For basic facts about Banach algebras over nonarchimedean fields we refer the reader to [26]. DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 21

Let p be a fixed prime number. Let Qp[[X]] denote the ring of formal power series with coefficients in Qp. Given a sequence of numbers a0, a1, a2,... ∈ Qp, the associated exponential generating function is the formal power series Xn F (X)= a . n n! n≥0 X We will be interested in particular in power series of the form Xn f(n) where f : Z → Q is a continuous function . n! p p (n≥0 ) X This family of power series is closed under addition but not under multiplica- tion. It is closely related to the following subset of Qp[[X]], which is closed under addition and multiplication.

exp Definition 5.3. Let Qp{X} denote the set of all formal power series ∞ Xn F (X)= a where |a | → 0 as n →∞. n n! n p n=0 X exp We will equip Qp{X} with a norm which makes it into a Banach Qp-algebra. ∞ Xn Define the norm of F (X)= n=0 an n! ∈ Qp[[X]] to be P kF k = sup |an|p. (18) n≥0 exp Proposition 5.4. The norm defined by (18) makes Qp{X} into a Banach Qp- algebra. This Banach Qp-algebra is the completion of the polynomial ring Qp[X] for this norm.

exp Proof. The second statement is clear from the definition of Qp{X} . To see exp that this makes Qp{X} into a Banach Qp-algebra we must verify that k·k is ∞ Xn ∞ Xn submultiplicative. Let F (X) = n=0 an n! and G(X) = n=0 bn n! . We have that PXn n nP F (X)G(X)= c where c = a b . (19) n n! n k n−k k n≥0 k=0   X X n Then by the ultrametric triangle inequality for |·|p and the fact that | k |p ≤ 1, n n  kF · Gk = sup cn−kdk ≤ sup |am|p · sup |bn|p = kF kkGk . n≥0 k p m≥0 n≥0 Xk=0   exp  It follows that (Qp{X } , k·k) is a Banach Qp-algebra. Remark (Tate algebras, restricted power series). The ring of restricted power n series, denoted Qp{X}, consists of power series F (X) = n≥0 anX with coef- ficients in Q satisfying the condition |a | → 0 as n → ∞. The ring Q {X} p n p P p 22 ANDREWO’DESKYANDDAVIDHARRYRICHMAN is also known as the Tate algebra in one variable; see [24, Chapter 5.2]. More generally, for any real number r > 0 we have the ring of power series

−1 n n Qp{r X} = anX : an ∈ Qp and |an|pr → 0 as n →∞ . n≥0  X  −1 The power series in Qp{r X} are precisely those power series over Qp which converge when evaluated on the closed disk {x ∈ K : |x|p ≤ r}, where K is a valued field extension of Qp which contains elements with norm |x|p = r. exp The ring Qp{X} defined above is not equal to any of these. Let ρ := 1/n −(p−1)−1 limn→∞ |n!|p = p . Then it can be shown that

−1 exp −1 Qp{r X} ⊂ Qp{X} ⊂ Qp{ρ X}, r>ρ [ and both inclusions are strict.

exp In the next proposition, we consider the relation between Qp{X} and the collection of exponential generating functions F (X) whose coefficients come from a continuous function f : Zp → Qp. N Q ∞ Xn Proposition 5.5. Let f : → p be a function and let F (X)= n=0 f(n) n! . The following statements are equivalent: P ∞ Xn (a) F (X)= f˜(n) for a continuous function f˜ : Z → Q , i.e. the function n! p p n=0 X n 7→ f(n) extends continuously to Zp. ∞ Xn (b) G(X) = c(n) is in Q {X}exp, where c(n) is the nth finite difference n! p n=0 of f, i.e. X n n c(n)= (−1)n−k f(k). k Xk=0   −X exp (c) G(X)= e F (X) is in Qp{X} . Proof. The equivalence of (a) and (b) is the content of Mahler’s theorem [17], which states that a function f : N → Qp extends to a p-adic continuous function f˜ : Zp → Qp if and only if the sequence c(n) of finite differences of f goes to zero p-adically as n →∞. The equivalence of (b) and (c) follows from the product relation (19).  We now turn to the class of formal power series defined by infinite products of the form Xr mr exp r r≥1 Y   DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 23 for a sequence of integers m1, m2,.... This product always defines a formal power series in Qp[[X]]. The following theorem gives a necessary and sufficient condition exp for this infinite product to be in Qp{X} . Theorem 5.6. The formal power series Xr mr G(X)= exp r r≥1 Y   exp is in Qp{X} if and only if m1 ≡ mp (mod p). Before giving the proof we establish a few lemmas.

mX exp Lemma 5.7. The power series e is in Qp{X} if and only if m is a multiple of p. Proof. We have Xn emX = mn . n! n≥0 X n n If p divides m, then |m|p < 1 and |m |p = |m|p → 0 as n → ∞. On the other n hand if p does not divide m, then |m|p = 1, so |m |p = 1 for all n ≥ 1.  Lemma 5.8. Let r be a positive integer and let ǫ ∈ {±1}. Then exp(ǫXr/r) is exp in Qp{X} if and only if r 6∈ {1,p}. Proof. We have ǫXr 1 ǫXr n ǫn(rn)! Xrn exp = = . r n! r rnn! (rn)! n≥0 n≥0   X   X Observe that (rn)! = k. (20) rnn! 1≤k≤rn kY6∈rZ If r = 1 then the product is empty while if r = p then every term is coprime to p. For any other value of r, the product (20) goes to zero p-adically. 

Lemma 5.9. Let r1,r2,... be a sequence of positive integers such that ri 6∈ {1,p} for all i and lim ri = ∞, and let ǫi ∈ {±1}. Then the formal power series defined i→∞ by the infinite product ∞ Xri exp ǫ i r i=1 i Y   exp is in Qp{X} . 24 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

N ri Proof. Let GN = i=1 exp(ǫiX /ri) denote the partial product. Each factor ri exp exp(ǫiX /ri) is in Qp{X} by Lemma 5.8, hence GN is also for every N ≥ 1. Q exp By completeness of Qp{X} , it suffices to show that (GN )N≥1 is a Cauchy sequence. For any positive integer r we have that Xr (rn)! exp ± = sup n = sup k ≤ 1. r n≥0 r n! n≥0   p 1≤k≤rn p kY6∈rZ

By submultiplicativity of the norm, this implies that kGN k ≤ 1. Moreover, note that Xr (rn)! exp ± − 1 = sup n = sup k ≤ (r − 1)! p. r n≥1 r n! n≥1   p 1≤k≤rn p kY6∈rZ

Then,

XrN+1 kG − G k≤kG k exp ǫ − 1 ≤|(r − 1)!| . N+1 N N N+1 r N+1 p  N+1 

By the ultrametric triangle inequality, this implies that for indices N ≤ M,

kGM − GN k ≤ max kGi+1 − Gik ≤ max |(rN+1 − 1)!|p. N≤i≤M−1 N≤i≤M−1

This bound approaches 0 as N → ∞, by the hypothesis that the integers ri go to infinity. This verifies that (GN )N≥1 is a Cauchy sequence which proves the lemma. 

r exp Proof of Theorem 5.6. Suppose r =16 or p. Then exp(±X /r) is in Qp{X} by exp exp Lemma 5.8. Since Qp{X} is closed under finite products, Qp{X} contains exp(Xr/r)mr . exp Next we claim Qp{X} contains the formal power series Xr mr exp . (21) r rY6=1,p   If the sequence (m1, m2,...) is eventually zero, then this product is finite so it lies exp in Qp{X} because each of its factors does. If (m1, m2,...) is not eventually exp zero, then Lemma 5.9 shows that the product (21) is in Qp{X} , as we explain ′ ′ ′ below. Let mi := mi if i =6 1,p, and m1 = mp := 0. Define sequences r1,r2,... ′ ′ and ǫ1, ǫ2,... as follows. For any positive integer i set Mi := |m1| + ··· + |mi|.

Let each of r1,...,rM1 be equal to 1, let each of rM1+1,...,rM2 be equal to 2, and generally let each of rMi+1,...,rMi+1 be equal to i + 1. Similarly, let each of ′ ′ ǫ1,...,ǫM1 be equal to sgn(m1), let each of ǫM1+1,...,ǫM2 be equal to sgn(m2), DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 25

′ and generally let each of ǫMi+1,...,ǫMi+1 be equal to sgn(mi+1). Then we have that m ∞ m′ ∞ Xr r Xr r Xri exp = exp = exp ǫ . r r i r r=1 i=1 i rY6=1,p   Y   Y   Since the sequence m1, m2,... is not eventually zero, the sequence ri goes to exp infinity as i →∞. Now applying Lemma 5.9 shows that Qp{X} contains the infinite product (21). Finally, consider the general case Xp mp Xr mr G(X) = exp(X)m1 exp exp . p r   rY6=1,p   exp exp Since Qp{X} is closed under multiplication, Qp{X} contains G(X) if and only if it contains Xr −mr Xp mp G(X) exp = exp(X)m1 exp . r p rY6=1,p     1 Xn exp Note that 1−X = n≥0 n! n! is in Qp{X} for every p, and this series factors r as the infinite product exp X = exp(− log(1 − X)). It follows that P r≥1 r Q 1  Xr m = exp (1 − X)m r r≥1 Y   exp exp is in Qp{X} for any integer m. Thus G(X) is in Qp{X} if and only if

Xr mp−mr G(X)(1 − X)mp exp = exp(X)m1−mp r rY6=1,p   exp m1−mp exp is in Qp{X} . By Lemma 5.7, exp(X) is in Qp{X} if and only if m1 − mp ≡ 0 (mod p). This completes the proof. 

5.2. Proof of Theorem 5.1. Recall that

L dn := #{σ ∈ Sn : every cycle length of σ is in L}.

L n L where L is a set of positive integers. To prove that either n 7→ dn or n 7→ (−1) dn admits a continuous extension to Zp, it is the same to show that the expo- nential generating function of its finite differences is in the Banach Qp-algebra exp Qp{X} ⊂ Qp[[X]] (Proposition 5.5). To achieve this we will express the expo- L nential generating function of the sequence n 7→ dn as a certain infinite product over L, and then use Lemma 5.9 to establish convergence. 26 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

L Proposition 5.10. Let L be a set of positive integers, and let dn be the number of permutations in Sn whose cycle lengths are in L. Then the exponential generating L function of the sequence dn factors as Xn Xr dL = exp . (22) n n! r n≥0 r∈L X Y   For the proof we make use of the theory of combinatorial species. We refer the reader to [7] for the basic facts and definitions.

Proof. Suppose we count the numbers of permutations in Sn which consist of a single r-cycle and no 1-cycles if r > 1. This gives (r − 1)! if n = r, #{σ ∈ Sn : σ is an r-cycle} = (0 otherwise. 1 r The exponential generating function of this sequence is r X . By the theory of combinatorial species, this means that for fixed r, the exponential generating function of the sequence

n 7→ #{σ ∈ Sn : σ decomposes into disjoint r-cycles} is the exponential exp(Xr/r). L As the definition of dn only involves cycle lengths it is clear that it is associated with a combinatorial species C. A result from the theory of combinatorial species says that the product of the exponential generating functions of two species A and B is the exponential generating function of the species where we partition [n] into disjoint subsets S ⊔ T , and impose an A-species on S and a B-species on T . This generalizes by induction to finite products. Consider the combinatorial species given by {σ ∈ S : every cycle length of σ is in L} if n ≤ N, [n] 7→ n (∅ otherwise. N L Xn The exponential generating function of this species is n=0 dn n! , which factors as N Xn P dL = exp(Xr/r)= exp(Xr/r) (mod XN+1). n n! n=0 r∈L r∈L X rY≤N Y Taking the limit as N →∞ (in the X-adic topology on Q[[X]]) verifies (22).  We can now prove Theorem 5.1. We recall the following useful and well-known formula which relates the exponential generating functions of a sequence f and its finite differences c, Xn Xn f(n) = eX c(n) . n! n! n≥0 n≥0 X X DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 27

(This follows immediately from (4) and (19).) Proof of Theorem 5.1. By Proposition 5.10, the exponential generating function L F (X) of dn is equal to Xn F (X)= dL = exp(Xk/k)mk n n! n≥0 X kY≥1 where mk is 1 if k ∈ L and zero otherwise. Hence the exponential generating L function G(X) of the sequence of finite differences of dn is G(X) = exp(−X)F (X) = exp(X)m1−1 exp(Xk/k)mk . kY≥2 L The function n 7→ dn extends to a p-adic continuous function if and only if exp G(X) ∈ Qp{X} by Mahler’s theorem (in the form of Proposition 5.5). exp Suppose 1 ∈ L. By Theorem 5.6, G(X) ∈ Qp{X} if and only if

m1 − 1=0 ≡ mp (mod p). L This shows that the function n 7→ dn extends to a p-adic continuous function if and only if p 6∈ L. Suppose 1 6∈ L. Then the exponential generating function H(X) of the se- n L quence of finite differences of (−1) dn is k H(X) = exp(−X)F (−X) = exp(X)−m1−1 exp(Xk/k)(−1) mk . kY≥2 exp By Theorem 5.6, H(X) ∈ Qp{X} if and only if p −m1 − 1= −1 ≡ (−1) mp (mod p). (23)

If mp = 0 then (23) is not satisfied, while if mp = 1 then (23) is satisfied since (−1)p ≡ −1 (mod p). This concludes the proof. 

6. Questions for future work We conclude with some natural number-theoretic and combinatorial questions which may serve as a basis for future work. Throughout this section let p be a prime integer. 6.1. The p-adic incomplete gamma function. The classical gamma function Γ(s) is recovered from the incomplete gamma function Γ(s, z) in the archimedean limit z → 0+. Question 1. Can Morita’s p-adic gamma function be recovered from the p-adic incomplete gamma function? Morita’s p-adic gamma function is related to Gauss sums by the Gross–Koblitz formula [9] which gives a factorization of Gauss sums in terms of values of the p-adic gamma function. 28 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

Question 2. Is there an analogue of the Gross–Koblitz formula for the p-adic incomplete gamma function? 6.2. The sum of factorials: questions of Schikhof and Kurepa. We extend two open questions of Schikhof and Kurepa. Let ap : Zp × Zp → Zp denote the unique continuous extension of (1) counting cyclic arrangements and derange- 1 ments. The quantity ap(−1,r) is closely related to the sum of factorials , 1+1+2!+3!+4!+5!+ ··· . One easily deduces from the series expression in (5) that

ap(−1, −1)=1+1+2!+3!+4!+ ··· .

In 1984, Schikhof [25, p. 17] asked (in our notation) whether ap(−1, −1) is in Q ∩ Zp for some prime p. R. Murty–Sumner [21] conjectured that ap(−1, −1) is not a rational number for any prime p. More generally, we ask the same question of ap(−1,r).

Question 3. Do there exist a prime p and a nonzero integer r such that ap(−1,r) ∈ Q ∩ Zp? Kurepa [15] asked whether 0!+1!+ ··· + n! 6≡ 0 (mod n) (24) for all integers n greater than 2, which remains an open problem. The congruence (24) has been verified computationally if n ≤ 106 [10, B44]. If n is an odd prime p, then (in our notation) this amounts to asking whether ap(−1, −1) is a p-adic unit. Indeed, it is easily shown from the Mahler series (7) of ap that for any r ∈ Zp, ∞ p−1 k k ap(−1,r)= (−r) k! ≡ (−r) k! (mod p). Xk=0 Xk=0 In particular, ap(−1, −1) is a p-adic unit if and only if 0!+1!+ ··· +(p − 1)! 6≡ 0 (mod p). This has been verified computationally for all odd primes p< 234, cf. [3]. Question 4. Let r be a p-adic unit and p an odd prime. Under what conditions on r and p is ∞ k ap(−1,r)= (−r) k! Xk=0 a p-adic unit?

1We remark that Euler studied ways to assign an archimedean value for this divergent series, see [16, §2.5]. DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 29

6.3. p-adic combinatorial interpretations. Theorem 1.2 implies that expres- sions for the number dn of derangements in Sn outside of the classical range of definition can be computed relative to a given prime. In particular, for any prime p, the limit (in the p-adic topology)

d−1,p := lim dpn−1 n→∞ exists and can be interpreted as “the number of derangements on the set with −1 elements.”

Question 5. Is there a combinatorial interpretation for the p-adic number d−1,p? Another consequence of Theorem 1.2 concerns p-adic fixed points. Let r ∈ Z\{0} and c ∈ pZ. The map

Tc(x) := cap(x, r) is a contraction mapping of Zp. By the Banach fixed point theorem, Tc has a ∗ unique fixed point sc,r ∈ Zp. This p-adic number is characterized by the equation

∗ 1 ∗ ap(sc,r,r)= c sc,r. It can be expressed as ∗ ◦N sc,r = lim Tc (0) N→∞ ∗ (sc,r is independent of the choice of initial point 0 ∈ Zp). Question 6. Let r be a nonzero integer, p a prime, and c ∈ pZ. Is there a ∗ combinatorial interpretation for sc,r?

∗ For example, when c = p = 2 and r = −1 we have s2,−1 = 2. For c = p = 2 and r = 1 one finds that

∗ 3 6 8 10 12 s2,1 =2+2 +2 +2 +2 + O(2 ). For c = p = 3 and r = 1,

∗ 2 3 4 5 6 s3,1 =3+2 · 3 +2 · 3 +2 · 3 +3 + O(3 ).

Acknowledgements We are grateful to Daniel Barsky and Julian Rosen for pointing out an error on an earlier version of this manuscript. We thank Jeff Lagarias for some helpful comments. We also thank A. Suki Dasher for a valuable suggestion which led to the connection with the incomplete gamma function. 30 ANDREWO’DESKYANDDAVIDHARRYRICHMAN

References [1] W. W. Adams. Transcendental numbers in the p-adic domain. American Journal of Math- ematics, 88(2):279–308, 1966. [2] Y. Amice. Interpolation p-adique. Bull. Soc. Math. France, 92:117–180, 1964. [3] V. Andreji´cand M. Tatarevic. Searching for a counterexample to Kurepa’s conjecture. Math. Comp., 85(302):3061–3068, 2016. [4] S. H. Assaf. Cyclic derangements. Electron. J. Combin., 17(1):Research Paper 163, 14, 2010. [5] D. Barsky. Analyse p-adique et suites classiques de nombres. S´eminaire Lotharingien de combinatoire, 1981. [6] R. Beals and R. Wong. Special functions, volume 126 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 2010. A graduate text. [7] F. Bergeron, G. Labelle, and P. Leroux. Combinatorial species and tree-like structures, volume 67 of Encyclopedia of Mathematics and its Applications. Cambridge University Press, Cambridge, 1998. Translated from the 1994 French original by Margaret Readdy, With a foreword by Gian-Carlo Rota. [8] NIST Digital Library of Mathematical Functions. http://dlmf.nist.gov/, Release 1.0.28 of 2020-09-15. F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller, B. V. Saunders, H. S. Cohl, and M. A. McClain, eds. [9] B. H. Gross and N. Koblitz. Gauss sums and the p-adic Γ-function. Ann. of Math. (2), 109(3):569–581, 1979. [10] R. Guy. Unsolved problems in number theory, volume 1. Springer Science & Business Media, 2004. [11] R. R. Hall. On pseudo-polynomials. Mathematika, 18:71–77, 1971. [12] M. Hassani. Derangements and applications. J. Integer Seq., 6(1):Article 03.1.2, 8, 2003. [13] H. Ishihara, H. Ochiai, Y. Takegahara, and T. Yoshida. p-divisibility of the number of solutions of xp = 1 in a symmetric group. Ann. Comb., 5(2):197–210, 2001. [14] E. Kowalski and K. Soundararajan. Equidistribution from the chinese remainder theorem, 2020. [15] ¯D. Kurepa. On the left factorial function !n. Math. Balkanica, 1:147–153, 1971. [16] J. C. Lagarias. Euler’s constant: Euler’s work and modern developments. Bull. Amer. Math. Soc. (N.S.), 50(4):527–628, 2013. [17] K. Mahler. An interpolation series for continuous functions of a p-adic variable. J. Reine Angew. Math., 199:23–34, 1958. [18] P. Miska. Arithmetic properties of the sequence of derangements. J. Number Theory, 163:114–145, 2016. [19] Y. Morita. A p-adic analogue of the Γ-function. J. Fac. Sci. Univ. Tokyo Sect. IA Math., 22(2):255–266, 1975. [20] M. R. Murty. Introduction to p-adic analytic number theory, volume 27 of AMS/IP Studies in Advanced Mathematics. American Mathematical Society, Providence, RI; International Press, Somerville, MA, 2002. ∞ k [21] M. R. Murty and S. Sumner. On the p-adic series n=1 n ·n!. In Number theory, volume 36 of CRM Proc. Lecture Notes, pages 219–227. Amer. Math. Soc., Providence, RI, 2004. [22] A. O’Desky. Functions with integral divided differences,P 2020. [23] V. Pa¸sol and A. Zaharescu. Sondow’s conjecture, convergents to e, and p-adic analytic functions. Math. Z., 292(1-2):499–511, 2019. [24] A. M. Robert. A course in p-adic analysis, volume 198 of Graduate Texts in Mathematics. Springer-Verlag, New York, 2000. DERANGEMENTS AND THE p-ADIC INCOMPLETE GAMMA FUNCTION 31

[25] W. H. Schikhof. Ultrametric calculus, volume 4 of Cambridge Studies in Advanced Mathe- matics. Cambridge University Press, Cambridge, 2006. [26] P. Schneider. Nonarchimedean functional analysis. Springer Monographs in Mathematics. Springer-Verlag, Berlin, 2002. [27] I. Schur. Einige S¨atze ¨uber Primzahlen mit Anwendungen auf Irreduzibilit¨atsfragen I, II. Sitzungsberichte Preuss. Akad. Wiss. Phys.-Math. Klasse, pages 125–136, 152–173, 1929. [28] G. Serafin. Identities behind some congruences for r-Bell and derangement polynomials. Res. Number Theory, 6(4):Paper No. 39, 8, 2020. [29] Y. Sun, X. Wu, and J. Zhuang. Congruences on the Bell polynomials and the derangement polynomials. J. Number Theory, 133(5):1564–1571, 2013. [30] Z.-W. Sun and D. Zagier. On a curious property of Bell numbers. Bull. Aust. Math. Soc., 84(1):153–158, 2011.

Department of Mathematics Princeton University Princeton, NJ 08544-1000, USA URL: https://www.andrewodesky.com/ Email address: [email protected] Department of Mathematics University of Washington Seattle, WA 98195-4350, USA Email address: [email protected]