Division Sum
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Background
This is an output-only problem. You may compute the answer by writing a program or by hand, and then submit the answer text directly.
Description
Xiao Ming wrote the following piece of code while preparing for ACM:
n = 1000000000000000000 # 1e18
ans = 0
for i in range(1, n + 1):
ans = ans + n // i
print(ans)
He waited and waited, but the program never finished. Please help him — directly output the value that this program would print.
In other words, compute:
$$S = \sum_{i=1}^{10^{18}} \left\lfloor \frac{10^{18}}{i} \right\rfloor $$Format
Only a single number. The output of the brute force code.
Samples
The example is for illustration of the format only; it may be incorrect.
5201314