I want to represent a number as the product of its factors.The number of factors that are used to represent the number should be from 2 to number of prime factors of the same number(this i s the maximum possible number of factors for a number).
for example taking the number 24:
representation of the number as two factors multiplication are 2*12, 8*3, 6*4 and so on...,
representation of the number as three factors multiplication are 2*2*6, 2*3*4 and so on...,
representation of the number as four factors multiplication(prime factors alone) are 2*2*2*3.
please help me get some simple and generic algorithm for this