The maximum number of cycles of a given length in a nonhamiltonian graph
In 2026, Li and Zhan characterized the nonhamiltonian graphs of order $n$ with the maximum number of paths of length $k$, where $n$ and $k$ are integers satisfying $1\leq k\leq n-1$. This work solves and generalizes a problem proposed by Erd\H{o}s in 1980. In this paper, we further determine the nonhamiltonian graphs of order $n$ attaining the maximum number of cycles of length $k$ for given integers $n$ and $k$ with $3\leq k\leq n-1$. As a corollary, we determine the generalized Tur\'an number $\mathrm{ex}(n,C_k,C_n)$ for every $3\leq k\leq n-1$.