Oh God Another Recap

A party is being held at a local mansion. The host is very rich and his success is because of one thing — his famous recipe for Spaghetti!

The only guests that may attend are people who correctly reply to the guard at the door.

Here's where you come in. You and a friend are trying to steal this recipe. You sneak by and listen to the passwords.

The first guest arrives. The security says "2", and the guest replies "3".

The second guest arrives. The security says "3", the guest replies "7".

The third guest arrives. The security says "5", the guest replies "2".

The fourth guest arrives. The security says "8", the guest replies "4".

Your friend thinks he's got it all figured out so he walks up to the door and the security says "4". He replied "4", and is immediately gored by the guard's security rhinoceros. Before passing out your friend says "Oh God, not again".

Another guest arrives, security says "6" and he says "3" to get in.

You walk up and get a "7" from security. What is your response?

For ease of answering however, I shall provide 2 hints. Start out at a score of 100 If you solve the riddle without looking at any hints, your score is 100 - (distance from answer * 10). If you look at the first hint only your score is 80 - (distance from answer * 10). If you look at the second hint only your score is 60 - (distance from answer * 10). If you look at both hints your score is 30 - (distance from answer * 10). Honor system applies. I will calculate your score accordingly.

As usual please post your answer, an explanation of what process you used to get the answer and any hints used in spoiler tags.


The math tag isn't used for decoration here. A mathematical function $(f(x))$ is involved, but only a small part of the result is used (because numbers get very big very fast when this function is used) after being modified by rounding the results of another function $(g(x)$ (because the results of this second function may be a decimal number). TL;DR small part of $(f(x) + g(x)) =$ answer

Hint 2:

There are 2 functions involved here are $f(x)$ and $g(x)$. $f(x)$ is a factorial, and $g(x)$ is a floor function.


1 Answer 1


The answer for 7 is


Following the formula

Password = mod(n!, 10) + floor(n / 2)

  • $\begingroup$ Did you use any hints? $\endgroup$
    – JamesENL
    Nov 12, 2014 at 10:16
  • $\begingroup$ Yes, both of them :$ $\endgroup$
    – Mohit Jain
    Nov 12, 2014 at 10:27
  • $\begingroup$ Score of 30 then. Well done! $\endgroup$
    – JamesENL
    Nov 12, 2014 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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