prime factors of a number

Solutions on MaxInterview for prime factors of a number by the best coders in the world

showing results for - "prime factors of a number"
Nicola
11 Apr 2020
1
2function primeFactors(n){
3  var factors = [], 
4      divisor = 2;
5  
6  while(n>2){
7    if(n % divisor == 0){
8       factors.push(divisor); 
9       n= n/ divisor;
10    }
11    else{
12      divisor++;
13    }     
14  }
15  return factors;
16}
17
18> primeFactors(69);
19  = [3, 23]
20        
Nicola
22 Jun 2018
1def primeFactors(n):
2  global factors
3  if(n==1):
4    return
5  elif((n%factors)== 0):
6    print(factors)
7    primeFactors(n//factors)
8  else:
9    factors+=1
10    primeFactors(n)
11factors = 2
Constanza
27 Mar 2016
1public List<Integer> factorsOf(int n) {
2  ArrayList<Integer> factors = new ArrayList<>();
3
4  for (int d = 2; n > 1; d++)
5    for (; n % d == 0; n /= d)
6      factors.add(d);
7
8  return factors;
9}
10
Maëlle
02 Aug 2017
1>>> for n in range(2, 10):
2...     for x in range(2, n):
3...         if n % x == 0:
4...             print(n, 'equals', x, '*', n//x)
5...             break
6...     else:
7...         # loop fell through without finding a factor
8...         print(n, 'is a prime number')
9...
102 is a prime number
113 is a prime number
124 equals 2 * 2
135 is a prime number
146 equals 2 * 3
157 is a prime number
168 equals 2 * 4
179 equals 3 * 3
18
queries leading to this page
which factors are not included in the prime factorization of a composite numberhow to count prime number of factorstotal prime factors inprime factors of 531441prime factors of any numberreturn the sum of the prime factors of a numberto find prime factors of a numberhow many prime factors are thereprint all prime factors of a given numberprime factors of a number functionwrite a function to obtain prime factors of given numberfast way of calculating prime factors of a numberprime numbers and factorsprime factors of number onlinehow many factors a prime number haswrite a program to print the prime factors of the given number find all prime factors onlineprime factors prpgramhow to calculate prime factorsnumbers having prime factorsprime factors of noget all prime factors of a numberdoes every number has prime factorsget prime factors of a numberprogram to find total no of primes factors ina numberfind the number of prime factors of 286 2910 c3 97 287 2917 c3 97 2855 2927 write a program to find prime factors of an integer 3fhow to get the nubmer of prime factors of a number in consttant timehow to find the sum of prime factors of a numberhow todfind prime factors of a numberprime factors exampleshow to find all the prime factors of a numberhow to identify prime factorsthe number of factors of prime numbers are trick to find prime factors of a numberwhich number has most prime factorsprime factors of a given numberhow to find two prime factors of a number which when added gives the numberget prime factors of nfind prime factorsfactors and prime factorscount of prime factors of a numberhow to find prime factors of a nowhat is prime factorsfind prime factors of numberwhat are the prime factors of 2number to prime factorshow to find prime factors of large numbershow to calculate prime factors of a numbersolve 3 the prime factors of 13195 are 5 2c 7 2c 13 and 29 what is the largest prime factor of the number 600851475143 3f in c 2b 2bequation to identify how many prime factorshow to get prime factorsfind the prime factors of a numberfind prime factors of a number onlineprogram to calculate prime factors of a numberfinding prime factors of numberprime numbers have how many factorsdisplay prime factors of a numberhow to find all prime factors of a numberprime factors of a numberprogram to find prime factorsalgorithm for prime factors of a numbercount all prime factors of a numberfind prime factors of a numberprime factors of a unumberfactors of prime numbersalgorithm to get all prime factorsprime factors of number 198print all the prime factors of anumberthe total number of factors of prime number isthe total number of prime factors isprinting all prime factors of a numbercount prime factors of a numbernumber of prime factors of 93489348write a program to find all prime factors of a number how to find all factors of a number using prime factorization program to find all prime factors of a numberwhat is meant by prime factors of a numberwhat are prime factorshow to find prime factors of a number easilyproduct of all prime factors of a numberget prime factors of a number run timefind prime factors of given numberscalculate prime factors of a numberprime factors of numbers7 find all prime factors of a number 3fprime factors of factorialscount number of prime factorsprime number and factorsfastest way to find prime factors of a numberprime factors of a number in prime factorization method can be found howfinding all prime factors of a number using sievefunction for finding and printing all prime factors of a numberget prime factorsany composite number has prime factorshow could you find all prime factors of a number 3fhow to find prime factors of a large numberprime factors problemstrick to find the number of prime factors of a numberexamples of prime factorshow to find the prime factors of a numberprime number of factorsfinding powers of prime factors of a numbernumber of prime factorsprime factors of 3486784404generating all prime factors of a number what prime factors prime factors definitionprime factors of a nmberprint prime factors of a numberprime factors meaningfind all prime factors of 8873800how to form the prime factors of a numberprime factors counting functionhow to calculate the number of prime factors of a numberoptimzed way to find prime factors of a numberlogic to find prime factors of a numbernow of prime factors of a numbersum of prime factors of a numberprime factors program explanationprints all the prime factors of the number nthe number of prime factors in calculate number of prime factors programfind prime factors of number onlinehow to find prime factorsget number of prime factors of a number gfgfind sum of prime factors of a numberno of prime factorsfactors of find number of factors in prime factorizationhow to get prime factors of a numberho to find all prime factors of a number efficiently 3fprogram to get prime factors of a numberno of prime factors of a numberare all numbers prime factorsget all prime factors of a prime numberall prime factors of a numberhow to calculate prime factors of a number gfgprime factors of the given numberprogram to find number of prime factorsprime factorsdefine a function to print the prime factors of a number number of prime factors of a numbertotal number of prime factors formulahow to find total prime factors of a numberfind all the prime factors of a numberprime factors and prime numbers relationshipfinding the prime factors of a numberreturn the list of prime factors of given numberprime factors maththe total number of factors of a prime number isfind all prime factors of a numberhow to get the prime factors of a numberequation to find prime factorswhich factors are not included in the prime number factorization of a composite number 3fprogram to find prime factors of a numberhow to get all prime factors of a numberfind prime factors of 48 program to calculate number of prime factorsprogram to print all prime factors of a given numberprime factors finding algorithmnumber of factors using prime factorizationgenerate prime factors of a given integerfinding all the factors of a numbersum of all prime factors of a numberco factors of a prime numberformula to count number of prime factors of a numbercalculate all prime factors of a numbersum of prime factorstotal no of prime factorsall prime factors of a numbers how to know the number of a prime factors of a numbertips to find prime factorsgiven an integer n 2c print all the prime factors of n calculate number of prime factorscalculate the prime factors of a number and display them determine prime factorsfind number of prime factorshow to find number of prime factorshow to work out prime factorsthe number of factors of a prime number are 3f 28choose 1 29prime factors codeprime number of factors of a given numberhow to find factors of a numberfind the prime factors 1197program to calculate number of prime factors of a numberprime factors programno of prime factors of numbersprime factors functionnumber of all prime factors of a numberprime factors meansfind all prime factors of a number onlineread a number and display its prime factorsprime factors of a number calculatormaximum number of prime factors of a numberprime factors gfgwhat are prime factors of a numberthe factors of a prime number are the number itself andwhat are the prime factors of 100how to find prime factors of a numbernumber of most prime factorsfinding prime factorsefficient program to print all prime factors of a given numberfind prime factors in factorialalgorithm to find prime factors of a numberhow to find amount of factors by prime factorisatonprime factors of numbersolve 3 the prime factors of 13195 are 5 2c 7 2c 13 and 29 what is the largest prime factor of the number 600851475143 3fhow many factors does a prime number have 3fhow many prime factors can a number havefinding prime factors of a numberfind prime factors of a number gfgcode to find prime factors of a numberhow to store prime factors of a numberprime factors algorithmalgorithm for finding prime factors of a numbertotal of prime factors of numberto find the sum of prime factorsget greated prime factors of a numberalgorithm to find factors of a numberprime factors of a number