## Count of distinct sums that can be obtained by adding prime numbers from given arrays

Given two arrays arr1[] and arr2[]. The task is to count the distinct sums that can be obtained while choosing a prime element from arr1[]… Read More »

## Check if product of array containing prime numbers is a perfect square

Given an array arr[] containing only prime numbers, the task is to check if the product of the array elements is a perfect square or… Read More »

## Minimize the cost to split a number

Given an integer N ≥ 2, you can split the number as a sum of k integers i.e. N = k1 + k2 + …… Read More »

## Print all Semi-Prime Numbers less than or equal to N

Given an integer N, the task is to print all the semi-prime numbers ≤ N. A semi-prime number is an integer which can be expressed… Read More »

## Find the sum of all Truncatable primes below N

Given an integer N, the task is to find the sum of all Truncatable primes below N. Truncatable prime is a number which is left-truncatable… Read More »

## Maximum Primes whose sum is equal to given N

Given a positive integer N > 1. Find the maximum count of prime numbers whose sum is equal to given N. Examples: Input : N… Read More »

## Count Numbers in Range with difference between Sum of digits at even and odd positions as Prime

Given a range [L, R]. The task is to count the numbers in the range having difference between the sum of digits at even position… Read More »

## Smallest Special Prime which is greater than or equal to a given number

Given a number N. The task is to find the smallest special prime which is greater than or equal to N. A special prime is… Read More »

## Count primes that can be expressed as sum of two consecutive primes and 1

Given a number N. The task is to count the number of prime numbers from 2 to N that can be expressed as a sum… Read More »

## Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime

Given an integer N, the task is to print N integers ≤ 109 such that no two consecutive of these integers are co-prime and every… Read More »

## Print all multiplicative primes <= N

Given an integer N, the task is to print all the multiplicative primes ≤ N. Multiplicative Primes are the primes such that the product of… Read More »

## Largest number less than or equal to N/2 which is coprime to N

Given a number N, the task is to find the largest positive integer less than or equal to N/2 which is coprime to N. Note:… Read More »

## Print prime numbers with prime sum of digits in an array

Given an array arr[] and the task is to print the additive primes in an array. Additive primes: Primes such that the sum of their… Read More »

## Check whether the sum of absolute difference of adjacent digits is Prime or not

Given a number a N and the task is to check weather the sum of absolute difference of adjacent digit is a prime or not.… Read More »

## Count pairs in an array such that at least one element is prime

Given an array arr[] of distinct elements, the task is to count the total number of distinct pairs in which at least one element is… Read More »