## Check if each element of the given array is the product of exactly K prime numbers

Given an array of numbers and the value of , check if each number can be expressed as the product of exactly prime numbers. For… Read More »

- New Algorithm to Generate Prime Numbers from 1 to Nth Number
- Largest palindromic prime in an array
- Minimize the cost to split a number
- Length of the longest increasing subsequence such that no two adjacent elements are coprime
- Sum of elements in an array having prime frequency
- Number of divisors of product of N numbers
- Print all safe primes below N
- Check if the sum of primes is divisible by any prime from the array
- Print prime numbers with prime sum of digits in an array
- Maximum GCD of N integers with given product
- Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
- Minimum absolute difference of a number and its closest prime
- Count pairs in an array such that at least one element is prime
- Count characters in a string whose ASCII values are prime
- Check if each element of the given array is the product of exactly K prime numbers
- Check if factorial of N is divisible by the sum of squares of first N natural numbers
- Check if N is Strong Prime
- Print all Semi-Prime Numbers less than or equal to N
- Largest number less than or equal to N/2 which is coprime to N
- Smallest Special Prime which is greater than or equal to a given number
- Count Numbers in Range with difference between Sum of digits at even and odd positions as Prime
- Rearrange the array to maximize the number of primes in prefix sum of the array
- Maximize the size of array by deleting exactly k sub-arrays to make array prime
- Check whether factorial of N is divisible by sum of first N natural numbers
- Print all Proth primes up to N
- Find the sum of non-prime elements in the given array
- Check if product of array containing prime numbers is a perfect square
- All pairs whose xor gives unique prime
- Largest number not greater than N which can become prime after rearranging its digits
- Print all multiplicative primes <= N

Given an array of numbers and the value of , check if each number can be expressed as the product of exactly prime numbers. For… Read More »

Given three integers N, R and P where P is prime, the task is to find whether NCR is divisible by P or not. Examples:… Read More »

Given a tree, and the weights of all the nodes, the task is to count the number of nodes whose weight is prime. Examples: Input:… Read More »

Given an array arr[] of N positive integers and a non negative integer K. The task is to delete exactly K sub-arrays from the array… Read More »

Given an array arr[] of 1’s and 2’s, the task is to re-arrange the array in such a way that the prefix sum of the… Read More »

Given an array arr[] of N integers, the task is to count the number of primes in the prefix sum array of the given array.… Read More »

Given an array arr[] of n integers. The task is to find an element from the array K such that K is prime. And, arr[i]… Read More »

Apart from Sieve of Eratosthenes method to generate Prime numbers, we can implement a new Algorithm for generating prime numbers from 1 to N. It… Read More »

Given a number X and an array of N numbers. The task is to print all the numbers in the array whose set of prime… Read More »

Given a number N, the task is to find the largest number less than or equal to the given number N such that on rearranging… Read More »

Given an integer N, the task is to check if N is a Dihedral prime number or not. A Dihedral prime is a prime number… Read More »

Given an integer N, the task is to check whether the product of first N natural numbers is divisible by the sum of first N… Read More »

Given an array arr[] of size N. The task is to find the length of the longest subsequence from the given array such that the… Read More »

Given a number ‘N’. Check whether factorial of ‘N’ is divisible by the sum of first ‘N’ natural numbers or not? If divisibility is possible,… Read More »

Given an integer N, the task is to find whether fact(N) is divisible by sum(N) where fact(N) is the factorial of N and sum(N) =… Read More »