Unrank - Maple Help

 Unrank
 compute the ordinary mixed radix tuple of a given rank

 Calling Sequence Unrank(rnk,m)

Parameters

 rnk - posint; rank m - {list,rtable}; radices

Description

 • Unrank computes the ordinary mixed-radix tuple of a given rank.
 • The rnk parameter is the desired rank.
 • The m parameter is the radices. It is a list or one-dimensional rtable of positive integers.

Examples

 > $\mathrm{with}\left(\mathrm{Iterator}:-\mathrm{MixedRadix}\right):$

Compute mixed radix tuples of a given rank.

 > $\mathrm{radices}≔\left[3,1,4,1\right]:$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{rnk}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}12\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{printf}\left("%2d : %d\n",\mathrm{rnk},\mathrm{Unrank}\left(\mathrm{rnk},\mathrm{radices}\right)\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$
 1 : 0 0 0 0  2 : 1 0 0 0  3 : 2 0 0 0  4 : 0 0 1 0  5 : 1 0 1 0  6 : 2 0 1 0  7 : 0 0 2 0  8 : 1 0 2 0  9 : 2 0 2 0 10 : 0 0 3 0 11 : 1 0 3 0 12 : 2 0 3 0

Compatibility

 • The Iterator[MixedRadix][Unrank] command was introduced in Maple 2016.