## Bitwise AND of the sum of prime numbers and the sum of composite numbers in an array

Given an array of positive numbers, the task is to find the bitwise AND of the sum of non-prime numbers and the sum of prime… Read More »

## XOR of elements in an array having prime frequency

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

## Find out the prime numbers in the form of A+nB or B+nA

Given two integers A and B and an integer N. The task is to find out N prime numbers of the form A + nB… Read More »

## Print characters having prime frequencies in order of occurrence

Given a string str containing only lowercase characters. The task is to print the characters having prime frequency in the order of their occurrence. Note… Read More »

## Product of elements in an array having prime frequency

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

## Find the XOR of first N Prime Numbers

Given a positive integer N, the task is to find the XOR of the first N prime numbers. Examples: Input: N = 3 Output: 4… Read More »

## Count occurrences of a prime number in the prime factorization of every element from the given range

Given three integers L, R and P where P is prime, the task is to count the number of times P occurs in the prime… Read More »

## Count of numbers below N whose sum of prime divisors is K

Given two integers K and N, the task is to find the count of integers from the range [2, N – 1] whose sum of… Read More »

## Queries for the smallest and the largest prime number of given digit

Given Q queries where every query consists of an integer D, the task is to find the smallest and the largest prime number with D… Read More »

## Find all numbers between range L to R such that sum of digit and sum of square of digit is prime

Given a range L and R count all numbers between L to R such that sum of digit of each number and sum of square… Read More »

## Generate N integers satisfying the given conditions

Given an integer N, the task is to generate an array of size N with the following properties: No two elements divide each other. Every… Read More »

## Program to find the next prime number

Given an integer N. The task is to find the next prime number i.e. the smallest prime number greater than N. Examples: Input: N =… Read More »

## Square free semiprimes in a given range using C++ STL

Given two integers L and R (L < = R). The task is to find all square free semiprimes in the range L to R… Read More »

## Program to find the Nth Prime Number

Given an integer N. The task is to find the Nth prime number. Examples: Input : 5 Output : 11 Input : 16 Output :… Read More »

## Check if the first and last digit of number N is prime and their sum is less than K

Given a number N, the task is to check if its first and last digit is a prime number and their sum is less than… Read More »