Define f(x) as the number of factors of a positive integer x. Given an integer N, determine ∑i=1Nf(i).
The only line contains an integer, N (1≤N≤1012).
Output the value of ∑i=1Nf(i).
5
10
1 has 1 factor: 1.
2 has 2 factors: 1 and 2.
3 has 2 factors: 1 and 3.
4 has 3 factors: 1, 2, and 4.
5 has 2 factors: 1 and 5.
∑i=1Nf(i)=1+2+2+3+2=10
TLE with haskell :(
Haskell lazy evaluation isn't magic, directly factoring each of the 1012 numbers must take at least 1012 operations and will always be too slow.
Comments
TLE with haskell :(
Haskell lazy evaluation isn't magic, directly factoring each of the
numbers must take at least 
operations and will always be too slow.