##
Find if n can be written as product of k numbers
April 17, 2017

Given a positive number n, we need to print exactly k positive numbers (all greater than 1) such that product of those k numbers is… Read More »

April 17, 2017

Given a positive number n, we need to print exactly k positive numbers (all greater than 1) such that product of those k numbers is… Read More »

April 8, 2017

Given n doors and n persons. The doors are numbered 1 to n and persons are given id’s numbered 1 to n. Each door can… Read More »

March 24, 2017

Given an integer n. Find politeness of number n. Politeness of a number is defined as the number of ways it can be expressed as… 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 3, 2017

Given an array arr[], find the largest subsequence such that GCD of all those subsequence are greater than 1. For exampple:- Input: 3, 6, 2,… 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 21, 2017

Given an array of k numbers factor[], the task is to print first n numbers (in ascending order) whose factors are from the given array.… 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 21, 2017

Given a natural number n, the task is to find sum of divisors of all the divisors of n. Examples: Input : n = 54… Read More »

January 19, 2017

Given a positive integer n. Find the minimum number which divide n to make it a perfect square. Examples: Input : n = 50 Output… Read More »

January 5, 2017

Super ugly numbers are positive numbers whose all prime factors are in the given prime list. Given a number n, the task is to find… Read More »

December 20, 2016

A Sphenic Number is a positive integer n which is product of exactly three distinct primes. The first few sphenic numbers are 30, 42, 66,… Read More »

December 17, 2016

Given a number n, the task is to calculate its primorial. Primorial of a number is similar to factorial of a number. In primorial, not… Read More »