## Sum of all the prime numbers with the maximum position of set bit ≤ D

Given an integer D, the task is to find the sum of all the prime numbers whose maximum position of set bits (farthest set bit… Read More »

## Queries to count integers in a range [L, R] such that their digit sum is prime and divisible by K

Given Q queries and an integer K where each query consists of a range [L, R] and the task is to find the count of… Read More »

## Sum of all the prime numbers with the count of digits ≤ D

Given an integer D, the task is to find the sum of all the prime numbers whose count of digits is less than or equal… Read More »

## Check if a number is Euler Pseudoprime

Given an integer N and a base number A, the task is to check whether N is a Euler Pseudoprime to the given base A.… Read More »

## Maximum prime moves to convert X to Y

Given two integers X and Y, the task is to convert X to Y using the following operations: Add any prime number to X. Subtract… Read More »

## Minimum difference between any two primes from the given range

Given two integers L and R, the task is to find the minimum difference between any two prime numbers in the range [L, R]. Examples:… Read More »

## Program to print first N Prime numbers

Given a number N, the task is to print the first N prime number from 1 to N. Examples: Input: N = 10 Output: 2,… Read More »

## Find all the prime numbers of given number of digits

Given an integer D, the task is to find all the prime numbers having D digits. Examples: Input: D = 1 Output: 2 3 5… Read More »

## Sum of numbers in a range [L, R] whose count of divisors is prime

Given Q queries where each query consists of an integer range [L, R], the task is to find the sum of the integers from the… Read More »

## Find the sum of prime numbers in the Kth array

Given K arrays where the first array contains the first prime number, the second array contains the next 2 primes and the third array contains… Read More »

## Maximum count of common divisors of A and B such that all are co-primes to one another

Given two integers A and B. The task is to find the count of maximum elements from the common divisors of A and B such… Read More »

## GCD of elements which occur prime number of times

Given an array arr[] of N elements, the task is to find the GCD of the elements which have prime frequencies in the array. Note… Read More »

## XOR of K largest prime and composite numbers from the given array

Given an array arr[] of N non-zero positive integers and an integer K, the task is to find the XOR of the K largest prime… Read More »

## Find third number such that sum of all three number becomes prime

Given two numbers A and B. The task is to find the smallest positive integer greater than or equal to 1 such that the sum… Read More »

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

Given an array arr[] of N positive integers, the task is to calculate the absolute difference between XOR of non-prime numbers and prime numbers. Note… Read More »