Tag Archives: sieve

Given an array arr[] consisting of N positive integers, the task is to find an index from the array having count of prime numbers present… Read More
Given a positive integer N, the task is to count the number of integers from the range [1, N] having exactly 5 divisors. Examples: Input:… Read More
Given an array arr[] of size N, the task is to rearrange the array elements such that all the Prime numbers are placed before the… Read More
Given a positive integer N, the task is to find the absolute difference of the count of odd and even factors of N. Examples: Input:… Read More
Given a positive integer N, the task is to find the Nth Composite Number. Examples: Input: N = 1Output: 4 Input: N = 3 Output: 8… Read More
Given an array arr[] consisting of N positive integers, the task is to find the number of array elements whose count of divisors is a… Read More
Given a positive integer N, the task is to find the count of prime numbers less than or equal to N that can be represented… Read More
Given a positive integer N, the task is to find the smallest semi-prime number such that the difference between any of its two divisors is… Read More
Given a positive integer N, the task is to check if N can be represented as a sum of a Prime Number and a Perfect… Read More
Given a positive integer N, the task is to find all the prime triplets {P, Q, R} such that P = R – Q and… Read More
Given an integer N, the task is to count numbers from the range [1, N] which are the power of prime numbers. Examples: Input: N… Read More
Given an array arr[] consisting of N positive integers, the task is to find the minimum number of primes numbers required to be subtracted from… Read More
Given an array Q[] consisting of N integers, the task for each element of the array Q[] is to check whether any of the numbers,… Read More
Given three positive integers M, X, and Y, the task is to find the minimum number of operations required to make X and Y equal… Read More
Given two arrays A[] and B[] consisting of N and M integers respectively, the task is to count pairs (A[i], B[j]) such that the product… Read More