# A formula for $\lfloor n\rfloor+\left\lfloor \frac n2\right\rfloor+ \left\lfloor \frac n3\right\rfloor+\ldots+\left\lfloor \frac nk\right\rfloor$?

Is there any formula to calculate: $$\lfloor n\rfloor+\left\lfloor \frac n2\right\rfloor+ \left\lfloor \frac n3\right\rfloor+\ldots+\left\lfloor \frac nk\right\rfloor$$ with $n$ and $k$ positive integers and $k\leq n$.

• Is $[\cdot]$ the integer part? – marco trevi Sep 30 '14 at 10:36
• @marcotrevi: Yes. – mac Sep 30 '14 at 10:37
• I doubt there is a nice formula for this. There are two regimes: as long as $k^2<n$, the quotients are strictly decreasing with decreasing steps; the sums will approximately follow an $n\log(n)$ curve; then the quotients start repeating longer and longer, with a unit step in between. The last "run" goes for $n/2\le k\le n$, with the sum linearly increasing. – Yves Daoust Sep 30 '14 at 11:05

## 1 Answer

It does not seem that there exists a closed formula. Indeed, let us denote the sum to be calculated by $S_{n,k}$. Specializing to the case $k=n$ corresponds to the entry A006218 at OEIS, which only provides asymptotic estimates: $$n \left(\ln n + 2 \gamma - 1\right) - 4 \sqrt n - 1 \leq S_{n,n} \leq n \left(\ln n + 2 \gamma - 1\right) + 4 \sqrt n.$$

• oeis.org/A006218 is not really the same thing, is it? The OP mentions several functions of $n$, one for each $k$. – lhf Sep 30 '14 at 11:44
• @Ihf indeed, I will edit accordingly. Thanks! – Start wearing purple Sep 30 '14 at 11:49
• @O.L.: what is $\gamma$? – mac Sep 30 '14 at 11:57
• – Start wearing purple Sep 30 '14 at 11:58