## Sunday, December 24, 2006

### The mysterious 6174 revisited

From my earlier post on 6174 comes a simpler 3 digit variant. Select 3 integers which are not all the same. Arrange these digits to form the largest and smallest numbers and subtract them. Repeat this process with the result. For instance,

981-189=792
972-279=693
963-369=594
954-459=495

You will end up with 495!
The following gives a proof that all 3 digit numbers which are not 0,111,222,333,...,999 will end up with 495. This proof can be adapted to 4 digits as well, as in the case of 6174.

Let x,y,z be 3 digits such that z is the largest while x is the smallest, and x,y and z are not all equal. Then if we subtract the largest number formed from the smallest number formed, we have

zyx
- xyz
ABC

Since x < z
C=10+x-z,

Also,

B=10+y-1-y

And

A=z-1-x

Hence B = 9 = z since z is the largest digit. We want A and C to be either x or y. Solving, we see that x=4 and y=5. Hence 495 is the only number that repeats itself after an iteration.

But do any set of 3 randomly selected integers not all equal will lead to 495 after a finite number of iterations? First we see that for x,y and z,

z(100)+y(10)+x-(x(100)-y(10)-z)=(z-x)(99)

Hence the resulting number after any iteration is a 3-digit multiple of 99.
Hence we only need to check 9 possible numbers: 99,198,297,296,495,594,693,792 and 891 (10(99)=990 which is the same as 99)

Since all the above numbers lead to 495, QED.

Surprisingly, 495=5(99) which is in the middle of the pack of multiples of 99!

Can you see if you can generalise this result to 5 digit numbers and above?

At 10:08 AM,  Billy Congo said...

Nice post. I went the other way to 2 digit numbers. This is another meditation on the glories of 9.

Instead of ending on a number it does a cycle through 09, 18, 36, 27, and 45.

Starting with any number we immediately go into the cycle:

29
92 - 29
>63
63 - 36
27
72 - 27
45
54 - 45
9
90 - 9
81
81 - 18
>63

At 10:48 AM,  Billy Congo said...

5 also goes into a cycle.

99990 - 09999
89991
99981 - 18999
80982
98820 - 2889
95931
99531 - 13599
>85932
98532 - 23589
74943
97443 - 34479
62964
96642 - 24669
71973
97731 - 13779
>83952 (a bit transposed)
98532 - 23589
74943

At 9:19 PM,  Eric said...

This is answered through 10 digits here: http://plus.maths.org/issue38/features/nishiyama/

At 5:25 PM,  Chris said...

Two digit numbers don't go through a cycle. They always end on 9. I haven't used any formulas to prove this, but I can't find a single 2 digit number that doesn't end at 9. It always ends up at 45, which when taken from 54 equals 9.

All the numbers in the Kaprekar series are also multiples of 9. It's a very interesting numbrer. Add 1, 2 and 3 all the way to 9 and you get 45, which is also a multiple of 9.

At 3:35 AM,  keyboardr said...

@Chris You forgot the leading zero. 9 = 09, thus following the rule the next number would be 90-09=81.