We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
First find the number of different prime factors of all numbers in range [2,2000000] using an algorithm similar to sieve of eratosten. Then for each test case, iterate over all numbers from 2 to N and check is there is an answer or not.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #47: Distinct primes factors
You are viewing a single comment's thread. Return to all comments →
First find the number of different prime factors of all numbers in range [2,2000000] using an algorithm similar to sieve of eratosten. Then for each test case, iterate over all numbers from 2 to N and check is there is an answer or not.