An alternate solution guaranteed to work in every case and bounded to a maximum of 14 steps (for each side):
both players can just encode the number they know in binary and say “I don’t know” for a zero and “I know” for a 1.
both players can just encode the number they know in binary and say “I don’t know” for a zero and “I know” for a 1.
Peter: "My number is [X]." Sandy: I know the answer!