## Sum of prime numbers without odd prime digits

Given an integer N. The task is to find the sum of the first N prime numbers which don’t contain any odd primes as their… Read More »

## Ramanujan Prime

The Nth Ramanujan prime is the least integer Rn for which where π(x) is a prime-counting function Note that the integer Rn is necessarily a… Read More »

## Find prime numbers in the first half and second half of an array

Given an array arr of size N. The task is to find the prime numbers in the first half (up to index N/2) and the… Read More »

## Check if the given string is vowel prime

Given a string str of lowercase English alphabets, the task is to check whether the string is a vowel prime or not. A string is… Read More »

## Find the prime P using given four integers

Given four integers X, Y, X2%P, Y2%P, where P is a prime number. The task is to find prime P. Note: Answer always exsits. Examples:… Read More »

## Minimum operations required to convert X to Y by multiplying X with the given co-primes

Given four integers X, Y, P and Q such that X ≤ Y and gcd(P, Q) = 1. The task is to find minimum operation… Read More »

## Longest subsequence such that every element in the subsequence is formed by multiplying previous element with a prime

Given a sorted array of N integers. The task is to find the longest subsequence such that every element in the subsequence is reachable by… Read More »

## Sum of Semi-Prime Numbers less than or equal to N

Given an integer N, the task is to find the sum of semi-prime numbers which are less than or equal to N. A Semi prime… Read More »

## Partition first N natural number into two sets such that their sum is not coprime

Given an integer N, the task is to partition the first N natural numbers in two non-empty sets such that the sum of these set… Read More »

## Rearrange the given string such that all prime multiple indexes have same character

Given a string str of size N. The task is to find out whether it is possible to rearrange characters in string str so that… Read More »

## Find a sequence of N prime numbers whose sum is a composite number

Given an integer N and the task is to find a sequence of N prime numbers whose sum is a composite number. Examples: Input: N… Read More »

## Generate elements of the array following given conditions

Given an integer N, for every integer i in the range 2 to N, assign a positive integer such that the following conditions hold :… Read More »

## Number of 0s and 1s at prime positions in the given array

Given an array arr[] of size N where each element is either 0 or 1. The task is to find the count of 0s and 1s which are at prime… Read More »

## Find the sum of the ascii values of characters which are present at prime positions

Given a string str of size N, the task is to find the sum of all ASCII values of the characters which are present at… Read More »

## Queries for the difference between the count of composite and prime numbers in a given range

Given Q queries where each query consists of two positive integers L and R and the task is to find the absolute difference between the… Read More »