title: Generating integers in ascending order using a set of prime numbers
body: <p>I have a set of prime numbers and I have to generate integers using only those prime factors in increasing order.</p>
  
  <p>For example, if the set is <em>p</em> = {2, 5} then my integers should be 1, 2, 4, 5, 8, 10, 16, 20, 25, …</p>
  
  <p>Is there any efficient algorithm to solve this problem?</p>