I was hoping someone else would answer this question, because I don't know the best way to do it. But since no one has, here's one way that works.
Every person has a number called house number.
The house number of the player is 5.
Place is a room.
When play begins:
if 5 is a valid house number:
say "Yes."
To decide if (N - a number) is a valid house number:
Repeat with P running through people:
Let HN be the house number of P;
if N is HN:
decide yes;
decide no.
"Repeat running through" is in §11.11 in Writing with Inform, and there are some examples of "to decide if" phrases in §11.16.
Here's another way you could do it:
Every person has a number called house number.
The house number of the player is 5.
Place is a room.
HouseNumberList is a list of numbers that varies.
When play begins:
Repeat with P running through people:
Let HN be the house number of P;
add HN to HouseNumberList.
Every turn:
if 5 is listed in HouseNumberList:
say "Yes."
You can read more about testing and iterating over lists in §21.4.