I would like to calculate the calculation amount when calculating O(N/k) from k=1 to k=N.
(O is the order notation.)
It seems that the following equation will be established if we ask for a rough order to calculate the calculated amount.
How do I calculate this?
If you go a little further,
and equality could be obtained from the infinite series sum.
That means I don't know how to calculate.
I look forward to your kind cooperation.
c algorithm mathematics
The series (partial sum of ) presented by the questioner has a name and is called a harmonic series (partial sum of ).
In general, I understand that the order is logN because the integral [[k=1,N+1]1/kdk=log(N+1) llogN and the partial sum of the series can be approximated as this integral.
For more detailed calculations, please refer to the following.
https://ameblo.jp/mossalmon/entry-12320091570.html
© 2024 OneMinuteCode. All rights reserved.