Function Repository Resource:

# RandomComposite (1.0.0)current version: 1.0.1 »

Find a random composite number or set of random composite numbers

Contributed by: Peter Cullen Burbery
 ResourceFunction["RandomComposite"][n] returns a random composite number up to n. ResourceFunction["RandomComposite"][n,m] returns m random composite numbers up to n. ResourceFunction["RandomComposite"][{min,max}] returns a random composite number between min and max. ResourceFunction["RandomComposite"][n, arrayspec] returns an array of random composite numbers up to n.

## Details

RandomComposite can return duplicates.

## Examples

### Basic Examples (2)

Find a random composite number less than or equal to the a ceiling of the exponential of an integer:

 In[1]:=
 Out[1]=

Find a random composite number between 149 and 404:

 In[2]:=
 Out[2]=

### Scope (5)

Find a list of 30 random composite numbers between 1097 and 2981:

 In[3]:=
 Out[3]=

Find a 3⨯3 matrix of random composite numbers between 8104 and 22027 and print it in matrix form:

 In[4]:=
 Out[4]=

Find a 3⨯3⨯3 array of random composite numbers between 59875 and 162755 and print it in matrix form:

 In[5]:=
 Out[5]=

Find a 3⨯3⨯3⨯3 tensor of random composite numbers between 442414 and 1202605:

 In[6]:=
 Out[6]=

Find a large random composite up to a googol:

 In[7]:=
 Out[7]=

Peter Burbery

## Version History

• 1.0.1 – 28 July 2023
• 1.0.0 – 06 June 2023