This site is supported by donations to The OEIS Foundation.

Template:Rank

From OeisWiki
Jump to: navigation, search

The {{rank}} mathematical function template gives a 1-indexed list of the numerical rankings (from lowest to highest) of the template arguments. When there are duplicates, each set of duplicates are given the same ranking, and the ranking corresponds to the highest ranking one would get if the rankings were consecutive integers.

Usage

{{rank|num_expr_1}}

up to

{{rank|num_expr_1|...|num_expr_16}}

where

  • num_expr_1 to num_expr_16 are numerical expressions yielding real numbers.

Examples

{{rank}} yields ()
{{rank|14}} yields (1)
{{rank|14|4}} yields (2, 1)
{{rank|14|4|7}} yields (3, 1, 2)
{{rank|14|4|7|1}} yields (4, 2, 3, 1)
{{rank|14|4|7|1|-8}} yields (5, 3, 4, 2, 1)
{{rank|14|4|7|1|-8|16}} yields (5, 3, 4, 2, 1, 6)
{{rank|14|4|7|1|-8|16|0}} yields (6, 4, 5, 3, 1, 7, 2)
{{rank|14|4|7|1|-8|16|0|-25}} yields (7, 5, 6, 4, 2, 8, 3, 1)
{{rank|14|4|7|1|-8|16|0|-25|3}} yields (8, 6, 7, 4, 2, 9, 3, 1, 5)


{{rank|14|4|7|1|-8|16|0|-25}} yields (7, 5, 6, 4, 2, 8, 3, 1)
{{rank|2*7|2^2|7|1|(-2)^3|2^4|0|-(5^2)}} yields (7, 5, 6, 4, 2, 8, 3, 1)


{{rank|14|4|7|1|-8|16|0|-25|143|17|69|34|55|-47|15|-52}} yields (9, 7, 8, 6, 4, 11, 5, 3, 16, 12, 15, 13, 14, 2, 10, 1)
{{rank|2*7|2^2|7|1|(-2)^3|2^4|0|-(5^2)|11*13|34/2|3*23|2*17|5*11|(-1)*47|3*5|-(2^2 * 13)}} yields (9, 7, 8, 6, 4, 11, 5, 3, 16, 12, 15, 13, 14, 2, 10, 1)


{{rank|14|4|7|1|-8|16|0|-25|143|17|69|34|55|-47|15|-52|-777}} yields (9, 7, 8, 6, 4, 11, 5, 3, 16, 12, 15, 13, 14, 2, 10, 1) Rank error: only the first 16 arguments are considered!


{{rank|14.1|4.8|7.0|1.4|-8|16.7}} yields (5, 3, 4, 2, 1, 6)

Examples with duplicates

{{rank|-8|14|0|-25|14|4|0|1}} yields (2, 8, 4, 1, 8, 6, 4, 5)
{{rank|-8.2|14.1|0|-25.4|14.1|4|0|1}} yields (2, 8, 4, 1, 8, 6, 4, 5)


{{rank|-8|14|0|-25|14|4|0|1|-25}} yields (3, 9, 5, 2, 9, 7, 5, 6, 2)
{{rank|-8.2|14.1|0|-25.4|14.1|4|0|1|-25.4}} yields (3, 9, 5, 2, 9, 7, 5, 6, 2)