##
Total number of divisors for a given number
September 10, 2017

Given a positive integer n, we have to find the total number of divisors for n. Examples: Input : n = 25 Output : 3… Read More »

September 10, 2017

Given a positive integer n, we have to find the total number of divisors for n. Examples: Input : n = 25 Output : 3… Read More »

September 9, 2017

Given a number N, find the maximum number of unique prime factors any number can have in range [1, N]. Examples: Input : N =… Read More »

August 8, 2017

Given a number, find minimum sum of its factors. Examples: Input : 12 Output : 7 Explanation: Following are different ways to factorize 12 and… Read More »

July 17, 2017

Factor Tree is an intuitive method to understand factors of a number. It shows how all the factors are been derived from the number. It… Read More »

July 11, 2017

Given an array of natural numbers count the sum of its proper divisors for every element in array. Input : int arr[] = {8, 13,… 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 »

July 4, 2017

Given an array of integers. Find the total number of subarrays whose product of all elements doesn’t contain repeating prime factor in prime decomposition of… Read More »

June 20, 2017

Given a number N. You are tasked with finding the smallest number S, such that N is a factor of S! (S factorial). N can… 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 »