Build the sum of number parts and restore original number

260 Views Asked by At

I don't have a huge background in mathematics, so I try to describe the problem in my own words:

If we have a number like: 123456, and we sum up all the parts like that:

123456 + 12345 + 1234 + 123 + 12 + 1

we get a new Number: 137171

Is there a specific mathematical name or description for a sum that's constructed like that?

Is there a way to reconstruct the initial number 123456 if you only have the result 137171, and if so whats the mathematical background?

1

There are 1 best solutions below

0
On

I don't know the name, though there is a way to reconstruct this number.

Maybe it's best to demonstrate this with an example. Say we are given $137171$. Then we want to find some initial number ABCDEF, where A,B,C,D,E,F are digits from 0-9. It is important to note that we can write this in an equation. We want to find ABCDEF such that $137171 = A(111111) + B(11111) + C(1111) + D(111) + E(11) + F(1)$. The method works like this: find the largest A value such that the total sum so far is less than $137171$, then find the largest B value such that the total sum so far is less than $137171$, etc. until we either reach $137171$ or determine that it is impossible.

Why does this work? Well, for the A value for example, we can't have an A that makes the total sum bigger than $137171$, since the final result would then be bigger than $137171$. If we picked a number that is 1 smaller than the maximum value that makes the total sum less than $137171$, we need $B(11111) + C(1111) + D(111) + E(11) + F(1) > 111111$ However, this is not possible, since $9(11111) + 9(1111) + 9(111) + 9(11) + 9(1) = 111105 < 111111$.

So we fix the max possible A value, then fix the max possible B value, and so on until we find ABCDEF. Hope this helps!