Next smallest prime palindrome

Given a positive integer N where . The task is to find the smallest prime palindrome greater than or equal to N. Examples: Input: 8… Read More »

Maximum no. of contiguous Prime Numbers in an array

Given an array arr[] of N elements. The task is to find the maximum number of the contiguous prime numbers in the given array. Examples:… Read More »

Minimum and Maximum Prime Numbers of a Singly Linked List

Given a singly linked list containing N nodes, the task is to find the minimum and maximum prime number. Examples: Input : List = 15… Read More »

Minimum and Maximum prime numbers in an array

Given an array arr[] of N positive integers. The task is to find the minimum and maximum prime elements in the given array. Examples: Input:… Read More »

Sum and Product of all Prime Nodes of a Singly Linked List

Given a singly linked list containing N nodes, the task is to find the sum and product of all nodes from the list which are… Read More »

Check if difference of areas of two squares is prime

Given two squares with side lengths and (a > b). The task is to check if difference of their areas is prime or not. Here… Read More »

Absolute difference between the Product of Non-Prime numbers and Prime numbers of an Array

Given an array of positive numbers, the task is to calculate the absolute difference between product of non-prime numbers and prime numbers. Note: 1 is… Read More »

Sort prime numbers of an array in descending order

Given an array of integers ‘arr’, the task is to sort all the prime numbers from the array in descending order in their relative positions… Read More »

Count number of integers less than or equal to N which has exactly 9 divisors

Given a number N(1<=N<=109), the task is to find the total number of integers less than equal to n which have exactly 9 divisors. Examples:… Read More »

First triangular number whose number of divisors exceeds N

Given a number N, find the first triangular number whose number of divisors exceeds N. Triangular numbers are sums of natural numbers, i. e., of… Read More »

Sort only non-prime numbers of an array in increasing order

Given an array of N integers. The task is to print the sorted array such that all numbers that are prime stay in the same… Read More »

All possible co-prime distinct element pairs within a range [L, R]

Given a range [L, R], the task is to find all possible co-prime pairs from the range such that an element doesn’t appear in more… Read More »

Print all Prime Quadruplet of a number less than it

Given a positive integer n, print every Prime Quadruplet below . Prime quadruplet: In mathematics, Prime Quadruplet is a set of four primes of the… Read More »

Check if a number is Primorial Prime or not

Given a positive number N, the task is to check if N is a primorial prime number or not. Print ‘YES’ if N is a… Read More »

Pair of prime numbers with a given sum and minimum absolute difference

Given an integer ‘sum’ (less than 10^8), the task is to find a pair of prime numbers whose sum is equal to the given ‘sum’… Read More »