Approach issues

what should I do , Do I have to check for every prime no. from 3 to n and then check for factors

@02.adarsh.99 you first need to find all the prime numbers till n, using sieve of Eratosthenes and store them in an array.
Now using the prime number find the prime factors of the number.

bt prime seive is not possible according to hint anyways resolved I solved it! Thanku

1 Like