## How is the time complexity of Sieve of Eratosthenes is n*log(log(n))?

Pre-requisite: Sieve of Eratosthenes What is Sieve of Eratosthenes algorithm? In order to analyze it, let’s take a number n and the task is to… Read More »

- Program to find the Nth Prime Number
- Count occurrences of a prime number in the prime factorization of every element from the given range
- Generate N integers satisfying the given conditions
- Find out the prime numbers in the form of A+nB or B+nA
- Product of Primes of all Subsets
- Sum of numbers in a range [L, R] whose count of divisors is prime
- XOR of elements in an array having prime frequency
- Program to find the next prime number
- Triangle of numbers arising from Gilbreath's conjecture
- Find the sum of prime numbers in the Kth array
- Find all numbers between range L to R such that sum of digit and sum of square of digit is prime
- Check if the first and last digit of number N is prime and their sum is less than K
- Find the XOR of first N Prime Numbers
- Bitwise AND of the sum of prime numbers and the sum of composite numbers in an array
- Sum of prime numbers without odd prime digits
- Absolute difference between the XOR of Non-Prime numbers and Prime numbers of an Array
- Print characters having prime frequencies in order of occurrence
- Product of elements in an array having prime frequency
- Prime Subset Product Problem
- GCD of elements which occur prime number of times
- Find third number such that sum of all three number becomes prime
- Square free semiprimes in a given range using C++ STL
- Maximum count of common divisors of A and B such that all are co-primes to one another
- Count of numbers below N whose sum of prime divisors is K
- Queries for the smallest and the largest prime number of given digit
- XOR of K largest prime and composite numbers from the given array

Pre-requisite: Sieve of Eratosthenes What is Sieve of Eratosthenes algorithm? In order to analyze it, let’s take a number n and the task is to… Read More »

Given a number K, the task is to print the prime numbers present at that level given all the prime numbers are represented in the… Read More »

Given an array arr[] of N integers, the task is to remove all the prime numbers. Examples: Input: arr[] = {4, 6, 5, 3, 8,… Read More »

Given two integers X and Y where X > Y, the task is to check if there exists an prime number P such that if… Read More »

Given an integer N, the task is to find the count of all the primes below N which can be expressed as the sum of… Read More »

Given an integer D, the task is to find the sum of all the prime numbers whose maximum position of set bits (farthest set bit… Read More »

Given Q queries and an integer K where each query consists of a range [L, R] and the task is to find the count of… Read More »

Given an integer D, the task is to find the sum of all the prime numbers whose count of digits is less than or equal… Read More »

Given an integer N and a base number A, the task is to check whether N is a Euler Pseudoprime to the given base A.… Read More »

Given two integers X and Y, the task is to convert X to Y using the following operations: Add any prime number to X. Subtract… Read More »

Given two integers L and R, the task is to find the minimum difference between any two prime numbers in the range [L, R]. Examples:… Read More »

Given a number N, the task is to print the first N prime number from 1 to N. Examples: Input: N = 10 Output: 2,… Read More »

Given an integer D, the task is to find all the prime numbers having D digits. Examples: Input: D = 1 Output: 2 3 5… Read More »

Given Q queries where each query consists of an integer range [L, R], the task is to find the sum of the integers from the… Read More »

Given K arrays where the first array contains the first prime number, the second array contains the next 2 primes and the third array contains… Read More »