Sum of all divisors from 1 to n

Given a positive integer n. Find the value of where function F(i) for number i be defined as sum of all divisors of ‘i‘. Examples… Read More »

Smallest integer which has n factors or more

Given n, find the smallest integer which has n factors or more. It may be assumed that the result is less than 1000001. Examples: Input… Read More »

Break a number such that sum of maximum divisors of all parts is minimum

We need to split a number n such that sum of maximum divisors of all the parts is minimum. Examples : Input: n = 27… Read More »

Queries to print all divisors of number

Given a positive integer ‘n’ and query ‘q’. Print all the divisors of number ‘n’. Input: 6 Output: 1 2 3 6 Explanation Divisors of… Read More »

Divisors of n-square that are not divisors of n

Given an positive large integer n. Count the number of positive divisors of n2 which are not divisible by any divisor of n(1 <= n… Read More »

Queries to find whether a number has exactly four distinct factors or not

Given a positive integers ‘q’ and ‘n’. For each query ‘q’ find whether a number ‘n’ have exactly four distinct divisors or not. If the… Read More »

Count divisors of n that have at-least one digit common with n

Given an number n, find the number of divisors whose at least one digit in the decimal representation matches with the number n. Examples: Input… Read More »

Count divisors of array multiplication

Given an array with N elements, task is to find the count of factors of a number X which is product of all array elements.… Read More »

Total number of divisors for a given number

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

Sum of all proper divisors of natural numbers in an array

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 »

Numbers with exactly 3 divisors

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

Count total divisors of A or B in a given range

Given four integers m, n, a, b. Find how many integers from range m to n are divisible by a or b. Examples : Input:… Read More »

Find numbers with n-divisors in a given range

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 »

Sum of divisors of factorial of a number

Given a number n, we need to calculate the sum of divisors of factorial of the number. Examples: Input : 4 Output : 60 Factorial… Read More »

Count Divisors of n in O(n^1/3)

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 »