## Find a positive number M such that gcd(N^M, N&M) is maximum

Given a number N, the task is to find a positive number M such that gcd(N^M, N&M) is the maximum possible and M < N.… Read More »

## Find the winner by adding Pairwise difference of elements in the array until Possible

Given an array arr[] of positive distinct integers, two players A and B are playing a game. At each move, a player selects two numbers… Read More »

## Increasing sequence with given GCD

Given two integers n and g, the task is to generate an increasing sequence of n integers such that: The gcd of all the elements… Read More »

## Maximum GCD from Given Product of Unknowns

Given two integers N and P where P is the product of N unknown integers, the task is to find the GCD of those integers.… Read More »

## Program to find LCM of two Fibonnaci Numbers

Given here are two positive numbers a and b. The task is to print the least common multiple of a’th and b’th Fibonacci Numbers. The… Read More »

## Make Binary Search Tree

Given an array arr[] of size N. The task is to find whether it is possible to make Binary Search Tree with the given array… Read More »

## Count number of sub-sequences with GCD 1

Given an array of N numbers, the task is to count the number of subsequences which have gcd equal to 1. Examples: Input: a[] =… Read More »

## Maximum length subarray with LCM equal to product

Given an arr[], the task is to find the maximum length of the sub-array such that LCM of the sub-array is equal to the product… Read More »

## Smallest perfect square divisible by all elements of an array

Given an array arr[], the task is to find the smallest perfect square which is divisible by all the elements of the given array. Examples:… Read More »

## Smallest perfect Cube divisible by all elements of an array

Given an array arr[], the task is to find the smallest perfect cube which is divisible by all the elements of the given array. Examples:… Read More »

## Divide the two given numbers by their common divisors

Given two numbers A and B, the task is to Divide the two numbers A and B by their common divisors. The numbers A and… Read More »

## Count common prime factors of two numbers

Given two integer and , the task is to find the count of common factors of two numbers where factors are prime. Examples: Input: A… Read More »

## Count numbers in a range that are divisible by all array elements

Given N numbers and two numbers L and R., the task is to print the count of numbers in the range [L, R] which are… Read More »

## Sum of LCM(1, n), LCM(2, n), LCM(3, n), … , LCM(n, n)

Given an integer n, the task is to find the sum: LCM(1, n) + LCM(2, n) + LCM(3, n) + … + LCM(n, n) where… Read More »

## Reach the numbers by making jumps of two given lengths

Given integers k, d1, d2 and an integer array arr[]. Starting from number k you are allowed to make jumps of size d1 and d2… Read More »