## Sum of largest divisible powers of p (a prime number) in a range

Given a range [L, R], and a prime number P. We are required to find the sum of the highest power of P in all… Read More »

Given a range [L, R], and a prime number P. We are required to find the sum of the highest power of P in all… Read More »

A number is said to be sandwiched between primes if the number just after it and the number just before are Prime numbers. So, a… Read More »

Given a number n, check whether it’s prime number or not using recursion. Examples: Input : n = 11 Output : Yes Input : n… Read More »

Given an array, find elements which appears prime number of times in the array with minimum k frequency (frequency >= k). Examples : Input :… Read More »

Write a program to print all sophie germain number less than n. A prime number p is called a sophie prime number if 2p+1 is… Read More »

Given two numbers, fact and n, find the largest power of n that divides fact! (Factorial of fact). Examples: Input : fact = 5, n… Read More »

Prime Triplet is a set of three prime numbers of the form (p, p+2, p+6) or (p, p+4, p+6). This is the closest possible grouping… Read More »

A pernicious number is a positive integer which has prime number of ones in its binary representation. The first pernicious number is 3 since 3… Read More »

Given three numbers and check weather they adjacent primes are not. Three prime numbers are said to be adjacent primes if there is no prime… Read More »

A Twin prime are those numbers which are prime and having a difference of two ( 2 ) between the two prime numbers. In other… Read More »

Given a string, our task is to print the characters present at prime index. Examples : Input : I love programming Output : lv gan… Read More »

Given a positive integer n. Find whether a number is a semiprime or not. Print True if number is semiprime else False. A semiprime is… Read More »

Given an array A[], find a subset of maximum size in which sum of every pair of elements is a prime number. Print its length… Read More »

Given an array of N elements, find the minimum number of insertions to convert the given array into a co-prime array. Print the resultant array… Read More »

An Emirp Number (prime spelled backwards) is a prime number that results in a different prime when its decimal digits are reversed. This definition excludes… Read More »