View the basis of factorial
Like any natural number n can be
n=d_1*1!+d_2*2!+d_3*3!+⋯+d_k*k!
Write where k, d_1, d_2 ,..., and d_k are none active integers and for every 1 ≤ i ≤ k, d_i ≤ i. This will display the factorial basis. Write a program that is a natural number n received from the input and display it in a factorial basis.
Input
You can input a number in the first place. And then the algorithm that you specified. Factorials with the result in the display.
Output
The output of the above formula is created.
n=d_1*1!+d_2*2!+d_3*3!+⋯+d_k*k!
Input output
N=10 10=0*1!+2*2!+1*3!
N=53 53=1*1!+2*2!+0*3!+2*4!
