# The Security to the Party [Part 7]

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 "8", and the guest replies "4".

The second guest arrives. The security says "2", the guest replies "1".

The third guest arrives. The security says "6", the guest replies "3".

Your friend thinks he's got it all figured out (again), so he walks up to the door and the security says "16". He replies "8", and is laughed out of town.

Another guest arrives, security says "10" and the guest replies "4" to get in.

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

It is the number of prime numbers up to and including the number the guard says. Therefore you should answer with 6.

• then 2 -> 1 is incorrect... 2->1 is 2 Feb 9, 2015 at 23:29
• @BrianRobbins, 1 is neither prime nor composite. Feb 10, 2015 at 6:25