On this page
Counting the number of ways to write a number like 30 as a product of three numbers is a combinatorics problem that tests your understanding of prime factorisation and permutations.
The starting point is the prime factorisation. For 30, it is the product of three distinct primes: 30 = 2 × 3 × 5.
Depending on whether you treat different arrangements of the same factors as distinct, the number of ways changes. Here is how to count both cases.
How do you find the ordered factorisations of 30?
When the order of factors matters, writing 30 as x × y × z means 1 × 2 × 15 is a different solution from 15 × 2 × 1.
Since 30 = 2 × 3 × 5, we distribute the three distinct primes among the three variables (x, y, and z).
The prime factor 2 can go to x, y, or z (3 choices).
The prime factor 3 can go to x, y, or z (3 choices).
The prime factor 5 can go to x, y, or z (3 choices).
Since these choices are independent, we multiply them: 3 × 3 × 3 = 27. There are exactly 27 ordered ways to write 30 as a product of three positive integers. Any variable that does not receive a prime factor takes the value of 1. If all primes are assigned to x, then x = 30, while y = 1 and z = 1 (the solution 30 × 1 × 1).
How many ways to write 30 as a product if order does not matter?
If you want unordered factorisations (multiplicative partitions), the set of factors {1, 2, 15} is counted only once.
To find these, partition the primes 2, 3, and 5 into at most three groups. Empty groups become 1:
All three primes in one factor: {1, 1, 30}
Two primes in one factor, one in another:
3 and 5 grouped together: {1, 2, 15}
2 and 5 grouped together: {1, 3, 10}
2 and 3 grouped together: {1, 5, 6}
Each prime in its own factor: {2, 3, 5}
This gives exactly 5 unique unordered ways. In mathematics, the number of multiplicative partitions for a square-free number with k prime factors is the k-th Bell number (Wikipedia). For three distinct primes, the third Bell number is 5.
How do unordered combinations become ordered permutations?
We can verify that our 5 unordered combinations perfectly match the 27 ordered ways by applying permutations. The number of ways to arrange three items depends on identical items.
{1, 1, 30} contains two identical 1s. Permutations: 3! / 2! = 3.
{1, 2, 15}, {1, 3, 10}, and {1, 5, 6} contain distinct numbers. Permutations: 3! = 6 ways each (total 18).
{2, 3, 5} contains three distinct numbers. Permutations: 3! = 6.
Adding these gives 3 + 18 + 6 = 27. This proves our systematic listing missed nothing, using the same logic as the bundle method for arrangements, where you group items together before ordering them.
How do you use the stars and bars formula for larger numbers?
Multiplying choices works for numbers with single prime factors like 30, but it fails with repeated primes like 360 = 2³ × 3² × 5.
For these cases, we use the stars and bars method to distribute identical exponents (stars) into distinct bins representing the factors x, y, and z (Wikipedia)). The formula to distribute an exponent a into k distinct factors is C(a + k - 1, k - 1).
Applying this to find the ordered factorisations of 360 into three factors:
Distribute the exponent 3 for 2: C(3 + 3 - 1, 3 - 1) = C(5, 2) = 10.
Distribute the exponent 2 for 3: C(2 + 3 - 1, 3 - 1) = C(4, 2) = 6.
Distribute the exponent 1 for 5: C(1 + 3 - 1, 3 - 1) = C(3, 2) = 3.
Multiplying these gives 10 × 6 × 3 = 180 ordered ways to write 360 as a product of three factors.
What happens if the factors must be greater than 1?
When a question specifically asks for a product of integers greater than 1, most combinations disappear. From our unordered list for 30, only {2, 3, 5} fits. The ordered count drops drastically from 27 to just the 6 permutations of 2 × 3 × 5.
To see how combinations change with different conditions, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. Whether you are assigning items to groups or solving selection problems with combinations, breaking the rules into distinct cases ensures you count every valid group exactly once.



