December 2016 Fiendish Function

The Fiendish Function posed during December 2016 had the following sample guesses and replies:

  • GUESS
  • REPLY
  • 1
  • 1
  • 2
  • -6
  • 3
  • -3
  • 4
  • -84
  • 5
  • -69
  • 10
  • 14

The rule was: "Write the number in binary, then subtract from two to the power of the number".

Suppose the guess was 22:

  • Write the number in binary, giving 10110.
  • Calculate two to the power of the number, giving 4194304.
  • Subtract the number from this, giving 4184194.

So the result is 4184194.