Skip to content

# Tag Archives: HCF

Given an integer N, the task is to count the values of K ( where 1 ≤ K≤ N ), such that 1< GCD(K, N)… Read More
Given an integer N, the task to print the count numbers from the range [1, N] whose adjacent digits are not co-prime.  Two numbers A… Read More
Given a Binary Tree, the task is to construct an array such that ith index of the array contains GCD of all the nodes present… Read More
Given two arrays of strings arr[] and k[] of size N and M respectively, the task is to sort the array arr[] after replacing each… Read More
Given a positive integer N, the task is to find the number of positive integers whose GCD with the given integer N is the number… Read More
Given an integer N, the task is to count the number of integers from the range [1, N] having at least one in common prime… Read More
Given an array arr[] consisting of N positive integers, the task is to sort the array arr[] according to the increasing order of GCD of… Read More
Given an array arr[] consisting of N integers and two positive integers L and R, the task is to find the farthest co-prime number in… Read More
Given three non-negative integers A, B, and C, the task is to count the numbers in the range [1, C] that can be reduced to… Read More
Given an array arr[] consisting of N positive integers, the task is to find the LCM of all unique elements of the given array. If… Read More
In this article, we will discuss the time complexity of the Euclidean Algorithm which is O(log(min(a, b)) and it is achieved. Euclid’s Algorithm: It is… Read More
Given an array arr[] size N, the task is to find the smallest number which is not co-prime with any element of the given array.… Read More
Given two integers X and Y, the task is to make X and Y equal by dividing either of X or Y by 2, 3,… Read More
Given two arrays A[] and B[], both consisting of N positive integers, an integer P and the elements of the array A[] are pairwise co-prime, the… Read More
Given two integers N and M representing the number of boys and girls, the task is to arrange them in number of different rows of… Read More