## 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
- Product of Primes of all Subsets
- Sum of numbers in a range [L, R] whose count of divisors is prime
- Program for Mobius Function | Set 2
- 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
- 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
- Absolute difference between the XOR of Non-Prime numbers and Prime numbers of an Array
- Print characters having prime frequencies in order of occurrence
- GCD of elements which occur prime number of times
- Square free semiprimes in a given range using C++ STL
- Queries for the smallest and the largest prime number of given digit

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 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 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 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 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 »

Given an array arr[] of N elements, the task is to find the GCD of the elements which have prime frequencies in the array. Note… Read More »

Given an array arr[] of N positive integers, the task is to calculate the absolute difference between XOR of non-prime numbers and prime numbers. Note… Read More »

Given an array of positive numbers, the task is to find the bitwise AND of the sum of non-prime numbers and the sum of prime… Read More »

Given a string str containing only lowercase characters. The task is to print the characters having prime frequency in the order of their occurrence. Note… Read More »

Given a positive integer N, the task is to find the XOR of the first N prime numbers. Examples: Input: N = 3 Output: 4… Read More »

Given an integer N. The task is to find Mobius function of all numbers from 1 to N. Examples: Input: N = 5 Output: 1… Read More »