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.
You notice a chalkboard next to the guard which you haven't seen before. It looks like this:
Week XI
---------
This week's passwords were changed 2 days ago since
John the Guard was taken ill, and Carlo the Guard
hasn't had time to learn that system yet.
If you didn't receive the message, please check your
mobile phone for the new rules.
ZERO (0) will never be a correct answer, and none of
the numbers ONE (1), TWO (2) or THREE (3) will be asked
because it's far too insecure, anyone could just repeat
the same number and we don't want that.
You quickly check your mobile phone, just in case they made a horrendous mistake, but you have no messages at all - they're not quite that daft. Any attempts to steal a mobile phone would undoubtedly be noticed by the guards, so you decide it's far too risky to try to game the system, and instead hang around to overhear some challenges and responses.
The first guest arrives. The security says "4", and the guest replies "3".
The second guest arrives. The security says "25", the guest replies "6".
The third guest arrives. The security says "16", the guest replies "5".
Your friend thinks he's got it all figured out - it's just $\sqrt{n}+1$, so he walks up to the door and the security says "49". He replies "8", and is trampled to death by an irrelevant elephant.
Another guest arrives, security says "18" and the guest replies "7" to get in.
You walk up and get a "36" from security. What is your response?
For peace of mind (since someone decided to have a go at me for not stating this upfront on a previous puzzle): Every response is independent of every other challenge/response pair, and there is no hidden information (such as time of day).
This is the latest installment in the series:
The Security to the Party
The Security to the Party [Part 2]
The Security to the Party [Part 3]
The Security to the Party [Part 4]
The Security to the Party [Part 5]
The Security to the Party [Part 6]
The Security to the Party [Part 7]
The Security to the Party [Part 8]
The Security to the Party [Part 9]
The Security to the Party [X]