# Tag Archives: Prime Number

Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 <=… Read More
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 Output:  … Read More
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 Output:  … Read More
Given three variables L, R and Q which denotes the range [L, R] and total number of queries. For each query there will be a… Read More
Given an array arr[] of size N, the task is to find the maximum difference between the sum of the prime numbers and the sum… Read More
Given an array arr[] of size N, the task is to find the maximum difference between the sum of the prime numbers and the sum… Read More
Given an array arr[], the task is to check if it is possible to sort the given array using any number of operations where at… Read More
Given a 2d array mat[][], the task is to find and print the prime numbers along with their position (1-based indexing) in this 2d array.… Read More
Find the number of permutations of first N positive integers such that the sum of any two consecutive numbers is prime where all the cyclic… Read More
Given a number N, the task is to check if N can be represented as the product of a prime and a composite number or… Read More
Given a positive integer N. In one operation subtract N with its highest divisor other than N and 1. The task is to find minimum… Read More
Given a positive integer N, the task is to find the number of unordered pairs of semi-prime numbers in the range [1, N] such that… Read More
Given an array arr[] of size N. The task is to find the minimum number of swaps required to re-arrange the array such that all… Read More