Number of Factors of N!
Easy Accuracy: 51.8% Submissions: 35 Points: 2

Given a positive integer N, find the number of factors in N! ( N factorial).

Example :

Input:
N = 5
Output:
16
Explanation:
5! is 120 and the number of factors of
120 are 1 2 3 4 5 6 8 10 12 15 20 24 30
40 60 120 So the number of factors are 16.

Example 2:

Input:
N = 4
Output:
8
Explanation:
4! is 24 and the number of factors of
24 are 1 2 3 4 6 8 12 24
So the number of factors are 8.

 

Your Task:  
You don't need to read input or print anything. Your task is to complete the function factorsOfFactorial() which takes an integer N as an input parameter and return the number of factors of N factorial.

Expected Time Complexity: O(NLogLogN)
Expected Auxiliary Space: O(N)

Constraints:
1 <= N <= 100

 

 

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.


to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Number of Factors of N!

Output Window