##
Factor Tree of a given Number
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 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 »

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 »