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

## Sum of multiplication of triplet of divisors of a number

Given an array arr[] of integers of size n. For each element, you have to print the summation of multiplication of every triplet formed using… Read More »

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

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

## Sum of all even factors of numbers in the range [l, r]

Given a range [l, r], the task is to find the sum of all the even factors of the numbers from the given range. Examples:… Read More »

## Sum of all odd factors of numbers in the range [l, r]

Given a range [l, r], the task is to find the sum of all the odd factors of the numbers from the given range. Examples:… Read More »

## Check for an array element that is co-prime with all others

Given an array arr[] of positive integers where 2 ≤ arr[i] ≤ 106 for all possible values of i. The task is to check whether… 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 »

## Composite numbers with digit sum 1

Given a range [L, R], the task is to find all the numbers from the range which are composite as well as the eventual sum… Read More »

## Find maximum operations to reduce N to 1

Given two numbers A and B ( A and B can be up to 106 ) which forms a number N = (A!/B!). The task… 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 »

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

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