/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/modulepublicimportFormalConjecturesUtil
f k n is $f_k(n)$, the number of elements of $S_n$ of order exactly $k$. Here $S_n$ is
Equiv.Perm (Fin n). Since every element of a finite group has positive order, f 0 n = 0.
Let $f_k(n)$ count the number of elements of $S_n$ of order $k$. For which values of $k$ will
$f_k(n)$ be maximal? [Va99, 5.72]
Beker [Be25d, Theorem 1.2] proved that, for all large $n$, $f_k(n)$ is maximal if and only if
$k\geq 1$ is minimal such that $[1,\ldots,n-k]\mid k$, where $[\cdot]$ is the least common
multiple. The last clause on erdosproblems.com/1161 reads "$f_k(n)=(n-1)!$" instead of "$f_k(n)$
is maximal"; we follow [Be25d]. For $k > n$ we read $n-k$ as $0$, which does not change the
least such $k$, because $k = n$ qualifies.
Beker [Be25d, Theorem 1.1] also proved that, if $n$ is sufficiently large and
$f_k(n)\geq (n-1)!$, then $[1,\ldots,n-k]\mid k$. The statement also records $1\leq k\leq n$,
since [Be25d] writes such $k$ as $n-k'$ with $0\leq k'\leq n-1$.