$\begingroup$@SQB This is the fifth spaghetti cook.$\endgroup$
– user3804649Nov 11 '14 at 7:43

1

$\begingroup$Since this is apparently quite a busy party, fake an emergency phone call and walk away quickly without giving an answer, change your appearance, come back, and make sure not to get involved with the guard again until you know all the questions and correct answers. :)$\endgroup$
– hvdNov 11 '14 at 11:01

5 Answers
5

I think the answer is the number of corners in the digital display representation of it, with a T shape counting twice, i.e. towards both sides.

Example for explanation:

For "3" we count: 1: the upper right corner connects the top bar and the top right bar. 2: the top right and middle bar. 3: middle and lower right bar. (2+3 make said T shape). 4: lower right and bottom bar.

Edit: A more mathematical way to express this is:

answer = number of unique pairs (h,v) where h is a horizontal bar, v an adjacent vertical bar and both are lit when displaying the number given by the guard.

It looks arbitrary when first glanced at, yet there's something to it. The significance of the 4 is obvious, as it's the only clue we have as to what doesn't work. The amount of fours repeating is also pretty nauseating, so I've decided to try something interesting.

Pattern?

Deciding to preformulate each of those left-hand input numbers into an expression of the form xn where n is a prime and x the coefficient gives us this series:

This has the drawback of giving a variable representation to some numbers; 6 can be both 2 * 3 and 3 * 2, for example, so I've decided to put the smaller number to the left. Since we have the series, we can see that we can disregard the prime and still have rising coefficients in some sort of logical order:

Third series
/------------\
1 => 4
1 => 4
2 !! 4
1 => 4
2 => 6
1 => ?
4 => 8
\------------/
[Note]: This series has
little to do with the first
and as such they aren't
equivalent.

This kind of series lends itself better to the eyes, and so we can cut out some duplicate entries, giving series #10923853Sqrt[-1]:

/----------\
1 => 4
2 !! 4
1 => ?
2 => 6
4 => 8
\----------/

From this we can expect x=8 => 10, probably following the pattern of x=n^a => 4+2*a. As such, we can reasonably expect that seven will imply four as the answer, as (n^0)*7 => 4+2*0 = 4. A few further bits of this series would be:

That the number of crossbars is a multiplier for the number of vertical bars.
0 bars = x0
1 bar = x1
3 bars = x2
Why 3 bars is a x2 multiplier is unknown to me. Could it be because of the number of "on" bits to make up the number in binary?