## Levelwise Alternating GCD and LCM of nodes in Segment Tree

A Levelwise GCD/LCM alternating segment tree is a segment tree, such that at every level the operations GCD and LCM alternate. In other words at… Read More »

- Reach the numbers by making jumps of two given lengths
- Number of array elements derivable from D after performing certain operations
- Find three integers less than or equal to N such that their LCM is maximum
- Smallest perfect square divisible by all elements of an array
- Program to calculate the value of nCr Efficiently
- Minimum sum of the elements of an array after subtracting smaller elements from larger
- Find an integer X which is divisor of all except exactly one element in an array
- Program to find Nth term divisible by a or b
- Sum of LCM(1, n), LCM(2, n), LCM(3, n), ... , LCM(n, n)
- Sum of common divisors of two numbers A and B
- Maximum GCD of N integers with given product
- Number of Co-prime pairs from 1 to N with product equals to N
- Count numbers in a range that are divisible by all array elements
- LCM of N numbers modulo M
- Count numbers in a range having GCD of powers of prime factors equal to 1
- Largest N digit number divisible by given three numbers
- LCM and HCF of fractions
- Minimum value that divides one number and divisible by other
- Count common prime factors of two numbers
- Time taken by two persons to meet on a circular track
- Find the GCD of N Fibonacci Numbers with given Indices
- Minimum removals from array to make GCD greater
- Find any pair with given GCD and LCM
- GCD of a number raised to some power and another number
- Find two numbers whose sum and GCD are given
- Maximum length subarray with LCM equal to product
- Queries to count the number of unordered co-prime pairs from 1 to N
- Divide the two given numbers by their common divisors
- Minimum cuts required to divide the Circle into equal parts
- Program to find HCF (Highest Common Factor) of 2 Numbers

A Levelwise GCD/LCM alternating segment tree is a segment tree, such that at every level the operations GCD and LCM alternate. In other words at… Read More »

Given an array a[] of n elements. The task is to find the array (say b[]) of n + 1 such that Greatest Common Divisor… Read More »

Given an array and k, we need to find the minimum operations needed to make GCD of the array equal or multiple of k. Here… Read More »

Given a set of N elements such that N, task is to generate an array such that the GCD of any subset of the generated… Read More »

Given N and M, task is to find whether numbers 1 to N can be divided into two sets such that the absolute difference between… Read More »

Given L and R, find a possible non transitive triplet (a, b, c) such that pair (a, b) is coprime and pair (b, c) is… Read More »

Given a number, we need to find LCM of the factorial of the numbers and its neighbors. If the number is N, we need to… Read More »

Given two positive integer N, M. The task is to check if N and M are friendly pair or not. In number theory, friendly pairs… Read More »

Given the Numerator and Denominator of N fractions. The task is to find the product of N fraction and output the answer in reduced form.… Read More »

Given a fraction series. Find the H.C.F of a given fraction series. Examples: Input : [{2, 5}, {8, 9}, {16, 81}, {10, 27}] Output :… Read More »

Give a positive integer n, find modular multiplicative inverse of all integer from 1 to n with respect to a big prime number, say, ‘prime’.… Read More »

Given an array of rational numbers, the task is to find the LCM of these numbers. Examples: Input : vect[] = {2/7, 3/14, 5/3} Output… Read More »

Given two Rational numbers, the task is to find the maximum of given two rational numbers. Examples : Input : first = 3/4, second= 3/2… Read More »

HCF (Highest Common Factor) or GCD (Greatest Common Divisor) of two numbers is the largest number that divides both of them. For example GCD of… Read More »

Given x, y, z and n, find smallest n digit number which is divisible by x, y and z. Examples: Input : x = 2,… Read More »