Function Repository Resource:

# GenerateSmoothNumbers

Generate smooth numbers up to some maximum

Contributed by: Sander Huisman
 ResourceFunction["GenerateSmoothNumbers"][max] generates all positive integers up to max whose prime factors are equal to or less than 7. ResourceFunction["GenerateSmoothNumbers"][max,p] generates all positive integers up to max whose prime factors are equal to or less than p.

## Details

ResourceFunction["GenerateSmoothNumbers"][max,p] generates p-smooth numbers.
ResourceFunction["GenerateSmoothNumbers"][max] generates the so-called humble numbers.

## Examples

### Basic Examples (2)

Generate the numbers up to 100 that have factors that are 13 or less:

 In[1]:=
 Out[1]=

Generate the numbers up to 100 that have factors that are 7 or less—so-called humble numbers:

 In[2]:=
 Out[2]=

### Scope (2)

The second argument does not have to be an integer:

 In[3]:=
 Out[3]=

Check that the prime factors are all below 6.5:

 In[4]:=
 Out[4]=

### Properties and Relations (2)

Smooth numbers can be found by sieving:

 In[5]:=
 Out[5]=

The algorithm used by GenerateSmoothNumbers is much faster though:

 In[6]:=
 Out[6]=

### Neat Examples (1)

The argument of GenerateSmoothNumbers can be really large—much larger than practical for a method based on sieving:

 In[7]:=
 Out[7]=

SHuisman

## Version History

• 1.0.0 – 21 June 2021