# Tag Archives: prime-factor

## Prime factors of a big numberNovember 19, 2017

Given a number N, print all the prime factors and their powers. Here N

## Number of steps to convert to prime factorsNovember 5, 2017

Given an array arr[] of n positive integers. Represent every number as its factors (x * y = arr[i]) [Here x or y cannot be… Read More »

## Largest power of k in n! (factorial) where k may not be primeOctober 27, 2017

Given two numbers k and n, find the largest power of k that divides n! Constraints: K > 1 Examples: Input : n = 7,… Read More »

## Queries to find whether a number has exactly four distinct factors or notOctober 25, 2017

Given a positive integers ‘q’ and ‘n’. For each query ‘q’ find whether a number ‘n’ have exactly four distinct divisors or not. If the… Read More »

## Lucas Primality TestOctober 22, 2017

A number p greater than one is prime if and only if the only divisors of p are 1 and p. First few prime numbers… Read More »

## Check if a number is divisible by all prime divisors of another numberOctober 18, 2017

Given two integers. We need to find if the first number x is divisible by all prime divisors of y. Examples: Input : x =… Read More »

## Ways to express a number as product of two different factorsOctober 16, 2017

Given a number n, write a program to calculate number of ways in which number can be expressed as product of two different factors. Examples:… Read More »

## Check whether a number has exactly three distinct factors or notOctober 9, 2017

Given a positive integer n(1 <= n <= 1018). Check whether a number has exactly three distinct factors or not. Print “Yes” if it has… Read More »

## Product of factors of numberOctober 2, 2017

Given a number n, find the product of all factors of n. Since the product can be very large answer it modulo 10^9 + 7.… Read More »

## Count divisors of array multiplicationSeptember 30, 2017

Given an array with N elements, task is to find the count of factors of a number X which is product of all array elements.… Read More »

## Total number of divisors for a given numberSeptember 10, 2017

Given a positive integer n, we have to find the total number of divisors for n. Examples: Input : n = 25 Output : 3… Read More »

## Maximum number of unique prime factorsSeptember 9, 2017

Given a number N, find the maximum number of unique prime factors any number can have in range [1, N]. Examples: Input : N =… Read More »

## Find minimum sum of factors of numberAugust 8, 2017

Given a number, find minimum sum of its factors. Examples: Input : 12 Output : 7 Explanation: Following are different ways to factorize 12 and… Read More »

## Factor Tree of a given NumberJuly 17, 2017

Factor Tree is an intuitive method to understand factors of a number. It shows how all the factors are been derived from the number. It… Read More »

## Sum of all proper divisors of natural numbers in an arrayJuly 11, 2017

Given an array of natural numbers count the sum of its proper divisors for every element in array. Input : int arr[] = {8, 13,… Read More »