## Find distinct prime factors from 1 to n in O((n+q)logn) (for q Queries)

Problem: Find distinct prime factors of a number. You will be asked q times. Naive approach: Find out distinct prime factors for each query. It’s inefficient for large number of queries. As each query...