May 2018 Fiendish Function

The Fiendish Function posed during May 2018 had the following sample guesses and replies:

  • GUESS
  • REPLY
  • 1
  • 1
  • 2
  • 6
  • 3
  • 7
  • 4
  • 52
  • 5
  • 53
  • 10
  • 510

The rule was: "Write the number in binary, add the original number, then divide it by two (ignoring the remainder)".

Suppose the guess was 22:

  • Write the number in binary, giving 10110.
  • Add the original number, giving 10132.
  • Divide it by two (ignoring the remainder), giving 5066.

So the result is 5066.