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

## Print all safe primes below N

Given an integer N, the task is to print all safe primes below N safe primes. A safe prime is a prime number of the… Read More »

## Print all Proth primes up to N

Given a number N, the task is to check whether the given number is Proth Prime or not. A Proth prime is a Proth Number… Read More »

## Find the sum of non-prime elements in the given array

Given an array arr[] and the task is to print the sum of the non-prime elements from the array. Examples: Input: arr[] = {1, 3,… Read More »

## Number of divisors of product of N numbers

Given an array arr[] of integers, the task is to count the number of divisors of product of all the elements from given array. Examples:… Read More »

## Check if N is Strong Prime

Given a positive integer N, the task is to check if N is a strong prime or not. In number theory, a strong prime is… Read More »

## Check if N is a Factorial Prime

Given a positive integer N, the task is to check if N is a Factorial prime or not. If it is a factorial prime then… Read More »

## Maximum GCD of N integers with given product

Given N integers with unknown values (ai > 0) having product P. The task is to find the maximum possible greatest common divisor of these… Read More »