Sieve of Eratosthenes -  Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number.  GFG Least prime factor of numbers till n - Given a number n, print least prime factors of all numbers from 1 to n.  GFG  Algo: Use  Sieve of… Continue reading Prime