# Permutation Problem with a Variable

13P5 = 1287(xPx)

I simplify the above to: 13!/8! = 1287(x!)

The expression on the left simplifies to 154,440.

I divide both sides by 1287 to get: 120=x!

At this point I'm stumped.

-
If you simply calculate $n!$ for the first few positive integers $n$, you should find your $x$ pretty quickly. –  Brian M. Scott Jul 24 '11 at 1:55

I am not sure that there is really a better solution than to just calculate the first few factorials at this point and see which one gives you $120$... You should find your answer pretty fast.
It is not possible to invert the "factorial" function in general since it is not injective, i.e. $0!=1!=1$
There is another way to go about it, though: divide $120$ by $2$, then divide the quotient by $3$, then that quotient by $4$, and so on: either you reach a quotient of $1$ with divisor the desired $x$, or you reach a quotient less than $1$ without ever getting $1$, in which case there’s no solution. –  Brian M. Scott Jul 24 '11 at 1:59