15

$$ \sum_{i=1}^N\left\lfloor\frac{N}{i}\right\rfloor $$ Is there a closed form expression to the above sum? (Mathematica doesn't give me anything)

Priyatham
  • 2,627

3 Answers3

9

This is Dirichlet's divisor summatory function $D(x)$. It is known that $$D(x) = x\log x + x(2\gamma -1) + \Delta(x)$$ and the non-leading term $\Delta(x)$ is $O(\sqrt{x})$. Forget about its closed form, even the behaviour of the non-leading term $\Delta(x)$ is a well known unsolved problem.

Dirichlet divisor problem

Find the smallest value of $\theta$ for which $\Delta(x) = O(x^{\theta+\epsilon})$ holds true for all $\epsilon > 0$.

achille hui
  • 125,323
  • Thanks for the answer and the link. In the end I used the $O(\sqrt{x})$ formula for evaluating this sum. – Priyatham Apr 05 '14 at 07:44
7

$$\sum_{i=1}^N \left \lfloor \frac{N}{i}\right\rfloor \approx \sum_{i=1}^N \frac{N}{i} = N\sum_{i}^N \frac1{i} = NH_N$$

where $H_n$ is the nth Harmonic number.

For any monotonically decreasing function $f$ we have,

$$\int_1^{n+1}f(x)\,{\rm d}x \le \sum_{i=1}^n f(i) \le 1+\int_1^nf(x)\,{\rm d}x$$

Taking $f(x)=\frac1{x}$, we obtain the well known bound,

$$\ln(n+1)\le H_n\le 1+\ln(n)$$

Thus $H_n \sim \ln(n)$

and our sum is $$S=N\ln(N)$$

Note: $H_n=\ln(n) + \gamma$ is a better approximation, where $\gamma$ is the Euler Mascheroni Constant.


We can always say that

$$N\ln(N+1) \le S \le N + N\ln(N)$$

Guy
  • 9,055
  • 1
  • 30
  • 58
  • Yes I did. But like told @V.C., I need an exact answer. Also, when you say $n$, do you mean $N$? – Priyatham Apr 05 '14 at 07:01
  • @Priyatham yes I corrected the typo. But till date a closed form hasn't been found. – Guy Apr 05 '14 at 07:08
  • Also, since it's a discontinuous function on integers, you can be almost sure that an analytic closed form doesn't exist. – Guy Apr 05 '14 at 07:09
  • 1
    @Priyatham. There is no hope to arrive to any closed form solution (as already other wrote). The only thing you can hope is to find upper and lower bounds and what Sabyasachi answered is probably almost the best you could get. – Claude Leibovici Apr 05 '14 at 07:25
  • Why is the possibility of a closed form so pessimistically viewed? As far as I understand, Sabyasachi's approximation is already asymptotic to the true value of the function. Now, why does the discontinuity by it self make it "almost sure" that a better, perhaps, exact analytical closed form does not exist - like the gamma function for the factorials? – Just_a_fool Apr 05 '14 at 09:58
2

The sequence $a_n=\sum_{k=1}^{n}\left\lfloor\frac{n}{k}\right\rfloor$ is integer sequence A006218 in the OEIS. It is equal to a function called the divisor summatory function; i.e., it is equal to the sum over the divisor function:

$$a_n=\sum_{k=1}^{n}\left\lfloor\frac{n}{k}\right\rfloor=\sum_{k=1}^{n}d(k)=D(n).$$

David H
  • 32,536