Is there a name for the operation that turns "$7$" and "$8$" into "$78$"?

77 Views Asked by At

In the context of puzzles such as this:

Write a program that outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100. For example 1 + 2 + 3 - 4 + 5 + 6 + 78 + 9 = 100.

Is there a name for the "nothing"-operation between 7 and 8?

What it would do is I think: let a,b be positive integers

$a$ nothing $b= a\times 10 +b$

Also if you think this belongs to a special Tag please edit the Tag in there.

1

There are 1 best solutions below

2
On BEST ANSWER

It's called concatenation. And it's not $a \times 10 + b$. That fails for numbers with more than one digit.

The correct formula is $a \cdot 10^{1 + \lfloor\log_{10}(b)\rfloor} + b$ where we define $\log_{10}(0) = 0$.