##
Finding power of prime number p in n!
July 10, 2017

Given a number ‘n’ and a prime number ‘p’. We need to find out the power of ‘p’ in prime factorization of n! Examples: Input… Read More »

July 10, 2017

Given a number ‘n’ and a prime number ‘p’. We need to find out the power of ‘p’ in prime factorization of n! Examples: Input… Read More »

July 6, 2017

Given a number N, print all numbers in range from 1 to N having exactly 3 divisors. Input : N = 16 Output : 4… Read More »

June 24, 2017

Given a number ‘n’, we need to find the nth number whose each digit is a prime number i.e 2, 3, 5, 7….In other words… Read More »

June 19, 2017

Given two numbers N and K. We need to find out if ‘N’ can be written as sum of ‘K’ prime numbers. Given N <=… Read More »

May 22, 2017

We have already been introduced to primality testing in the previous articles in this series. Primality Test | Set 1 (Introduction and School Method) Primality… Read More »

May 20, 2017

Generate all prime numbers between two given numbers. The task is to print prime numbers in that range. The Sieve of Eratosthenes is one of… Read More »

May 17, 2017

Given a number, determine whether it is a valid Hyperperfect Number. A number n is called k-hyperperfect if: n = 1 + k ∑idi where… Read More »

May 5, 2017

A Left-truncatable prime is a prime which in a given base (say 10) does not contain 0 and which remains prime when the leading (“left”)… Read More »

April 20, 2017

Given a number n, find the n-th square-free number. A number is square-free if it is not divisible by a perfect square other than 1.… Read More »

April 9, 2017

Given a positive integer n, count distinct number of pairs (x, y) that satisfy following conditions : (x + y) is a prime number. (x… Read More »

March 24, 2017

Given a n-digit number. Prime point is the index of the digit whose left and right side numbers are prime. Print all the prime points… Read More »

March 6, 2017

Goldbach’s conjecture is one of the oldest and best-known unsolved problems in number theory of mathematics. Every even integer greater than 2 can be expressed… Read More »

February 28, 2017

Given an array of N integers where N is even. There are two kinds of operations allowed on the array. Increase the value of any… Read More »

February 3, 2017

Given a prime number n, the task is to find its primitive root under modulo n. Primitive root of a prime number n is an… Read More »

January 10, 2017

Given an even number (greater than 2 ), print two prime numbers whose sum will be equal to given number. There may be several combinations… Read More »