## Difference between the largest and the smallest primes in an array

Given an array of integers where all the elements are less than 10^6. The task is to find the difference between the largest and the… Read More »

- Generate elements of the array following given conditions
- Program to find the Nth Prime Number
- Check if each element of the given array is the product of exactly K prime numbers
- Maximize the size of array by deleting exactly k sub-arrays to make array prime
- Check if the given string is vowel prime
- Sum of all odd factors of numbers in the range [l, r]
- Largest number not greater than N which can become prime after rearranging its digits
- Sum of all even factors of numbers in the range [l, r]
- Count the number of primes in the prefix sum array of the given array
- Sum of Semi-Prime Numbers less than or equal to N
- Find prime number K in an array such that (A[i] % K) is maximum
- Sum of multiplication of triplet of divisors of a number
- Count of distinct sums that can be obtained by adding prime numbers from given arrays
- Check for an array element that is co-prime with all others
- Product of Primes of all Subsets
- Queries for the difference between the count of composite and prime numbers in a given range
- Check whether N is a Dihedral Prime Number or not
- Find the sum of all Truncatable primes below N
- Rearrange the given string such that all prime multiple indexes have same character
- Sum of prime numbers without odd prime digits
- Square free semiprimes in a given range using C++ STL

Given an array of integers where all the elements are less than 10^6. The task is to find the difference between the largest and the… Read More »

Given a range [L, R], the task is to find the numbers from the range which have the count of their divisors as even as… Read More »

Given an array of integers (less than 10^6), the task is to find the sum of all the prime numbers which appear after every (k-1)… Read More »

Given an array arr[] of N positive integers. The task is to write a program to find the sum of all prime elements in the… Read More »

Given an array arr[] of N positive integers. The task is to write a program to find the product of all the prime numbers of… Read More »

Given a range [l, r], the task is to find the sum of all the prime numbers within that range. Examples: Input : l=1 and… Read More »

Given a positive integer n, the task is to check if it is Euclid Number or not. Print ‘YES’ if the given number is Euclid… Read More »

Given an integer ‘n’, the task is to find the sum of first ‘n’ prime numbers. First few prime numbers are: 2, 3, 5, 7,… Read More »

Given a number N which is prime. The task is to find all the numbers less than or equal to 10^6 whose minimum prime factor… Read More »

Given a range [L, R]. The task is to find the product of all the prime numbers in the given range from L to R… Read More »

Given a number N. Find number of almost primes from 1 to . A number is called almost if it has exactly two distinct prime… Read More »

Given a range [L, R]. The task is to find the sum of all the prime numbers in the given range from L to R… Read More »

Given a m x n matrix of positive integers. The task is to find the number of paths from the top left of the matrix… Read More »

Given a number N (greater than 2 ). The task is to find two distinct prime numbers whose product will be equal to the given… Read More »

Given an array A of integers. We can remove at most one index from the array. Our goal is to maximize the length of the… Read More »