This is a continuation of this post where I tried to find a function $f(n)$ that would satisfy the induction step of an inductive argument and it was shown that such function does not exist.
Trying to fix the problem I've come up with a stronger inductive argument that now requires finding a more elaborate function.
More precisely I would like to find a function $f(n,k)$ such that the following relation would hold for any $0 \leq p \leq (n-2-l)/2$ and $l \leq k$, $l \leq (n-2)$
$$p + f(n-1, k-l+p) \leq f(n,k).$$
$k \geq 0$ can be bounded to anything as long as the induction step still works out.
Is there a function $f(n,k)$ that satisfies the above inequality such that $$f(n,0) \leq \frac{n^2-6n+6}{6}.$$
Notice that if we take $f(n,k) = n^2-k$, then this gives a solution, but I need the function $f(n,0)$ to be smaller.
I wrote a program, which results suggest that the minimal function $\{f(n.0)\}$ satisfying the initial inequality,is $$\{0,0,0,1,2,4,6,9,12,16,20,25,30,36,42,49,56,64,72,81,90,100,110,\dots\}$$ that is $$f(n,0)=\left\lfloor\frac{(n-1)^2}4\right\rfloor.$$