1 Introduction

A central topic of extremal combinatorics is to investigate sufficient conditions for the appearance of given substructures. In particular, for a given graph H and a set of graphs \(\mathcal {F}\), the generalized Turán number \(\textrm{ex}(n,H,\mathcal {F})\) denotes the maximum number of copies of H in a graph on n vertices containing no F as a subgraph, for every \(F\in \mathcal {F}\). In 1959, Erdős and Gallai [2] determined the maximum number of edges in a graph with a small circumference, the length of a longest cycle. For integers n and k such that \(n \ge k \ge 3\), they proved

$$\begin{aligned} \textrm{ex}(n,K_2,\mathcal {C}_{\ge k}) \le \frac{(k - 1)(n - 1)}{2}, \end{aligned}$$

where \(K_k\) denotes the complete graph with k vertices and \(\mathcal {C}_{\ge k}\) denotes the family of cycles of length at least k. The bound is sharp for every n congruent to one modulo \(k-2\). Equality is attained by graphs with \(\frac{n-1}{k-2}\) maximal 2-connected blocks each isomorphic to \(K_{k-1}\). Recently, Li and Ning [3] proved that to obtain the same upper bound, it is enough to forbid only long even cycles

$$\begin{aligned} \textrm{ex}(n,K_2,\mathcal {C}^{even}_{\ge 2k}) \le \frac{(2k - 1)(n - 1)}{2}, \end{aligned}$$
(1)

where \(\mathcal {C}^{even}_{\ge 2k}\) denotes the family of even cycles of length at least 2k, that is \(\{C_{2k},C_{2k+2},\dots \}\). We also denote the family of odd cycles of length at least \(2k+1\) by \(\mathcal {C}^{odd}_{\ge 2k+1}:=\{C_{2k+1},C_{2k+3},\dots \}\). For a graph G and a family of graphs \(\mathcal {F}\), we say G is \(\mathcal {F}\)-free, if for all graphs \(F\in \mathcal {F}\), G does not contain F as a subgraph, not necessarily induced. For graphs G and H, let us denote the number of copies of H in G by H(G).

Note that graphs with bounded odd circumferences might have a quadratic number of edges (as a function of the number of vertices) since the n-vertex complete balanced bipartite graph is odd cycle-free with \(\left\lfloor {\frac{n^2}{2}}\right\rfloor \) edges. On the other hand, Voss and Zuluga [6] proved that every 2-connected graph G with minimum degree at least \(k\ge 3\), with at least \(2k+1\) vertices, contains an even cycle of length at least 2k. Even more, if G is not bipartite, then it contains an odd cycle of length at least \(2k-1\).

There are numerous papers strengthening, generalizing, and extending the celebrated Erdős and Gallai theorem. Recently, Luo [4] proved

$$\begin{aligned} \textrm{ex}(n,K_r,\mathcal {C}_{\ge k})\le \frac{(n-1)}{k-2}\left( {\begin{array}{c}k-1\\ r\end{array}}\right) , \end{aligned}$$
(2)

for all \(n\ge k \ge 4\). Chakraborti and Chen [1] strengthened Luo’s result by obtaining a sharp upper bound for every n. This bound is a great tool for obtaining results in hypergraph theory. The bound was consequently reproved with different methods multiple times [5, 7]. In this paper, we strengthen Luo’s theorem. In particular, we obtain the same tight bounds for graphs with bounded odd circumferences. On the other hand, the result for graphs with bounded even circumference is trivial after applying (1) and a result of Luo [4, Cor.1.7],

$$\begin{aligned} \textrm{ex}(n,K_r,P_{k+1}) \le \frac{n}{k}\left( {\begin{array}{c}k\\ r\end{array}}\right) , \end{aligned}$$

where \(P_{k+1}\) denotes the path of length k. Since the graph G does not contain a cycle of length 2k, the neighborhood of each vertex contains no path of length \(2k-2\). In particular, for all \(r\ge 3\) we have

$$\begin{aligned} \textrm{ex}(n,K_r,\mathcal {C}^{even}_{\ge 2k}){} & {} \le \frac{1}{r}\sum _{v}\frac{d(v)}{2k-2}\left( {\begin{array}{c}2k-2\\ r-1\end{array}}\right) \\{} & {} \le \frac{1}{r}\frac{\textrm{ex}(n,K_{2},\mathcal {C}^{even}_{\ge 2k})}{k-1}\left( {\begin{array}{c}2k-2\\ r-1\end{array}}\right) \le \frac{n-1}{2k-2}\left( {\begin{array}{c}2k-1\\ r\end{array}}\right) . \end{aligned}$$

For graphs with small odd circumferences, we have the following theorem.

Theorem 1

For integers nkr satisfying \(n\ge 2k \ge r \ge 3\) and \(k\ge 14\),

$$\begin{aligned} \textrm{ex}(n,K_r,\mathcal {C}^{odd}_{\ge 2k+1})\le \frac{n-1}{2k-1}\left( {\begin{array}{c}2k\\ r\end{array}}\right) . \end{aligned}$$

Equality holds only for connected n-vertex graphs which consisting of \(\frac{n-1}{2k-1}\) maximal 2-connected blocks each isomorphic to \(K_{2k}\).

It is interesting to ask for which integers and for which congruence classes the same phenomenon still holds. In this direction, we would like to raise a modest conjecture.

Conjecture 2

For an integer \(k\ge 2\) and a sufficiently large n. Let G be an n vertex \(C_{3\ell +1}\)-free graph for every integer \(\ell \ge k \). Then for every r, \(3k \ge r\ge 2\), the number of cliques of size r in G is at most

$$\begin{aligned} \frac{n-1}{3k-1}\left( {\begin{array}{c}3k\\ r\end{array}}\right) . \end{aligned}$$

Equality holds only for connected n-vertex graphs consisting of \(\frac{n-1}{3k-1}\) maximal 2-connected blocks each isomorphic to \(K_{3k}\).

Moreover, we would like to propose the following conjecture. Let p be a prime number and \(\mathcal {C}_{\ge p}^{prime}:=\{C_{\ell }:\ell \ge p~\text{ and } \ell ~\text{ prime }\}\).

Conjecture 3

For integers n, r and a prime p satisfying \(r<p\), we have

$$\begin{aligned} \textrm{ex}(n,K_r,\mathcal {C}_{\ge p}^{prime})\le \frac{n-1}{p-2}\left( {\begin{array}{c}p-1\\ r\end{array}}\right) . \end{aligned}$$

Equality holds only for connected n-vertex graphs consisting of \(\frac{n-1}{p-2}\) maximal 2-connected blocks each isomorphic to \(K_{p-1}\).

2 Proof of the Main Result

Proof

We prove Theorem 1 by induction on the number of vertices of the graph. The base cases for \(n\le 2k\) are trivial. Let G be a graph on n vertices where \(n>2k\). We assume that every \(\mathcal {C}^{odd}_{\ge 2k+1}\)-free graph on m vertices, for \(m<n\), contains at most \(\frac{m-1}{2k-1}\left( {\begin{array}{c}2k\\ r\end{array}}\right) \) copies of \(K_r\) and that equality is achieved for the class of graphs described in the statement of the theorem.

If \(\delta (G)\), the minimum degree of G, is at most \(k+2\), then we are done by the induction hypothesis

$$\begin{aligned} K_r(G)\le & {} K_r(G[V(G) \setminus \{v\}])+\left( {\begin{array}{c}k+2\\ r-1\end{array}}\right) \le \frac{n-2}{2k-1}\left( {\begin{array}{c}2k\\ r\end{array}}\right) +\left( {\begin{array}{c}k+2\\ r-1\end{array}}\right) \\ {}< & {} \frac{n-1}{2k-1}\left( {\begin{array}{c}2k\\ r\end{array}}\right) , \end{aligned}$$

since \(k\ge 14\) and \(r\ge 3\). From here, we may assume G is a graph with \(\delta (G)>k+2\), and each edge of G is in a copy of \(K_r\).

Let \(v_1v_2v_3\cdots v_m\) be a longest path of G such that \(v_1\) is adjacent to \(v_t\) and t is the maximum possible among the longest paths. Consider the family \(\mathcal {P}\) of all longest paths of G on the vertex set \(\{v_1,v_2,v_3,\dots ,v_m\}\) such that \(v_tv_{t+1}\cdots v_m\) is a sub-path with a terminal vertex \(v_m\). Let \(T_1\) be the set of terminal vertices, excluding \(v_m\), of paths from \(\mathcal {P}\).

Claim 1

If \(t\le 2k\), then \(v_t\) is a cut vertex isolating \(\{v_1,v_2,\dots ,v_{t-1}\}\) from the rest of the graph.

Proof

If \(T_1=\{v_1,v_2,\dots ,v_{t-1}\}\), then by the maximality of t, the vertex \(v_t\) is a cut vertex isolating \(\{v_1,v_2,\dots ,v_{t-1}\}\) from the rest of the graph. Hence we may assume there exists a \(v_i\), \(i\le t-1\), which is not in \(T_1\). Note that \(v_{t-1}\in T_1\) thus we have \(i<t-1\). Let the path \(u_1u_2\cdots u_{t-1}u_tv_{t+1}\cdots v_m\) be a path from \(\mathcal {P}\) such that \(u_r\in T_1\) and \(u_{r+1}\notin T_1\) minimizing r. Note that \(u_t=v_t\) and \(\{v_1,v_2,\dots ,v_t\}=\{u_1,u_2,\dots ,u_t\}\).

Here, we show that \(r+1\le t/2\). At first, we assume \(i\le t/2\), then \(v_1v_2\cdots v_m\) is a path in \(\mathcal {P}\) thus \(r+1\le i\), we are done since \(i\le t/2\). If \(t/2\le i\), then consider the following path from \(\mathcal {P}\) \(v_{t-1}v_{t-2}\cdots v_i\cdots v_1v_t\cdots v_m\) is a path in \(\mathcal {P}\), thus \(r+1\le t-1-i+1= t-i\), we are done since \(t-i \le t/2\).

The vertex \(u_1\) is not adjacent to two consecutive vertices from \(\{u_{r+1},u_{r+2},\dots ,u_t\}\) by the minimality of r. Indeed if \(u_1\) is adjacent to \(u_i\) and \(u_{i+1}\) for \(r+1\le i \le t\), then

$$\begin{aligned} u_2u_3\cdots u_ru_{r+1}\cdots u_iu_1u_{i+1}\cdots u_t v_{t+1}\cdots v_m \end{aligned}$$

forms a path from \(\mathcal {P}\) that contradicts the minimality of r.

The vertex \(u_1\) is not adjacent to vertices \(u_{r+2},u_{r+3},\dots ,u_{2r+1}\) by the minimality of r. Indeed, suppose \(u_1\) is adjacent to \(u_i\) for \(r+2\le i\le 2r+1\), then we get a path from \(\mathcal {P}\)

$$\begin{aligned} u_{i-1}u_{i-2}\dots u_{r+1}u_{r}\dots u_1u_{i}u_{i+1}\dots u_t v_{t+1} \dots v_{m}, \end{aligned}$$

which contradicts the minimality of r since \(u_{r+1}\notin T_1\).

Finally, by the two observations from the preceding two paragraphs we have \(d(u_1)\le (r-1)+\frac{t-(2r+1)+1}{2}=\frac{t-2}{2}<k\), a contradiction. \(\square \)

Claim 2

We have \(t\le 2k\).

Proof

Suppose otherwise let us assume \(t>2k\). Let C denote the cycle \(v_1v_2\dots v_tv_1\). Since G is \(\mathcal {C}^{odd}_{\ge 2k+1}\)-free t is even and vertices \(v_{t-3}\) and \(v_{t-2}\) have no common neighbors in \(G[V(G)\setminus V(C)]\). On the other hand, since every edge is in a \(K_r\) there is a vertex \(v_l\) adjacent to both \(v_{t-3}\) and \(v_{t-2}\). Let us denote \(c:=t-2k\).

In this paragraph, we show that \(c-1\le l\le 2k-4\). Consider the following two cycles of consecutive lengths \(v_{\ell }v_{\ell +1}\dots v_{t-3}v_{\ell }\) and \(v_{\ell }v_{\ell +1}\dots v_{t-3}v_{t-2}v_{\ell }\). One of them has an odd length, thus we have \(t-2-\ell +1\le 2k\) since G is \(\mathcal {C}^{odd}_{\ge 2k+1}\)-free. Consider the following two cycles of consecutive lengths \(v_{\ell }v_{\ell -1}\dots v_{1}v_{t}v_{t-1}v_{t-2}v_{t-3}v_{\ell }\) and \(v_{\ell }v_{\ell -1}\dots v_{1}v_{t}v_{t-1}v_{t-2}v_{\ell }\). One of them has an odd length, thus we have \(\ell +4\le 2k\) since G is \(\mathcal {C}^{odd}_{\ge 2k+1}\)-free. Thus, we have \(c-1\le l\le 2k-4\).

There is no i such that \(v_i\) is adjacent with \(v_{t-1}\) and \(v_{i+1}\) is adjacent with \(v_{1}\). Since otherwise, the following cycle has an odd length greater than 2k,

$$\begin{aligned} v_1v_2\dots v_iv_{t-1}v_{t-2} \dots v_{i+1}v_{1}. \end{aligned}$$

Note that, since \(v_{t-1},v_1 \in T_1\) and from maximality of t, we have \(N(v_1),N(v_{t-1})\subseteq V(C)\). Since G is \(\mathcal {C}^{odd}_{\ge 2k+1}\)-free and \(t\ge 2k+2\) we have \(N(v_1)\cap N^+(v_{t-1})=\emptyset \), where \(N^+(v_{t-1})\) denotes the following set \(\{v_{i+1}:v_i \in N(v_{t-1})\}\).

There is no i such that both \(l<i< l+c-2\) and \(v_1v_i\) is an edge of G. Since otherwise, one of the following cycles is an odd cycle longer than 2k,

$$\begin{aligned} v_1v_2\dots v_l v_{t-2}v_{t-3}\dots v_{i}v_1 \text{ or } v_1v_2\dots v_l v_{t-3}v_{t-4}\dots v_{i}v_1. \end{aligned}$$

Thus, we have

$$\begin{aligned} N(v_1)\cap \{v_{l+2},\dots ,v_{l+c-3}\}=\emptyset . \end{aligned}$$

Similarly, there is no i such that \(l<i<l+c\) and \(v_{t-1}v_i\) is an edge of G. Since otherwise, one of the following cycles is an odd cycle longer than 2k,

$$\begin{aligned} v_{t-1}v_{t}v_1\dots v_l v_{t-2}v_{t-3}\dots v_{i}v_{t-1} \text{ or } v_{t-1}v_{t}v_1\dots v_l v_{t-3}v_{t-4}\dots v_{i}v_{t-1}. \end{aligned}$$

Thus, we have

$$\begin{aligned} N^+(v_{t-1})\cap \{v_{l+2},\dots ,v_{l+c-3}\}=\emptyset . \end{aligned}$$

Recall we have \(N(v_1)\cap N^+(v_{t-1})=\emptyset \), hence, we get

$$\begin{aligned}{} & {} \left| {N(v_1)}\right| \le \left| { \left( \{v_1,v_2,\dots ,v_{2k+c}\}\setminus N^+(v_{t-1})\right) \setminus \{v_{l+2},\dots ,v_{l+c-3}\} }\right| \\{} & {} \le 2k+c-(k+3)-(c-4)<\delta (G), \end{aligned}$$

a contradiction. \(\square \)

From Claims 1 and 2, G contains a 2-connected block of size \(x\le 2k\). After contracting the block to a vertex we get a \(\mathcal {C}^{odd}_{\ge 2k+1}\)-free graph on \(n-x+1\) vertices. By the convexity of a binomial function \(\left( {\begin{array}{c}\cdot \\ r\end{array}}\right) \) and induction hypothesis, we see that G contains at most \(\frac{n-1}{2k-1}\left( {\begin{array}{c}2k\\ r\end{array}}\right) \) cliques of size r and equality is achieved if and only if G is a connected graph and every maximal 2-connected component of G is isomorphic to \(K_{2k}\). \(\square \)