Question: Solve it as soon as possible definitely upvote your solution Programming language :c /c++/python You are given an integer N, you need to find the
Solve it as soon as possible definitely upvote your solution Programming language :c /c++/python
You are given an integer N, you need to find the sum of all distinct prime factors of all numbers less than equal to N. Since the answer can be very large return it modulo 10^9+7
Input format
The first line contains an integer N. denoting the integer N mentioned in the problem
Constraints
1<=N<=10^6
Sample input
4
Sample output
7
Explanation:
1 has no prime factor. 2 has 1 distinct prime factor 2 . 3 has 1 distinct prime factor 3.
4 has 1 distinct prime factor 2. Hence the answer is 0+2+3+2=7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
