This is a programming question I found on Atcoder and I am trying to solve it just using mathematics. I want a simple formula to find number of tuples without using a computer. So I derived a formula to calculate it: $Sn = \sum_{x=1}^n [\frac{n-1}{x}]$
But this formula is so complicated. The best approximation I found is $Sn \approx [(n-1) ln(n)]$ is there any way to simplify it even more ? I need the formula to work for all positive integers up to $10^6$.