# Factorial number system

In combinatorics, the factorial number system, also called factoradic, is a mixed radix numeral system adapted to numbering permutations. It is also called factorial base, although factorials do not function as base, but as place value of digits. By converting a number less than n! to factorial representation, one obtains a sequence of n digits that can be converted to a permutation of n in a straightforward way, either using them as Lehmer code or as inversion table[1] representation; in theformer case the resulting map from integers to permutations of n lists them in lexicographical order. General mixed radix systems were studied by Georg Cantor.[2]The term "factorial number system" is used by Knuth,[3]while the French equivalent "numération factorielle" was first used in 1888.[4] The term "factoradic", which is a portmanteau of factorial and mixed radix, appears to be of more recent date.[5]

## Definition

The factorial number system is a mixed radix numeral system: the i-th digit from the right has base i, which means that the digit must be strictly less than i, and that (taking into account the bases of the less significant digits) its value to be multiplied by (i − 1)! (its place value).

 Radix Place value Place value in decimal Highest digit allowed 8 7 6 5 4 3 2 1 7! 6! 5! 4! 3! 2! 1! 0! 5040 720 120 24 6 2 1 1 7 6 5 4 3 2 1 0

From this it follows that the rightmost digit is always 0, the second can be 0 or 1, the third 0, 1 or 2, and so on (sequence A124252 in the OEIS). The factorial number system is sometimes defined with the 0! place omitted because it is always zero (sequence A007623 in the OEIS).

In this article, a factorial number representation will be flagged by a subscript "!", so for instance 341010! stands for 354413021100, whose value is

= 3×5! + 4×4! + 1×3! + 0×2! + 1×1! + 0×0!
= ((((3×5 + 4)×4 + 1)×3 + 0)×2 + 1)×1 + 0
=  46310.

(Note that the place value is one less than the radix position, which is why these equations begin with 5!.)

General properties of mixed radix number systems also apply to the factorial number system. For instance, one can convert a number into factorial representation producing digits from right to left, by repeatedly dividing the number by the radix (1, 2, 3, ...), taking the remainder as digits, and continuing with the integer quotient, until this quotient becomes 0.

For example, 46310 can be transformed into a factorial representation by these successive divisions:

 463 ÷ 1 = 463, remainder 0 463 ÷ 2 = 231, remainder 1 231 ÷ 3 = 77, remainder 0 77 ÷ 4 = 19, remainder 1 19 ÷ 5 = 3, remainder 4 3 ÷ 6 = 0, remainder 3

The process terminates when the quotient reaches zero. Reading the remainders backward gives 341010!.

In principle, this system may be extended to represent fractional numbers, though rather than the natural extension of place values (−1)!, (−2)!, etc., which are undefined, the symmetric choice of radix values n = 0, 1, 2, 3, 4, etc. after the point may be used instead. Again, the 0 and 1 places may be omitted as these are always zero. The corresponding place values are therefore 1/1, 1/1, 1/2, 1/6, 1/24, ..., 1/n!, etc.

Other Languages