Modify the Eratosthenes Sieve to count the number of all divisors of the given number. Find an algorithm which for given number N <= 10000 will create a field of N numbers such that the value of the i-th element of the field is the number of all divisors of the number i for each i <= N, but the solution mustn´t be worse than O(n.log n).(adsbygoogle = window.adsbygoogle || []).push({});

I don´t have any idea how to proceed if I should satisfy the given maximal difficulty. Can anybody give me some hint? Thank you.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# An algorithm based on Eratosthenes Sieve

**Physics Forums | Science Articles, Homework Help, Discussion**