This question might seem strange, but I had the feeling it's possible to decompose in a unique way a number as follows:
if $x < n!$, then there is a unique way to write x as: $$x = a_1\cdot 1! + a_2\cdot 2! + a_3\cdot3! + ... + a_{n-1}\cdot(n-1)!$$ where $a_i \leq i$
I looked at factorial decomposition on google but I cannot find any name for such a decomposition.
example:
If I chose :
(a1,a2) =
- 1,0 -> 1
- 0,1 -> 2
- 1,1 -> 3
- 0,2 -> 4
- 1,2 -> 5
I get all number from $1$ to $3!-1$
ideas for a proof:
The number of elements between $1$ and $N!-1$ is equal to $N!-1$ and I have the feeling they are all different, so this decomposition should be right. But I didn't prove it properly.
Are there proofs of this decomposition? Does this decomposition as a name? And above all is this true ?
Thanks in advance
You're looking for the factorial number system, also known as "factoradic". Searching should give you more results.
Yes, it's true that such a decomposition is always possible. One way to prove it is as follows: given $x < n!$, consider the $x$th permutation of some ordered set of $n$ symbols. This is some permutation $(s_1, s_2, \dots, s_n)$. Now for $s_1$ you had $n$ choices (label them $0$ to $n-1$) and you picked one, so let $a_{n-1}$ be the choice you made. For $s_2$ you had $n-1$ choices (label them $0$ to $n-2$) and you picked one, so let $a_{n-2}$ be the number of the choice you made. Etc. $a_0$ is always $0$ because you have only one choice for the last element. (This is also known as the Lehmer code.)