Given an array arr[], the task is to convert it into a non-decreasing array by adding primes to array elements such that the sum of… Read More
Tag Archives: Prime Number
Given an integer N, the task is to find the number of prime numbers up to N that can be expressed as a sum of… Read More
In this article, you will see how you can write the logic of stored procedure to generate prime numbers for any given input. Title :… Read More
Given two arrays arr1[] and arr2[] of length N and M respectively, the task is to find the length of the longest common prime subsequence… Read More
Given an array arr[] consisting of N positive integers, the task is to find the minimum number of pairs (arr[i], arr[j]) from the given array… Read More
Given an integer N, the task is to find the smallest composite number which is not divisible by first N prime numbers. Examples: Input: N… Read More
Given an array arr[] consisting of N elements, the task is to minimize the array length by replacing any two coprime array elements with 1.Examples:… Read More
Given two natural numbers N and M, Create a graph using these two natural numbers using relation that a number is connected to its largest… Read More
Given an integer N, the task is to express the given number as the sum of K numbers where at least K – 1 numbers… Read More
Given an integer N, the task is to check if it is possible to make N prime by deleting any single digit from N. Examples:… Read More
Given two integers N and M, the task is to perform the following operations: For every value in the range [N, M], calculate the sum… Read More
Given an array arr[] of N positive integers and an integer K., The task is to create a set of prime numbers such that the… Read More
Given an array of pairs arr[] of two numbers {N, M}, the task is to find the maximum count of common divisors for each pair… Read More