Dealing with a problem, I need to find some $f(x)$ to solve the following asymptotic when $n$ grows to infinity: $$ \frac{n}{\log(n)}\sim \sum_{k=1}^{n} f\left(\frac{n}{k}\right)$$
I have checked with a Python program that $f(x) = \frac{\log(x)}{\log\log(x)}$ has almost no error when I calculate $\sum_{k=1}^{n} \left(\frac{\log\left(\frac{n}{k}\right)}{\log\log\left(\frac{n}{k}\right)}\right) - \frac{n}{\log(n)}$. However, I am not sure about how to prove formally why the asymptotic holds.
Here is what I have tried. Stirling's formula guarantees that, when $n$ grows to infinity, $\log(n!)\sim n\log(n) - n$. Therefore, we have that, when $n$ grows to infinity, $$\sum_{k=1}^{n} \log\left(\frac{n}{k}\right)=n\log(n) - \log(n!) \sim n\log(n) -n\log(n) + n \sim n$$
$$\sum_{k=1}^{n} \log\log\left(\frac{n}{k}\right)=n\log\log(n) - \log\log(n!) \sim n\log\log(n) -n\log\log(n) + \log (n) \sim \log (n)$$
I am not sure if the above is correct, and how to conclude the proof. Could you help me with the formal proof stating that when $n$ grows to infinity we have that $$ \frac{n}{\log(n)}\sim \sum_{k=1}^{n} \frac{\log\left(\frac{n}{k}\right)}{\log\log\left(\frac{n}{k}\right)}$$
Thanks in advance!