# Tag Archives: prime-factor

## Construct a string that has exactly K subsequences from given string

Given a string str and an integer K, the task is to find a string S such that it has exactly K subsequences of given… Read More »

## Find largest factor of N such that N/F is less than K

Given two numbers N and K, the task is to find the minimum value X such that N < X*K. Examples: Input: N = 8,… Read More »

## Count of square free divisors of a given number

Given an integer N, the task is to count the number of square-free divisors of the given number. A number is said to be square-free,… Read More »

## Count of elements having Euler’s Totient value one less than itself

Given an array arr[] of N integers, and a range L to R, the task is to find the total number of elements in the… Read More »

## Count of prime factors of N to be added at each step to convert N to M

Given two integers N and M, the task is to find out minimum number of operations required to convert N to M. Each operation involves… Read More »

## First element of every K sets having consecutive elements with exactly K prime factors less than N

Given two integers N and K, the task is to find the first element for every set of K consecutive elements which have exactly K… Read More »

## Minimise N such that sum of count of all factors upto N is greater than or equal to X

Given a number X, the task is to find the minimum number N such that the sum of the count of all factors from 1… Read More »

## Count of distinct power of prime factor of N

Given a positive integer N, the task is to find the total number of distinct power of prime factor of the given number N. Examples:… Read More »

## Number less than equals to N with maximum product of prime factors

Given a number N, the task is to find the number which is less than or equals to N whose product of prime factors is… Read More »

## Count all pairs of divisors of a number N whose sum is coprime with N

Given an integer N, the task is to count all pairs of divisors of N such that the sum of each pair is coprime with… Read More »

## Greatest odd factor of an even number

Given an even number N, the task is to find the greatest possible odd factor of N. Examples: Input: N = 8642 Output: 4321 Explanation:… Read More »

## Count numbers from range whose prime factors are only 2 and 3 using Arrays | Set 2

Given two positive integers L and R, the task is to count the elements from the range [L, R] whose prime factors are only 2… Read More »

## Check if a number exists having exactly N factors and K prime factors

Given two numbers N and K, the task is to find whether an integer X exists such that it has exactly N factors and K… Read More »

## Maximum number of prime factors a number can have with exactly x factors

Given an integer X, denoting the number of factors of a positive integer N can have. the task is to find the maximum number of… Read More »

## Count the nodes in the given tree whose weight is a powerful number

Given a tree, and the weights of all the nodes, the task is to count the number of nodes whose weight is a Powerful Number.… Read More »