# Tag Archives: sieve

Given an integer N, the task is to find the number of prime numbers up to N that can be expressed as a sum of… Read More
Given an array arr[] consisting of N positive integers, the task is to find the minimum number of pairs (arr[i], arr[j]) from the given array… Read More
Given an array arr[] consisting of N positive integers. The task is to find the length of the longest subarray of this array that contains… Read More
Given an integer N, the task is to find the smallest composite number which is not divisible by first N prime numbers. Examples: Input: N… Read More
Given an integer N, the task is to express the given number as the sum of K numbers where at least K – 1 numbers… Read More
Given two integers N and M, the task is to perform the following operations: For every value in the range [N, M], calculate the sum… Read More
Given two integers X and Y, the task is to perform the following operations: Find all prime numbers in the range [X, Y]. Generate all… Read More
Given three integers L, R, and M, the task is to find the probability of Euler’s Totient Function of a number in the range [L,… Read More
Given an array arr[] of Prime Numbers and a number M, the task is to count the number of elements in the range [1, M]… Read More
Given two integers [L, R], the task is to count the number of Primonacci Numbers in the range [L, R].  Primonacci Series: F(1) = F(2) =… Read More
Given an array arr[] of the size of N followed by an array of Q queries, of the following two types: Query Type 1: Given… Read More
Given an integer N, the task is to find the count of all possible integers less than N satisfying the following properties: The number is… Read More
Problem Description Given two numbers N1 and N2. Find prime numbers between N1 and N2, then Make all possible unique combinations of numbers from the… Read More
Given a string str and an integer K, the task is to find a string S such that it has exactly K subsequences of given… Read More
Given an array arr[] of N integers, and a range L to R, the task is to find the total number of elements in the… Read More