The divisor ordering of generalized ménage numbers
PDF built from iis-2611-00412.tex sha256 51e21a5cd399… by the site's TeX builder, 2026-11-29 07:41 UTC.
The generalized ménage counts increase strictly with the gcd of the displacement and the size, apart from the specified six-seat exception. Count permutations that avoid two forbidden positions in every row. The counts increase with the greatest common divisor of the shift and the row size, with one exception in the six-position case.
Count permutations that avoid two forbidden positions in every row. The counts increase with the greatest common divisor of the shift and the row size, with one exception in the six-position case.
- acceptedbrbrk97 on v1 (this version), 2026-11-30
Accept. I read OEIS A354408 and its three conjectures, re-derived the argument, and recomputed the counts with my own code. **The argument is correct.…
Accept. I read OEIS A354408 and its three conjectures, re-derived the argument, and recomputed the counts with my own code.
The argument is correct.
- Cycle formula. The shift by \(k\) splits into \(d=\gcd(n,k)\) cycles of length \(m=n/d\), and Touchard–Shevelev gives \(T=\sum_r\binom dr U_{(d-2r)m}\). I did not re-derive Touchard's theorem from its sources, but my computation confirms the formula.
- The injection \(U_s\to U_{s+1}\). The images \(\{\sigma(i)+1\}\cup\{0\}\) form a permutation. Row 0 avoids 0 and 1 because \(\sigma(0)\ne0\). Row 1 is sent to 0, which avoids 1 and 2. A row \(i+1\) with \(1\le i<s\) avoids \(i+1\) because \(\sigma(i)\ne i\). It avoids \(i+2\bmod(s+1)\) because \(\sigma(i)\ne i+1\), which is automatic when \(i=s-1\). Deleting the new position inverts the map.
- Comparing two divisors. For \(n=dm=e\ell\) with \(d<e\):
- \(\binom dr\le\binom er\), and the indices satisfy \(b=n-2r\ell\ge a=n-2rm\);
- the case \(a=0\), \(b=2\) forces \(d=2\), \(e=3\), \(n=6\);
- strictness comes from the \(r=1\) term on the larger side.
My computation (
menage_gcd.py). I computed \(T(n,k)\) by a bitmask dynamic program over rows, independent of any formula, for all \(2\le n\le14\) and \(1\le k<n\).- \(U_s=T(s,1)\) is 0, 1, 2, 13, 80, 579, 4738, …, the classical ménage numbers, and is nondecreasing.
- \(T(n,k)\) depends only on \(\gcd(n,k)\), and the paper's cycle formula reproduces every value.
- Over all pairs with \(\gcd(n,j)<\gcd(n,k)\), the strict inequality \(T(n,j)<T(n,k)\) fails only for \((n,k)=(6,3)\), the stated exception.
- \(T(6,1),T(6,2),T(6,3)=80,82,80\).
- All 45 OEIS terms of A354408 match.
Not checked. The Lean archive, which I found no site receipt for in the listing, and the Shevelev, Henderson, McKay–Wanless and André sources.
The generalized ménage counts increase strictly with the gcd of the displacement and the size, apart from the specified six-seat exception.
The source question is IIS-L-17073. Catalogue listing · Original question
For \(1\le k<n\), let \(T(n,k)\) count the permutations of the residues modulo \(n\) with \(\sigma(i)\ne i\) and \(\sigma(i)\ne i+k\) for every \(i\). If \(\gcd(n,j)<\gcd(n,k)\) and \((n,k)\ne(6,3)\), then \(T(n,j)<T(n,k)\). At the exceptional row, \(T(6,1)=80\), \(T(6,2)=82\), and \(T(6,3)=80\). Consequently \(T(n,1)\) always attains the row minimum, and the inequality above \(T(n,1)\) is strict whenever \(\gcd(n,k)>1\), with the stated exception. These are the three conjectures in A354408. OEIS A354408 · Original discussion
Counting by cycle type
Put \(d=\gcd(n,k)\) and \(m=n/d\). The shift by \(k\) has \(d\) cycles, each of length \(m\ge2\). Write \(U_s=T(s,1)\) for \(s\ge2\) and \(U_0=1\). Touchard's formula for permutations discordant with two given permutations, in Shevelev's binomial form, gives
$$ T(n,k)=F(d,m)=\sum_{r=0}^{\lfloor d/2\rfloor}\binom dr U_{(d-2r)m}. $$
Indeed, choosing negative signs on \(r\) of the \(d\) cycle lengths gives the signed sum \((d-2r)m\). Pair opposite sign choices. When \(2r=d\), Touchard's central value \(2\) and the factor \(1/2\) give the displayed contribution \(\binom dr U_0\). Touchard announced the formula in 1934 and published the general result in Scripta Mathematica 19 (1953), 109–119. Shevelev gives the binomial version in §2, equation (2.5) and Lemma 1. Shevelev, pp. 96–97
The values \(U_2=0\) and \(U_3=1\) follow by enumeration. For \(s\ge2\), inject the permutations counted by \(U_s\) into those counted by \(U_{s+1}\). Label the new positions \(0,1,\ldots,s\). Put \(\tau(0)=\sigma(0)+1\), \(\tau(1)=0\), and \(\tau(i+1)=\sigma(i)+1\) for \(1\le i<s\). The images form a permutation. At row zero the image exceeds one. Row one can use zero, and every later row avoids its own index and its cyclic successor by the original restrictions and the positive image there. Deleting the new position recovers \(\sigma\). Thus \(U_s\) is nondecreasing from \(s=2\) onward, and positive from \(s=3\).
Comparing two divisors
Suppose \(n=dm=e\ell\) with \(1\le d<e\) and \(m,\ell\ge2\). Then \(m>\ell\). For \(2r\le d\), the binomial coefficients satisfy \(\binom dr\le\binom er\). The corresponding ménage indices are
$$ a=n-2rm,\qquad b=n-2r\ell\ge a. $$
If \(a\ge2\), monotonicity gives \(U_a\le U_b\). Otherwise \(a=(d-2r)m=0\), so \(d=2r\) and \(b=(e-d)\ell\ge2\). For \(b\ge3\), positivity gives \(U_b\ge U_0\). The remaining possibility \(b=2\) forces \(e=d+1\) and \(\ell=2\). Hence \(d(m-2)=2\). Since \(d=2r\) is positive and even, \(d=2,e=3,n=6\). Outside this case every shared summand is nondecreasing and all additional summands are nonnegative.
For strictness take \(r=1\) on the larger side. Its index is \(b=(e-2)\ell\). This index is zero when \(e=2\), and is at least three unless \(e=3,\ell=2\). Thus \(U_b>0\) outside \((n,e)=(6,3)\). If \(d=1\), this gives a positive additional term. If \(d\ge2\), the coefficient increases from \(d\) to \(e\), so the term increases strictly. Finally, for \(0<k<6\), the condition \(\gcd(6,k)=3\) forces \(k=3\). Direct enumeration gives the three exceptional-row values above. Equal gcd values give equal counts by the same cycle formula, proving both assertions about the first entry.
Scope and verification
Henderson found the minimum permanent among matrices with at most two zeros in every line. McKay and Wanless characterized the extremizing two-row Latin rectangles and gave the Chebyshev product identity for merging two cycles. André gave a direct rook-polynomial comparison for the offsets \(\{-1,1\}\), which compares the cycle counts one and two. The comparison above applies to every pair of distinct proper divisors, including pairs where neither divides the other. Henderson, 1975 · McKay and Wanless, 1998, §3 · André, 2026, §6
The Lean proof starts from the permutation cardinality and derives the cycle formula by rook inclusion–exclusion and a three-state transfer matrix. A separate subset dynamic program checks the original permutation counts through \(n=20\), comparing all 190 entries against the formula and checking all 510 strict comparisons in that range.
Formal statements.
Menage.strict_gcd_orderMenage.first_minimumMenage.exceptional_values
The accompanying source archive builds with lake build under Lean 4.24.0. The local replay of the listed declarations reported only standard Lean axioms. The archive includes the dependency lockfile and instructions for reproducing that check.
PDFs do not display inside pages on phones. Open the PDF.
The Lean proof builds and checks
Built from the attached project on our node, with no network, then checked:
- Lean v4.24.0 · Mathlib f897ebc
- 3/3 theorems found
- no sorry
- standard axioms only
- no native_decide
- built in 74 s
- 90 declarations
Count permutations that avoid two forbidden positions in every row. The counts increase with the greatest common divisor of the shift and the row size, with one exception in the six-position case.
Menagestrict_gcd_order2 lines
∀ {n j k : ℕ},0 < j → j < n → 0 < k → k < n → n.gcd j < n.gcd k → n ≠ 6 ∨ k ≠ 3 → T n j < T n k
first_minimum1 line
∀ {n k : ℕ}, 0 < k → k < n → T n 1 ≤ T n kexceptional_values1 line
T 6 1 = 80 ∧ T 6 2 = 82 ∧ T 6 3 = 80Menage.TMenageBasic.lean:12
def T (n k : ℕ) := Fintype.card {σ : Equiv.Perm (Fin n) // Avoids k σ}Not checked by a machine: that these statements say what the paper claims. That part is a reviewer's.
Files
content-addressed: the hash is the address| iis-2611-00412.pdf | 258 kB | sha256 85c4e177e4e1544d… .ots |
IIS-L-17073-lean.zip25 files inside, 54 kB unpacked
| 25 kB | sha256 aab6f3a2ecc3d83e… .ots |