Rigged Horse Numbers and their Modular Periodicity

Benjamin Schreyer Departments of Computer Science and Physics University of Maryland College Park, Maryland 20742 USA and Plasma Physics Division U.S. Naval Research Laboratory Washington, D.C. 20375 USA

               benontheplanet@gmail.com

Abstract

The Fubini numbers count the permutations of horse racing where ties are possible. The closely related r-horse numbers count the finishes of a horse race where some subset of r horses agree to finish the race in a specific relative strong ordering. We express the r-Fubini numbers as a sum of r index-shifted sequences of Fubini numbers weighted with the signed Stirling numbers of the first kind. We use a novel shift operator counting argument. Further, we demonstrate the eventual modular periodicity of r-Fubini numbers. Their maximum period is determined to be the Carmichael function of the modulus. The maximum period occurs in the case of an odd modulus for Fubini numbers.

1 Introduction

1.1 Orderings weak and strong

The notation ℕ denotes the set of positive integers. The symbol ℕ_{0} = ℕ ∪ {0} represents the set of nonnegative integers.

Definition 1. Fubini numbers, denoted F (n), count weak orderings of n elements, with n ∈ ℕ_{0}.

In the case of a horse race, the ordering is weak, an equivalence determines a tie, and strict less-than or greater-than relations determine a clear succession of horses. The horse numbers or ordered Bell numbers are other common names for the number of weak orderings. When ties are impossible, these orderings become regular (strong) permutations. Velleman and Call [12] gave another intuitive example for Fubini number counting: the number of combinations for a combination lock in which all buttons are used exactly once, and multiple buttons can be pressed simultaneously.

1.2 Rigged weak orderings

Definition 2. The constraint of relative strong ordering applies to a subset X′ of a weakly ordered set X. The constraint demands that relations between elements of X′ are only strict less-than or greater-than relations. An element x′ ∈ X′ can be set equivalent to another x only if x ∉ X′.

Definition 3. The r-Fubini numbers, F_{r}(n), count weak orderings of a set with cardinality n such that r elements are distinguished and constrained to follow relative strong ordering.

Definition 4. The r-horse numbers, H_{r}(n), count weak orderings such that r elements of a set of cardinality n are distinguished and constrained to follow a specified strong permutation relative to each other.

Every permutation counted by H_{r}(n) has r! rearrangements of the specified permutation x_{1} < x_{2} < ⋯ < x_{r}. The rearrangements cover all cases where the r elements are mutually inequivalent. We can write this as the equation

r!H_{r}(n) = F_{r}(n).  (1)

The r-horse numbers count a nontrivial restriction on weakly ordered permutations. A restriction where two or more elements must be tied is the same as reducing the effective number of elements in the counting. The equivalent elements act as a single unit in every permutation.

1.3 The Stirling numbers of the first and second kind

Definition 5. The signed Stirling numbers of the first kind, s(n, k), count partitions of n elements into k cycles. The sign gives the parity of n − k. For combinatorics, we have n, k ∈ ℕ_{0}. The two-index sequence s(n, k) can be arranged into a matrix. We index rows with n and columns with k. Let ŝ denote the infinite matrix of s(n, k).

Definition 6. The Stirling numbers of the second kind, S(n, k), count ways to partition a set of n elements into k subsets. The matrix of S(n, k), labeled Ŝ, uses the same indexing as ŝ.

We introduce the Stirling numbers with the addition of three useful properties. The notation I is the identity operation. Advanced Combinatorics [4, Eqn. 6f, p. 144] gives the first proposition.

Proposition 1. The matrices ŝ and Ŝ are inverses of each other, so

ŝŜ = Ŝŝ = I.  (2)

Both ŝ and Ŝ are lower triangular.

Concrete Mathematics [6, Eqn. 6.13, p. 263] provides the second important property.

Proposition 2. The Stirling numbers of the first kind give the coefficients for powers of the argument of the falling factorial, so

x(x − 1) ⋯ (x − n + 1) = ∑_{k=0}^{n} s(n, k)x^{k}.  (3)

The falling factorial of x with n multiplicative terms, x(x − 1) ⋯ (x − n + 1), is written more succinctly as (x)_{n̄}. We give a definition needed to discuss eventual modular periodicity.

Definition 7. A sequence f(n) is eventually periodic modulo K, with K ∈ ℕ, if there exists a q ∈ ℕ such that for large enough a ∈ ℕ_{0}:

f(a) ≡ f(a + q) (mod K).  (4)

Finally, S(n, k), with fixed k, is eventually modular periodic in n under any modulus. The periodicity property can be shown using the following formula from the paper Stirling matrix via Pascal matrix [3, p. 55].

Lemma 3. The Stirling numbers of the second kind have the explicit form

S(n, k) = \frac{1}{k!} ∑_{t=0}^{k}(−1)^{k−t}\binom{k}{t}t^{n}.  (5)

The periodicity of modular exponentiation determines eventual modular periodicity for S(n, k) for fixed k.

1.4 The Carmichael function

Definition 8. The function λ(K) is the Carmichael function. The Carmichael function gives the least common multiple of all periods of integer exponentiation modulo K ∈ ℕ. It is often useful in the context of the multiplicative group of integers modulo K.

The Carmichael function has the following recurrence [5] using Euler’s totient function φ(n):

λ(K) = \begin{cases}φ(K), & if K ∈ \{1, 2, 4\} or n is an odd prime power; \\ \frac{1}{2}φ(K), & if K = 2^{r}, r ≥ 3; \\ lcm(λ(p_{1}), λ(p_{2}), …), & if K = p_{1}^{a_{1}}p_{2}^{a_{2}} ⋯ p_{R}^{a_{R}}. \end{cases} (6)

We state two properties of modular exponentiation [11, p. 190].

Proposition 4. For all a, a ∈ {0, 1, …, K − 1}, we have

a^{R} ≡ a^{λ(K)+R} (mod K).  (7)

Here R = max(R_{1}, R_{2}, …, R_{N}) given K = p_{1}^{R_{1}}p_{2}^{R_{2}} ⋯ p_{N}^{R_{N}}.

For integers coprime to K a stronger statement holds.

Proposition 5. For all b coprime to K

b^{λ(K)} ≡ 1 (mod K).  (8)

1.5 Operations preserving eventual periodicity

Scaling by an integer, addition with another modular periodic sequence, and index shifting preserve the eventual modular periodicity of a sequence. Upper bounds for the period do not change under scaling and shifting. The least common multiple of the sequences’ periods must be considered to include the addition of sequences.

1.6 Shift operators

We use shift operators to formally show that r-Fubini numbers are expressible using the signed Stirling numbers of the first kind.

Definition 9. Operators E and E^{−1} are the left and right shift operators, respectively. We abbreviate repeated shift operations as E^{m} with m ∈ ℤ. A zero shift E^{0} is also the identity operation I.

Computation of the r-Fubini numbers uses the left and right shift operators on the sequence F (0), F (1), …, F (n + r). We only consider one-sided sequences. Shift operators are linear when applied to a sequence. Importantly, sequences also distribute over addition of shift operators, which means (AE^{a} +BE^{b})C(n) = AC(n+a)+BC(n+b). If a sequence of numbers occupies the entries of a vector, a shift operator has a matrix representation. Zero is placed in the first index of the vector sequence when E^{−1} is applied. We introduce vector notation with the upper arrow, indexing by subscript, and provide explicit definitions:

(EC⃗)_{n} = C⃗_{n+1}  (9)
(E^{−1}C⃗)_{n} = \begin{cases}0, & if n = 0; \\ C⃗_{n−1}, & if n ≠ 0. \end{cases}  (10)

1.7 Related works

In this text, the r-horse and r-Fubini counted permutations are indexed by denoting the total number of ordered elements n and the size of the subset that must follow a fixed or arbitrary strong ordering r. Other authors [10] consider a total of n + r elements. Rácz [10] studied related orderings and r-Fubini numbers, referencing an expression in terms of the r-Stirling numbers of the second kind and factorials for F_{r}(n). Broder [2] characterized the r-Stirling numbers and explored related orthogonality relations. Mező gave a proof of periodicity for F_{r}(n) (mod 10) in a paper on last digit periodicity [9], extending a proof by Gross [7]. Further, Asgari and Jahangiri [1] showed the eventual periodicity of the r-Fubini numbers modulo an arbitrary natural number. Asgari and Jahangiri also gave a formula for the period.

1.8 Contributions

We present a new counting proof. The proof shows that a linear composition of shifted Fubini number sequences is the r-Fubini numbers for fixed r. The resulting formula is identical in structure to a formula for the r-Bell numbers, which count r-partitions, derived by Nyul and Kereskényi-Balogh [8, Thm. 4.2]. We further formulate proofs for the eventual modular periodicity of Fubini and r-Fubini numbers, which give an upper bound for their modular eventual period. The upper bound is the Carmichael function λ(K). The natural number K is the modulus. When K is odd, we show that λ(K) is the period. The results apply to the combinatorial problem of r-horse numbers under a division by r!.

2 General rigged orderings of r ≤ n elements

Let G(n) be the number of orderings of a set that contains n elements. The orderings counted observe the restriction of no ties (relative strong ordering) on some subset of m of the n elements. We first establish a lemma required to prove a weighted sum expression for F_{r}(n).

Lemma 6. Consider a set of n elements with G(n) allowed orderings. Including a new element that is inequivalent with some subset of m elements following relative strong ordering gives G(n + 1) − mG(n) = (E − mI)G(n) orderings.

Proof. Consider adding the new element with no restriction. The new number of orderings is G(n + 1), since the new element has no constraint upon it. The number of elements is simply increased. Restricting the counting to permutations with x′ inequivalent to any of the m elements requires the multiplication principle.

When we introduce x′ it can be set equivalent to one of m elements to form a disallowed permutation. The choices of the permutation of the original set, counted by G(n), and which equivalence is made on x′, counted by m, are independent. Independence is clear since all pairs of elements in the relatively strongly ordered subset are inequivalent. Therefore, the multiplication principle determines that mG(n) new disallowed permutations exist. The lemma follows from the complement principle.

The counting above is repeatable for an increasingly large subset that follows a relative strong ordering. The application of each counting step yields a new counting that is compatible with the lemma.

2.1 The r-Fubini counting with shift operators

Theorem 7. For indices n and r, with n, r ∈ ℕ_{0} and r ≤ n:

H_{r}(n) = \frac{1}{r!} ∑_{j=0}^{r} s(r, r − j)F (n − j).  (11)

Proof. The proof first counts the case where the subset {x_{1}, x_{2}, x_{3}, …, x_{r}} follows relative strong ordering, which gives the r-Fubini numbers. We divide by r! to specify a permutation of the r elements to get the r-horse numbers. To begin counting, we first remove the counting of the r elements to be re-added following relative strong ordering. This leaves weak permutations of n − r elements, which is E^{−r}F (n). Elements of the distinguished subset rejoin the ordered set, with no ties within the subset {x_{1}, x_{2}, x_{3}, …, x_{r}}. The result is subtractions of ascending integer multiples of the identity operation from E by Lemma 6. We make the following r steps, adding back each element of {x_{1}, x_{2}, x_{3}, …, x_{r}}.

• Add x_{1} inequivalent to any x ∈ ∅. The count is EE^{−r}F (n).

• Add x_{2} inequivalent to any x ∈ {x_{1}}. The count is (E − 1I)EE^{−r}F (n).

• Add x_{3} inequivalent to any x ∈ {x_{1}, x_{2}}. The count is (E − 2I)(E − 1I)EE^{−r}F (n).

• ⋯

• Add x_{r} inequivalent to any x ∈ {x_{1}, x_{2}, …, x_{r−1}}. The count is (E − (r − 1)I) ⋯ (E − 2I)(E − 1I)EE^{−r}F (n).

All elements are included with their desired ordering with those from {x_{1}, x_{2}, …, x_{r}} inequivalent. All counted orderings have {x_{1}, x_{2}, …, x_{r}} relatively strongly ordered. The falling factorial appears with argument E and r terms, so

F_{r}(n) = (E)_{r̄}E^{−r}F (n).  (12)

The falling factorial expands as a sum according to Proposition 2, giving the equation

F_{r}(n) = (∑_{j=0}^{r} s(r, j)E^{j}) E^{−r}F (n).  (13)

The proposition applies because the multiplication of operators acts the same as multiplying polynomial variables. The effect of the shift operators is now trivial upon F (n), so F_{r}(n) can be written without operators as

F_{r}(n) = ∑_{j=0}^{r} s(r, j)F (n − r + j).  (14)

One can re-index the sequences to

F_{r}(n) = ∑_{j=0}^{r} s(r, r − j)F (n − j).  (15)

Given F_{r}(n), dividing by r! gives H_{r}(n) the form

H_{r}(n) = \frac{1}{r!} ∑_{j=0}^{r} s(r, r − j)F (n − j).

An interesting notation can be defined. We place a shift operator in the binomial coefficient. Combining this notation, Equation 1, and Equation 12 gives

H_{r}(n) = \binom{E}{r}F (n − r).  (16)

It is interesting to consider the implications of applying such an operator multiple times to a sequence.

2.2 A useful alternating recurrence

Corollary 8. For n ∈ ℕ_{0}, Fubini numbers have the recurrence

F (n) = n! − ∑_{j=1}^{n} s(n, n − j)F (n − j).  (17)

Proof. If the weakly ordered set is {x_{1}, x_{2}, …, x_{n}} is constrained such that {x_{1}, x_{2}, …, x_{n}} are relatively strongly ordered, the number of arrangements is F_{n}(n) = n!. It then follows from Theorem 7 that

n! = ∑_{j=0}^{n} s(n, n − j)F (n − j).  (18)

We rearrange after the substitution s(0, 0) = 1 to the result

F (n) = n! − ∑_{j=1}^{n} s(n, n − j)F (n − j).

3 Linear transformation between strong and weak orderings

Corollary 9. Let f⃗ and F⃗ be infinite vectors with entries n! and F (n), respectively. Vectors f⃗ and F⃗ obey the following relations involving Stirling matrices ŝ and Ŝ:

Ŝf⃗ = F⃗  (19)
ŝF⃗ = f⃗.  (20)

Proof. We rewrite Equation 18 by re-indexing the last indices of both sequences. We now have that

∑_{j=0}^{n} s(n, j)F (j) = n!.  (21)

The infinite lower triangular matrix of s(n, k) multiplied on vector F⃗ is exactly the sum derived. The equations ŝF⃗ = f⃗ and F⃗ = Ŝf⃗ immediately follow, using the inverse of ŝ being Ŝ (2).

Corollaries 8 and 9 show that Equation 15 provides intermediate transformations between strong and weak ordering. The intermediate sequences have combinatorial interpretation. Matrices Ŝ and ŝ are lower triangular. Therefore, the relations of Corollary 9 hold for finite cases, specifically for truncations of f⃗, F⃗, ŝ, and Ŝ.

4 Modular periodicity

Below, we determine eventual modular periodicity for F (n) and F_{r}(n) via the perspective of exponentially generated sequences and transformations of such sequences that preserve their structure. In addition, we set an upper bound for the period. The bound is the Carmichael function of the modulus. The case of odd modulus K has a period λ(K), which we prove directly by Asgari and Jahangiri’s period formula [1].

4.1 Fubini numbers modulo K

Corollary 10. The Fubini numbers are eventually periodic modulo K = p_{1}^{R_{1}}p_{2}^{R_{2}} ⋯ p_{N}^{R_{N}}, with maximum possible period λ(K). Periodicity holds for n ≥ max(R_{1}, R_{2}, … R_{N}).

Proof. Consider the first relation of Corollary 9, which is

F⃗ = Ŝf⃗

The entries of f⃗ are n!. Clearly, n! (mod K) is zero for n ≥ K. The relation stands in a simplified form modulo K as

F (n) ≡ ∑_{k=0}^{K−1} S(n, k)k! (mod K).  (22)

Fubini numbers modulo K are written as a finite sum of S(n, k) with coefficients independent of n. Each S(n, k) (mod K) term contributes sums of exponential dependence in n via Lemma 3. The weighted sum of modular exponentiations j^{n}, with j ∈ ℕ_{0}, is eventually modular periodic. Let R = max(R_{1}, R_{2}, … R_{N}) given K = p_{1}^{R_{1}}p_{2}^{R_{2}} ⋯ p_{N}^{R_{N}}. The Carmichael function bounds the period of modular exponentiation since

j^{R+λ(K)} ≡ j^{R} (mod K).  (23)

All the exponentials j^{n}, each with fixed coefficients, must enter periodicity by n = R. Therefore, their sum is modular periodic for n ≥ R. The longest possible period of F (n) (mod K) is λ(K) because λ(K) is the lcm of all periods of exponentiation modulo K.

4.2 Exact Carmichael periodicity for odd K

Corollary 11. For F (n) (mod K), if K is odd, then the eventual modular period of the sequence is λ(K).

Proof. According to Asgari and Jahangiri [1, Thm. 10], the period for this case is lcm(φ(p_{1}^{R_{1}}), φ(p_{2}^{R_{2}}), …, φ(p_{N}^{R_{N}})) where p_{i}^{R_{i}} are the prime power factors of K. When m is an odd prime power, we have φ(m) = λ(m). The result is the following expression for the eventual period q:

q = lcm(λ(p_{1}^{R_{1}}), λ(p_{2}^{R_{2}}), …, λ(p_{N}^{R_{N}})).  (24)

Finally, we apply the recurrence for λ(n) (6) to find that

q = λ(K).  (25)

4.3 Extension to r-Fubini numbers

Corollary 12. The r-Fubini numbers are eventually periodic modulo K for fixed r, with maximum period λ(K). The sequence’s periodicity holds when n ≥ r − 1 + R. Here R = max(R_{1}, R_{2}, … R_{N}) given K = p_{1}^{R_{1}}p_{2}^{R_{2}} ⋯ p_{N}^{R_{N}}.

Proof. The Fubini numbers F (n) are eventually modular periodic by Theorem 10. Next, observe the operation r!\binom{E}{r}E^{−r} on F (n) to generate F_{r}(n) = r!\binom{E}{r}E^{−r}F (n), per Equation 16. The operation preserves the structure of F (n) as a weighted sum of exponentials of n. The sum modulo K has a maximum period of λ(K). Shift operators might delay the periodic onset for some terms, so we add r −1 to the onset index. Consider that F_{r}(n) includes terms with argument shifts of F (n). Some F (n − a) term in F_{r}(n) only has argument R (ending its initial aperiodic procession) when n = a + R. The largest such a is r − 1 according to Equation 15. Note s(b, 0) = 0 when b > 0.

5 Remarks

5.1 Analogy between ordered and unordered Bell numbers

Remark 13. Consider the formula for r-Bell numbers given by Nyul and Kereskényi-Balogh [8, Thm. 4.2], rewritten with n, r in our notation it reads

B_{r}(n) = ∑_{j=0}^{r} s(r, r − j)B(n − j).

The formula for r-Fubini numbers given in this work (15) is remarkably similar. The proof given here should apply to r-Bell numbers with some adjustment. Explaining this similarity could yield insight into other problems susceptible to operator counting.

6 Acknowledgments

William Gasarch gave great advice for generalizing from an inspired example to H_{r}(n) and supported writing. The referees contributed valuable feedback on writing. Alex Leonardi, Deven Bowman, Kevin Flanary, Nathan Constantides, and Elan Fisher gave crucial review or aided in brainstorming.

References

[1] A. A. Asgari and M. Jahangiri, On the periodicity problem for residual r-Fubini sequences, J. Integer Sequences 21 (2018), Article 18.4.5.

[2] A. Z. Broder, The r-Stirling numbers, Discrete Math. 49 (1982), 241–259.

[3] G. Cheon and J. Kim, Stirling matrix via Pascal matrix, Linear Algebra Appl. 329 (2001), 49–59.

[4] L. Comtet, Advanced Combinatorics, D. Reidel Pub. Co, 1974.

[5] P. Erdős, C. Pomerance, and E. Schmutz, Carmichael’s lambda function, Acta Arith. 58 (1991), 363–385.

[6] R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics (2nd Ed.), Pearson Education, 1994.

[7] O. A. Gross, Preferential arrangements, Amer. Math. Monthly 69 (1962), 4–8.

[8] Z. Kereskényi-Balogh and G. Nyul, Stirling numbers of the second kind and Bell numbers for graphs, Australas. J. Comb. 58 (2014), 264–274.

[9] I. Mező, Periodicity of the last digits of some combinatorial sequences, J. Integer Sequences 17 (2014), Article 14.1.1.

[10] G. Rácz, The r-Fubini-Lah numbers and polynomials, Australas. J. Comb. 78 (2020), 145–153.

[11] J. Sándor and B. Crstici, Handbook of Number Theory II, Kluwer Academic Publishers, 2004.

[12] D. J. Velleman and G. S. Call, Permutations and combination locks, Math. Mag. 68 (1995), 243–253.

2020 Mathematics Subject Classification: Primary 06A05; Secondary 11B50. Keywords: Carmichael function, constrained weak ordering, exponential sum, Fubini number, modular periodicity, ordered Bell number, r-Fubini number, r-horse number, shift operator, signed Stirling number of the first kind, Stirling number of the second kind, weak ordering.

(Concerned with sequences \underline{A000670}, \underline{A002322}, \underline{A008275}, \underline{A008277}, \underline{A232473}, and \underline{A232474}.)

Received August 2 2024; revised versions received August 3 2024; August 19 2024; November 27 2024; November 29 2024. Published in Journal of Integer Sequences, July 31 2025.

Return to Journal of Integer Sequences home page.