Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Thanks in advance, n

share|cite|improve this question
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
up vote 2 down vote accepted

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$

share|cite|improve this answer
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
right, very good point. – Vhailor Jul 24 '11 at 2:14
Ah, I thought there might be a non-brute force method for solving for x. Thanks! – Nick Jul 24 '11 at 2:56
If you did know that you had an exact factorial, and it was much larger than this, Stirling's approximation might come in handy. – Mark Bennet Jul 24 '11 at 8:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.