17

There is a secret operator $F$ that takes two whole numbers and outputs a new number. For example

$$\begin{split}F(6,9) &= 15\\ F(66,11) &= 110 \\ F(86,18) &= 179\end{split}$$

Can you find what $F$ does and what is the output of $F(601,81)$ ?

Hint:

F may not be defined for all inputs

Dmitry Kamenetsky
  • 35,897
  • 5
  • 66
  • 276
  • 9
    I LaTeXed your question! – Culver Kwan Jul 15 '20 at 08:04
  • 3
    does F always produce whole, positive integers when given whole numbers? Because if not, you can always solve $F(x,y)=ax + by + c$ for a,b,c and get a very, very ugly result. – subrunner Jul 15 '20 at 08:40
  • 1
    @subrunner What if it is a non-linear operator? I suspect there is some concatenation involved. – Earlien Jul 15 '20 at 09:03
  • Given the description, $F$ sounds more like a function than an operator. – Earlien Jul 15 '20 at 09:11
  • operator, function, that is pretty much the same, isn't it? an operator is a function of 2 dimensions! And yes, it is probably a non-linear operator, but if you make no restrictions on what F can output it COULD be the simple but ugly solution! – subrunner Jul 15 '20 at 09:23
  • An operator is a special type of function which maps functions to functions. You would not call a function that maps integers to integers an operator. – Brady Gilg Jul 15 '20 at 17:37
  • 3
    @brady-gilg The word operator has several meanings, and you'd have to settle on one to make an exact distinction. In computer language design, for example, operator generally means "function of one or two variables that is written in a prefix or infix form". Thus - is a unary operator because -x applies the operator to the variable x, and + is a binary operator because x+y applies the operator to x and y. – Ross Presser Jul 15 '20 at 17:40

2 Answers2

36

The answer could be:

Rotating the whole numbers, rather parameters, and not the individual integers, by 180 degrees and adding them together.

$F( 6, 9) \quad\rightarrow 9 + 6 \quad= 15$
$F(66,11) \rightarrow 99 + 11 = 110$
$F(86,18) \rightarrow 98 + 81 = 179$

Therefore the output of $F(601, 81)$ would be

$109 + 18 = 127$

  • 9
    +1 for sheer mindbending non-mathematical genius! Now I know why the question wasn't tagged 'mathematics' :) – subrunner Jul 15 '20 at 09:35
  • 3
    Hi Ewasted and welcome to Puzzling! It would improve your answer to be more specific about what 'flipping' means in your answer. If you could explicitly mention rotation instead in your answer it would be much clearer. (To me, flipping 601 could mean either (i) reversing the digits to 106 or flipping each individual digit across its horizontal axis to get 901 - neither of these is quite what you mean!) Thanks :) – Stiv Jul 15 '20 at 09:35
  • 3
    Sorry, I fixed it now :-) –  Jul 15 '20 at 09:46
  • 1
    You got it. Well done! – Dmitry Kamenetsky Jul 15 '20 at 10:52
7

For what it's worth, here's the solution as a short C# program. No string operations necessary :)

void Main()
{
  F(6,9).Dump();      //  15
  F(66,11).Dump();    // 110
  F(86,18).Dump();    // 179
  F(601,81).Dump();   // 127
 }

int F(int x, int y) { return rotate(x)+rotate(y); }

int rotate(int num) { int result =0; for (; num > 0; num /= 10) { int digit = num % 10; switch (digit) { case 0: case 1: case 2: case 5: case 8: break; case 3: case 4: case 7: throw new ArgumentException($"can't flip {digit}"); case 6: digit = 9; break; case 9: digit = 6; break; default: throw new ArgumentException("I can't even"); } result = result * 10 + digit; } return result; }

Ross Presser
  • 409
  • 2
  • 8