n-smooth   numbers are positive integers which have no prime factors  >  n.

The   n   (when using it in the expression)   n-smooth   is always prime,

there are   no   9-smooth numbers.

1   (unity)   is always included in n-smooth numbers.




2-smooth   numbers are non-negative powers of two.

5-smooth   numbers are also called   Hamming numbers.

7-smooth   numbers are also called    humble   numbers.



A way to express   11-smooth   numbers is:

  11-smooth  =  2i × 3j × 5k × 7m × 11p

           where     i, j, k, m, p ≥ 0  



Task

   calculate and show the first   25   n-smooth numbers   for   n=2   ───►   n=29
   calculate and show   three numbers starting with   3,000   n-smooth numbers   for   n=3   ───►   n=29
   calculate and show twenty numbers starting with  30,000   n-smooth numbers   for   n=503   ───►   n=521   (optional)


All ranges   (for   n)   are to be inclusive, and only prime numbers are to be used.

The (optional) n-smooth numbers for the third range are:   503,   509,   and   521.

Show all n-smooth numbers for any particular   n   in a horizontal list.

Show all output here on this page.



Related tasks

   Hamming numbers
   humble numbers


References

   Wikipedia entry:   Hamming numbers     (this link is re-directed to   Regular number).
   Wikipedia entry:   Smooth number
   OEIS entry:   A000079    2-smooth numbers or non-negative powers of two
   OEIS entry:   A003586    3-smooth numbers
   OEIS entry:   A051037    5-smooth numbers or Hamming numbers
   OEIS entry:   A002473    7-smooth numbers or humble numbers
   OEIS entry:   A051038   11-smooth numbers
   OEIS entry:   A080197   13-smooth numbers
   OEIS entry:   A080681   17-smooth numbers
   OEIS entry:   A080682   19-smooth numbers
   OEIS entry:   A080683   23-smooth numbers


ClearAll[GenerateSmoothNumbers]
GenerateSmoothNumbers[max_?Positive] := GenerateSmoothNumbers[max, 7]
GenerateSmoothNumbers[max_?Positive, maxprime_?Positive] := 
 Module[{primes, len, vars, body, endspecs, its, data},
  primes = Prime[Range[PrimePi[maxprime]]];
  len = Length[primes];
  If[max < Min[primes],
   {}
   ,
   vars = Table[Unique[], len];
   body = Times @@ (primes^vars);
   endspecs = Prepend[Most[primes^vars], 1];
   endspecs = FoldList[Times, endspecs];
   its = Transpose[{vars, ConstantArray[0, len], MapThread[N@Log[#1, max/#2] &, {primes, endspecs}]}];
   With[{b = body, is = its},
    data = Table[b, Evaluate[Sequence @@ is]];
    ];
   data = Sort[Flatten[data]];
   data
   ]
  ]
Take[GenerateSmoothNumbers[10^8, 2], 25]
Take[GenerateSmoothNumbers[200, 3], 25]
Take[GenerateSmoothNumbers[200, 5], 25]
Take[GenerateSmoothNumbers[200, 7], 25]
Take[GenerateSmoothNumbers[200, 11], 25]
Take[GenerateSmoothNumbers[200, 13], 25]
Take[GenerateSmoothNumbers[200, 17], 25]
Take[GenerateSmoothNumbers[200, 19], 25]
Take[GenerateSmoothNumbers[200, 23], 25]
Take[GenerateSmoothNumbers[200, 29], 25]
Take[GenerateSmoothNumbers[10^40, 3], {3000, 3002}]
Take[GenerateSmoothNumbers[10^15, 5], {3000, 3002}]
Take[GenerateSmoothNumbers[10^10, 7], {3000, 3002}]
Take[GenerateSmoothNumbers[10^7, 11], {3000, 3002}]
Take[GenerateSmoothNumbers[10^7, 13], {3000, 3002}]
Take[GenerateSmoothNumbers[10^6, 17], {3000, 3002}]
Take[GenerateSmoothNumbers[10^5, 19], {3000, 3002}]
Take[GenerateSmoothNumbers[10^5, 23], {3000, 3002}]
Take[GenerateSmoothNumbers[10^5, 29], {3000, 3002}]
 
s = Select[Range[10^5], FactorInteger /* Last /* First /* LessEqualThan[503]];
s[[30000 ;; 30019]]
s = Select[Range[10^5], FactorInteger /* Last /* First /* LessEqualThan[509]];
s[[30000 ;; 30019]]
s = Select[Range[10^5], FactorInteger /* Last /* First /* LessEqualThan[521]];
s[[30000 ;; 30019]]