Finding a function satisfying a certain inequality 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.

It seems the following.
Provided $n\ge 2$ put $k=l=\left\lfloor\frac{n-2}3\right\rfloor$ and 
$p=\left\lfloor\frac{n-3}3\right\rfloor$. Then 
$$\left\lfloor\frac{n-3}3\right\rfloor+f\left(n-1,\left\lfloor\frac{n-3}3\right\rfloor\right)\le f\left(n, \left\lfloor\frac{n-2}3\right\rfloor\right),$$ 
which should give a lower bound $f\left(n, \left\lfloor\frac{n-2}3\right\rfloor)\right)\ge\frac {n^2}{6}-O(n)$.
Now put $k=l=0$ and $p=\left\lfloor\frac{n-3}3\right\rfloor$.
Then $$f(n,0)\ge p+f(n-1,p)\ge\frac {n^2}{6}-O(n).$$
More precisely. The proposed lower bound is not far from your upper bound $f(n,0) \leq \frac{n^2-6n+6}{6}$. Indeed, for $n\ge 7$ we have 
$$f(n,0)\ge \left\lfloor\frac{n-3}3\right\rfloor+f\left(n-1, \left\lfloor\frac{n-3}3\right\rfloor\right)\ge$$ $$\left\lfloor\frac{n-3}3\right\rfloor+\left\lfloor\frac{n-4}3\right\rfloor+f\left(n-2, \left\lfloor\frac{n-4}3\right\rfloor\right)\ge$$
$$\left\lfloor\frac{n-3}3\right\rfloor+\left\lfloor\frac{n-4}3\right\rfloor+\dots+\left\lfloor\frac{4}3\right\rfloor+f(2,0)\ge$$
$$-\frac{1}3+\sum_{k=4}^{n-3}\frac{k-1}3\ge \frac{n^2-7n+4}6.$$
