## Monday, February 29, 2016

### Doubling and Squaring, Cont'd

Can you show that the digits of 99...9 + 99...9 are the same as the digits of 99...9 × 99...9, discounting zero digits?

If you tried a few cases, then you observed a pattern:

9 + 9 = 18     and     9 × 9 = 81

99 + 99 = 198     and     99 × 99 = 9801

999 + 999 = 1998     and     999 × 999 = 998001

9999 + 9999 = 19998     and     9999 × 9999 = 99980001

Given a string of N consecutive 9's, if we double it, then we get a 1, followed by N − 1 consecutive 9's, followed by an 8. Whereas, if we square it, then we get N − 1 consecutive 9's, followed by an 8, followed by N − 1 consecutive zeros, followed by a 1. The digits of the double are the same as the digits of the square, discounting zeros.

Where does the pattern come from? Here is one way to look at the example of 9999:

9999 + 9999 = 10000 + (10000  2).

If we call the number in parentheses X, then we have

9999 + 9999 = 10000 + X.

This implies that the digits of the sum are just the digits of X preceded by a 1.

Meanwhile,

9999 × 9999 = (10000  1)(10000  1)

= 10000(10000  2) + 1

= 10000X + 1.

Now we can see that the digits of the product are going to match the digits of the sum, discounting zeros, because multiplying X by 10000 preserves the digits of X (all it does is tack on zeros), and when we finally add the 1, the rightmost zero becomes a 1.

In short, the sum is of the form [1][X] and the product is of the form [X][0's][1].

I'll end with a general version of this line of reasoning.