All possible factorisations of a number

68 Views Asked by At

Is there a method for finding all possible n-factor factorisations of a number? For example, if all possible 2-factor factorisations of 90 (up to order) are:

1 × 90
2 × 45
3 × 30
5 × 18
6 × 15
9 × 10

How do I discover all the remaining 3-factor, 4-factor, etc, factorisations (until I am left with purely prime factorisations)? Do I simply need to grind through them mechanically, or is there a more elegant method for finding them? (I need the actual factorisations, not simply the total number of those factorisations).

1

There are 1 best solutions below

0
On

$1$ is not an interesting factor, so you can remove the first entry in your list, to leave:

2 × 45
3 × 30
5 × 18
6 × 15
9 × 10

The first entry gives you the smallest prime factor, $2$. Now go through the rest of the list, dividing one number from each entry by $2$, to get:

3 × 15
5 × 9
3 × 15
9 × 5

The smallest number here is $3$. So remove the first and third entries, and go through the rest of the list, dividing one number from each entry by $3$, to get:

5 × 3
3 × 5

The smallest number is again $3$ so remove that to leave yourself with $5$.

So the prime factorisation of $90$ is $2\times 3^2\times 5$. And the exponents of the primes are $1,2,1$, so there are $2\times 3\times 2=12$ factorisations in total.