# A New Math Operation?

Your quirky Math teacher comes with a new Math operation called "@" and wants to see if you can figure out what it does.

She writes the following examples on the blackboard:

8@5 = 31340

9@3 = 61227

10@9 = 11990

7@6?

• She must write all those silly online IQ tests too. – qwr Nov 22 at 3:03
• How on earth has this question a unique solution? – Matsmath Nov 24 at 13:27

The result of 7@6 is

11342

because

the first digit is the difference $$7-6$$, the next two digits are the sum $$7+6$$, and the last two digits are the product $$7 \times 6$$.

• Wow, that was quick! +1 – Mr Pie Nov 21 at 6:44
• What would you give for 6@7? @WoBra has another formula – bobobobo Nov 23 at 13:59

11342

because the operator x@y is clearly the function:

f(x,y) = x*y + 10^ceiling(log10(x*y))*(x+y) + 10^ceiling(log10(x*y + 10^ceiling(log10(x*y))*(x+y)))*(x-y)

Alternatively:

The answer is 11343.5 because x@y = f(x,y) = 10106*x - 9890.5*y -55.5

• ... which is just a mathematical formulation of essentially what @shoover said – Dason Nov 21 at 16:54
• Indeed but it's always fun to see the math spelled out – Kai Qing Nov 21 at 21:13
• It's nice how close the linear extrapolation gets to the intended answer! – JiK Nov 22 at 12:31
• @JiK I thought was interesting as well. A difference of only 1.5 for numbers that large is kind of remarkable. – Dason Nov 22 at 13:01
• It's not too surprising, because the first 3 out of 5 digits are explicitly linear. (When x and y are both one digit long, but x+y is two digits, f(x,y) = 10100x - 9900y gets us the difference part and the sum part of the answer.) – Misha Lavrov Nov 23 at 0:30

11342,

because

x @ y → (x - y) ×10'000 + (x + y) ×100 + (x × y)

fits for the given examples.

• True - for the given examples the product is always 2 digits long, the sum 2 digits long, and the difference just 1 digit long. There currently isn't enough data to decide if we would need to go to my more complicated formula to determine how many digits each piece actually contains before doing the concatenation. Kudos for the simpler version that works for the examples given. – Dason Nov 21 at 20:12

Let $$p(a, b) = a\cdot10^{\lceil\log_{10}b\rceil}$$, so that $$b + p(a, b)$$ is the concatenation of $$a$$ followed by $$b$$ (the function $$p$$ places $$a$$ in front of $$b$$ when they are added). Now we can express the operator $$@$$ succintly in terms of $$p$$: $$x@y = xy + p(x+y, xy) + p(x-y, p(x+y, xy))$$

7@6 is

11342

Because formula is

a@b = Concatenate(a-b, a+b, ab)

Write the general case as a@b

(a-b) ++ (a+b) ++ (a*b) where ++ is the concatenation operator

Some question are, do we limit a and b? For instance do we require a > b, what about a=b? This answer seems to require that a and b be positive because otherwise you get weird results for the 2nd and 3rd terms.

• This answer was already provided by previous posters. The questions you raise are interesting, but not really part of solving the puzzle. – Rand al'Thor Nov 22 at 18:35
• In the future, I'll try to respond as a comment. I don't think I can do that at this point. – user2103050 Nov 26 at 19:09