Is there any solution for :
i=1∑n ⌊C/i⌋ = ?
where, Constraints of C and n are : 1 ≤ C,n ≤ 10^9.
I found solution for,
i=1∑n ⌊C/i⌋ = 2 * ( i=1∑k ⌊C/i⌋ ) − k^2
where k = ⌊√n⌋ and this solution is correct only for C=n.
Is there any solution exist for C<n in complexity O(sqrt(n)) or O(log(n)) or O(1) ?