Function Repository Resource:

# TupleFromIndex

Return the tuple corresponding to a given index

Contributed by: Ed Pegg Jr
 ResourceFunction["TupleFromIndex"][index,k] returns index from the list of integer k-tuples sorted by maximal element.

## Details and Options

A tuple with largest element n will be ordered after tuples that have all elements less than n.
In case of ties, tuples with largest element n have Sort ordering.

## Examples

### Basic Examples (5)

Create 2-tuples from their index:

 In[1]:=
 Out[1]=

The first nine 2-tuples sorted by maximal element:

 In[2]:=
 Out[2]=

Create 3-tuples from their index:

 In[3]:=
 Out[3]=

The function can return tuples of a given index for various lengths:

 In[4]:=
 Out[4]=

Find the trillionth k-tuple for several values of k:

 In[5]:=
 Out[5]=

### Properties and Relations (2)

Use Tuples to produce 3-tuples sorted by maximal element:

 In[6]:=
 Out[6]=

TupleFromIndex returns the same tuples in the same sequence:

 In[7]:=
 Out[7]=

### Neat Examples (2)

The googolth 6-tuple:

 In[8]:=
 Out[8]=

The googolth 111-tuple:

 In[9]:=
 Out[9]=

## Version History

• 2.0.0 – 20 December 2019
• 1.0.0 – 02 December 2019