I have a number, x, and I wish to find all unique ways to write a*b*c. By unique I mean 2*3*5 is the same as 3*2*5 or 5*3*2.
I've got a working algorithm that takes the prime factorization of x and then divvies up factors into three bins but it's quite slow and brute and I have to remove duplicates later, so I am curious if there is a faster way to generate unique combinations here directly.
Consider the number 720.
[3, 5, 48]
[5, 9, 16]
[3, 15, 16]
[3, 3, 80]
[2, 5, 72]
[5, 6, 24]
[5, 8, 18]
[2, 15, 24]
[2, 3, 120]
[3, 10, 24]
[6, 8, 15]
[3, 8, 30]
[3, 6, 40]
[2, 8, 45]
[2, 9, 40]
[8, 9, 10]
[4, 5, 36]
[5, 12, 12]
[4, 12, 15]
[3, 4, 60]
[3, 12, 20]
[4, 4, 45]
[4, 9, 20]
[2, 2, 180]
[2, 10, 36]
[2, 12, 30]
[2, 6, 60]
[6, 10, 12]
[2, 4, 90]
[2, 18, 20]
[4, 10, 18]
[4, 6, 30]
[6, 6, 20]