TITLE: Given a finite list of prime factors, what is the fastest way to find all numbers that can be formed from them
QUESTION [5 upvotes]: $$ \text{Let} \ S = \{p_1,p_2,p_3,...,p_n\} $$
$$ \text{where} \ p_i \in \Bbb P$$
What is the fastest known method method/algorithm to generate all unique numbers through product operation on $S$?
$\text{Ex}: S= \{3,5,2\} $
Soln:
$3\times5 = 15$
$3\times2 = 6$
$3\times5\times2 = 30$
$5\times2 = 10$  
Currently, my ideas hover around generating all subsets of $S$, multiplying all the members in each of them and eliminating the duplicates from the list of numbers so generated. This is $O(2^n)$.

REPLY [2 votes]: Given your example solution I saw a very nice solution (the answer by @Arturo Magidin) that may be relevant to you.