Wolfram Research

Function Repository Resource:

Composite

Source Notebook

Get the nth composite number

Contributed by: Kyle Martin

ResourceFunction["Composite"][n]

gives the nth composite number.

Details and Options

ResourceFunction["Composite"][1] is 4.
Composite automatically threads over lists.
A composite number is a integer greater than one and not prime.

Examples

Basic Examples

The first 20 composites:

In[1]:=
Table[ResourceFunction["Composite"][n], {n, 20}]
Out[1]=

The billionth composite:

In[2]:=
ResourceFunction["Composite"][10^9]
Out[2]=

Plot the sequence:

In[3]:=
DiscretePlot[ResourceFunction["Composite"][n], {n, 100}]
Out[3]=

Resource History

Source Metadata

License Information