TITLE: How to prove the Mantel's theorem of graph theory 's bound is best possible?
QUESTION [5 upvotes]: The theorem state that every graph of order $n$ and size greater than floor function $\lfloor \frac{n^2}{4} \rfloor$ contain a triangle.
I already know a proof of the number of the edge of graph $\leq\frac{n^2}{4}$ if it does not contains a triangle, but how to prove this bound is best possible if n is bigger than 100, in another word, how to prove there are infinite example satisfy the best bound?

REPLY [5 votes]: We can't use a smaller bound because we can show that for each natural number $n$, there exists a graph of order $n$ with exactly $\lfloor \frac{n^2}{4} \rfloor$ edges and no triangles. In response to your edit, this gives us an infinite number of examples.
So let $n$ be a natural number, and we will find a graph of order $n$ with no triangles and $\lfloor \frac{n^2}{4} \rfloor$ edges.
If $n$ is even, then $\lfloor \frac{n^2}{4} \rfloor = \frac{n^2}{4}$, and the graph $K_{n/2,n/2}$ has $\left( \frac{n}{2} \right) \left( \frac{n}{2} \right) = \frac{n^2}{4}$ edges and no triangles.
If $n$ is odd, then $n = 2m + 1$ for some integer $m$, so
\begin{align*}
    \lfloor \frac{n^2}{4} \rfloor &= \lfloor \frac{4m^2 + 4m + 1}{4} \rfloor \\
                                  &= \lfloor m^2 + m + \frac{1}{4} \rfloor \\
                                  &= m(m + 1).
\end{align*}
Then the graph $K_{m,m+1}$ has order $m + m + 1 = n$, no triangles, and has $m(m + 1) = \lfloor \frac{n^2}{4} \rfloor$ edges.