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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
Given an integer N. The task is to find the Nth prime number. Examples: Input : 5 Output : 11 Input : 16 Output :… Read More »
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 »
The task is to find the triangle of numbers arising from Gilbreath’s conjecture. Gilbreath’s conjecture: It is observed that given a sequence of prime numbers,… Read More »
Given an array a[] of size N. The value of a subset is the product of primes in that subset. A non-prime is considered to… Read More »
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 »