# Tag Archives: divisors

## Largest divisor of a number not divisible by another given number

Given two positive integers P and Q, the task is to largest divisor of P which is not divisible by Q. Examples: Input: P =… Read More »

## Minimum value exceeding X whose count of divisors has different parity with count of divisors of X

Given an integer X, the task is to determine the minimum value of Y greater than X, such that count of divisors of X and… Read More »

## Maximum number of Perfect Numbers present in a subarray of size K

Given an array arr[ ] consisting of N integers, the task is to determine the maximum number of perfect Numbers in any subarray of size… Read More »

## Count possible values of K such that X – 1 and Y – 1 modulo K is same

Given two numbers X and Y, the task is to find the count of integers K which satisfies the equation (X – 1) % K… Read More »

## Minimum repeated addition of even divisors of N required to convert N to M

Given two numbers N and M, the task is to find the minimum operations required to convert N to M by repeatedly adding it with… Read More »

## Create a Graph by connecting divisors from N to M and find shortest path

Given two natural numbers N and M, Create a graph using these two natural numbers using relation that a number is connected to its largest… Read More »

## Product of proper divisors of a number for Q queries

Given an integer N, the task is to find the product of proper divisors of the number modulo 109 + 7 for Q queries. Examples:… Read More »

## Check if a number has an odd count of odd divisors and even count of even divisors

Given an integer N, the task is to check if N has an odd number of odd divisors and even number of even divisors. Examples:… Read More »

## Maximum count of pairwise co-prime and common divisors of two given numbers

Given an array of pairs arr[] of two numbers {N, M}, the task is to find the maximum count of common divisors for each pair… Read More »

## Sum of product of all integers upto N with their count of divisors

Given a positive integer N, the task is to find the sum of the product of all the integers in the range [1, N] with their… Read More »

## Sum of largest divisor of numbers upto N not divisible by given prime number P

Given a number N and a prime number P, the task is to find the sum of the largest divisors of each number in the… Read More »

## Count of integers up to N which are non divisors and non coprime with N

Given an integer N, the task is to find the count of all possible integers less than N satisfying the following properties: The number is… Read More »

## Count of multiplicative partitions of N

Given an integer N, the task is to find the total number of multiplicative partition for N. Multiplicative Partition: Number of ways of factoring of… Read More »

## Product of divisors of a number from a given list of its prime factors

Given an array arr[] representing a list of prime factors of a given number, the task is to find the product of divisors of that… Read More »

## Print all proper fractions with denominators less than equal to N

Given an integer N, the task is to print all proper fractions such that the denominator is less than or equal to N.   Proper Fractions:… Read More »