Is there a way to reverse factorials? [duplicate]

You can just divide the "answer" by consecutive positive integers, and when the result is 1, the last number you divided by is the number that the "answer" is factorial of. For example: 120 / 2 = 60, 60 / 3 = 20, 20 / 4 = 5, 5 / 5 = 1, so the number that 120 is the factorial of is 5.