The following function comes up in my research as part of a sufficient condition for capability of $p$-group of class two and prime exponent. Given a nonnegative integer $m$, express $m$ as a triangular number plus a remainder, $$ m = \binom{T}{2}+s,\qquad 0\leq s \lt T.$$ Then $$f(m) = \binom{T}{3}+\binom{s}{2}.$$ (The values of the function are sequence A111138 in the OEIS).
(There are a number of ways to describe the function $f$; for example, starting with $f(0)=0$, you then start adding nonnegative integers to the running total up to one more than the previous "run"; thus, $$\begin{align*} f(0)&=0;\\ f(1)&=f(0)+0=0\\ f(2)&=f(1)+0=0,\ f(3)=f(2)+1=1;\\ f(4)&=f(3)+0=1,\ f(5)=f(4)+1=2,\ f(6)=f(5)+2=4;\\ f(7)&=f(6)+0=4,\ f(8)=f(7)+1=5,\ f(9)=f(8)+2=7,\\ &f(10)=f(9)+3 = 10;\\ f(11)&=f(10)+0=10,\ f(12)=f(11)+1=11, f(13)=f(12)+2=13,\\ &f(14)=f(13)+3=16,\ f(15)=f(14)+4=20;\\ \end{align*}$$ etc.)
I would like a formula for $f$ in terms of $m$. The best I can do right now is to find the value of $T$, which if I'm not mistaken is given by: $$T = \left\lfloor \frac{1+\sqrt{1+8m}}{2}\right\rfloor$$ and then replace $s$ with $n-T$ and just expand the binomial coefficients.
Is there a simpler expression for $f$? Also, am I correct that the function grows as $(8m)^{3/2}$ ?