 ## Cracking the magic pyramid

I came across a mind blowing arithmetic pyramid and couldn't resist the challenge of figuring out how it worked -

Here's the magic pyramid that held me in awe (I can't give credits, because I don't know who discovered it) So why does it work?

It turns out to rely on that magic little number 9, so let's reverse engineer it - I found it easier to start with the big number so that I could figure out the logic. Notice how taking one of the starting numbers away shifts all of the numbers one to the right, so the answer must be 1-0, 2-1, 3-2, 4-3, etc which is 1111...., until you get to the end  and it then ends 101, 102, 103 etc. So to make it up to an ending of ...1110, you have to add 9, 8, 7, 6 etc.

Now if we take away another of the starting numbers, because we are subtracting from 1111...0 we get (and let's do it together from the biggest example) 0 - 9 = 1 carry 1, 1 - 8 - 1 (the one that we carried) = 2 carry 1, 1 - 7 - 1 = 3 carry 1, 1 - 6 - 1 = 4 carry 1 and so on. Notice how the carry 1's come into play. My wife, Helen, was taught a different way. Because 0 - 9 doesn't go, they read the next digit in and got 10 - 9 = 1, leaving another 10 on top, so 10 - 8 = 2 and so on. The result is the same. It just depends how you were taught.

We took away the starting number twice from the starting number x 10, so what we actually did was multiply the starting number by (10 - 2) = 8 and then we also added the (*) number 9, 8, 7, 6 ...

And that is exactly what the magic pyramid did!

Now, it's one the to figure it out as I did above, but how the heck did someone figure it out in the first place?