# What does this concatenation operator do?

0#0=0
1#1=3
10#10=170
42#42=2730
1024#1024=2098176
123456789#987654321=132560718793697457
314159265358979#218281828459045=88427971900355630574283039269

1#2#3#4#5#6#7#8#9=28931977


Find 2#2#2.

• Inspired by this, I bet!
– Jafe
Commented May 2 at 0:59
• of course :) nice bounty btw
– Sny
Commented May 2 at 1:51
• One day we'll crack that one... it's been in my head for months... @Jafe Commented May 2 at 15:04

It concatenates…

in binary!

More specifically…

It converst the inputs from decimal to binary, concatenate the binary strings, then converts the result back to a decimal number.

Therefore…

2#2#2=0b10#0b10#0b10=0b101010=42. The answer to life, the universe, and this question!

More fun properties:

This operator is associative, but not commutative.
It has a left identity (0), but no right identity—unless you count 0 in binary to be technically digitless.
It can be implemented fairly easily by using shift operators and (insert favorite method for counting bits).

• One more property if we allow twos complementation: $(-1)#n=n-2^m$ where $m$ is chosen to make the next power of $2$ beyond $m$. E.g. $(-1)#100=100-128=-28$. Commented May 2 at 13:04