## 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 »

## Find if nCr is divisible by the given prime

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 »

## Count the nodes in the given tree whose weight is prime

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 »

## Maximize the size of array by deleting exactly k sub-arrays to make array prime

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 »

## Rearrange the array to maximize the number of primes in prefix sum of the array

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 »

## Count the number of primes in the prefix sum array of the given array

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 »

## Find prime number K in an array such that (A[i] % K) is maximum

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 »

## New Algorithm to Generate Prime Numbers from 1 to Nth Number

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 »

## Print all numbers whose set of prime factors is a subset of the set of the prime factors of X

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 »

## Largest number not greater than N which can become prime after rearranging its digits

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 »

## Check whether N is a Dihedral Prime Number or not

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 »

## Check if product of first N natural numbers is divisible by their sum

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 »

## Length of the longest increasing subsequence such that no two adjacent elements are coprime

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 »

## Check whether factorial of N is divisible by sum of first N natural numbers

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 »

## Check if factorial of N is divisible by the sum of squares of first N natural numbers

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 »