- Here we go |
Let's get the divisors of n!
1) Basic - Divide n in i ( i substitutes from 1 to n). If the remainder is 0, the i would be a divisor.
|
2) Avoid repetition - Suppose n is 20.
1 20
2 10
4 5
5 4 ☜ It's repeated from here.
10 2
20 1
√n is the boundary to be able to avoid repetition.
|
You can get the number of the divisors with this logic above.
Happy coding~!!