##
Find numbers with n-divisors in a given range
June 9, 2017

Given three integers a, b, n .Your task is to print number of numbers between a and b including them also which have n-divisors. A… Read More »

June 9, 2017

Given three integers a, b, n .Your task is to print number of numbers between a and b including them also which have n-divisors. A… 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 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 »

Given a number n, count all distinct divisors of it. Examples: Input : 18 Output : 6 Divisors of 18 are 1, 2, 3, 6,… Read More »

March 14, 2017

Given a number n, count total perfect divisors of n. Perfect divisors are those divisors which are square of some integer. For example a perfect… Read More »

March 10, 2017

We can calculate the prime factorization of a number “n” in O(sqrt(n)) as discussed here. But O(sqrt n) method times out when we need to… Read More »

March 7, 2017

Given an array arr[], find nearest element for every element such that there is at least one common prime factor. In output, we need to… Read More »

Given an integer N. The task is to find a number that is smaller than or equal to N and has maximum prime factors. In… Read More »

March 1, 2017

There are Q queries. Each query is of the form of L and R. The task is to output sum of number of prime factors… 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 »

January 31, 2017

Given two numbers n and k, print k-th prime factor among all prime factors of n. For example, if the input number is 15 and… Read More »

January 22, 2017

The classical Sieve of Eratosthenes algorithm takes O(N log (log N)) time to find all prime numbers less than N. In this article, a modified… 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 »