Monday, December 12, 2011

6174

A visualization of the Kaprekar sequence for four digit numbers, due, apparently, to D. Deutsch and B. Goldman, 2004

(embiggen)



Take any four-digit number in which at least two of the digits are different. Put the digits in descending order to make one new number, put them in ascending order to make another. Subtract the smaller from the larger. Apply the same process to the result. Use leading zeros, if necessary, to make the subtraction results into four-digit numbers. Keep doing that until you reach the obvious stopping point. Bet I can guess what your final number is!

Example: 1111.

No. At least one of the digits must be different.

Okay, 1112. So our two numbers are 2111 and 1112, the original number already having its digits in ascending order.

 2111
-1112
-----
  999 --> 9990 and 0999

 9990
-0999
-----
 8991 --> 9981 and 1899

 9981
-1899
-----
 8082 --> 8820 and 0288

 8820
-0288
-----
 8532 --> 8532 (already in descending order) and 2358

 8532
-2358
-----
 6174 --> 7641 and 1467

 7641
-1467
-----
 6174 <-- (This is the obvious stopping point)

6174? Why, that looks like the title of this post. Hmmm. Another? Let's see, right now it's 7:27 pm, or 1927 in 24-hr time.

 1927 --> 9721 and 1279

 9721
-1279
-----
 8442 --> 8442 and 2448

 8442
-2448
-----
 5994 --> 9954 and 4599

 9954
-4599
-----
 5355 --> 5553 and 3555

 5553
-3555
-----
 1998 --> 9981 and 1899

 9981
-1899
-----
 8082 --> 8820 and 0288 (Looking familiar?  Doesn't always
                         happen exactly this way, but ...)

 8820
-0288
-----
 8532 --> 8532 and 2358

 8532
-2358
-----
 6174

Picture of Dattaraya Ramchandra Kaprekar... but it always ends up at 6174. And the guy who figured this out, sixty years ago (probably by wasting precious cycles on ENIAC), was named Dattaraya Ramchandra Kaprekar, so this seemingly mundane number is known, in certain circles at least, as Kaprekar's Constant. Who knew? Not me, before a few minutes ago, that's for sure.

Mas? How about today's date, 1212? (Ah, rare agreement with my friends across the pond!) Let's go a little more compact, since you've got the hang of the drill by now. (Okay, and because I just remembered that, also.)

1212 --> 2211 and 1122
2211 - 1122 = 1089
9810 - 0189 = 9621
9621 - 1269 = 8352
8532 - 2358 = 6174 

The first four digits of pi? 3141?

3141 --> 4311 and 1134
4311 - 1134 = 3177
7731 - 1377 = 6354
6543 - 3456 = 3087
8730 - 0378 = 8352
8532 - 2358 = 6174 

The first four digits of pi, after the decimal point, I meant. 1415.

1415 --> 5411 and 1145
5411 - 1145 = 4266
6642 - 2466 = 4176
7641 - 1467 = 6174 

The first four digits of the square root of 3? 1.732?

1732 --> 7321 and 1237
7321 - 1237 = 6084
8640 - 0468 = 8172
8721 - 1278 = 7443
7443 - 3447 = 3996
9963 - 3699 = 6264
6642 - 2466 = 4176
7641 - 1467 = 6174 

Rick Perry's IQ, rounded up?

1 --> 0001 ---> 1000 and 0001
1000 - 0001 = 0999
9990 - 0999 = 8991
9981 - 1899 = 8082
8820 - 0288 = 8532
8532 - 2358 = 6174 

The Rick Perry Trinity?

1, 2, ..., uh, ... oops ... 1200 --> 2100 and 0012
2100 - 0012 = 2088
8820 - 0288 = 8532
8532 - 2358 = 6174 

Notice how it takes a varying amount of steps to get to 6174. (Fans of sets like Mr. Mandelbrot's famous one know where this is going, I bet.) If you do this procedure for all the four-digit numbers 0000 - 9999, excluding 1111, 2222, etc., keep track of how many iterations it takes to get to 6174 for each number, and color-code the results, you get the picture above. Well, you do if your name is (D. Deutsch and B. Goldman, 2004), at least.

Thanks so much to GrrlScientist for passing this curiosity (fascinatory?) along.

P.S. If you're really interested, let me save you a bit of Googling: Yutaka Nishiyama has a nice, in-depth write-up of how this works.

No comments:

ShareThis