Three mathematical nuggets

For a change of pace, I thought I’d share three interesting mathematical nuggets I’ve run across recently:

Kaprekar’s constant

The first nugget is the magic number 6174, also known as Kaprekar’s constant. Here’s what’s special about it:

1. Take any four-digit number in which at least one digit differs from the rest. For instance, 9998 is OK but 9999 is not. Leading zeros are fine, so 0072 is permitted.

2. Rearrange the digits in descending order. For example, 8953 becomes 9853.

3. Now rearrange the digits in ascending order. 8953 becomes 3589.

4. Subtract the number you got in step 3 from the number you got in step 2. In this case, you get 9853 – 3589 = 6264.

5. Take your new number and perform steps 2-4 on it. You get 6642 – 2466 = 4176.

6. Take that number and repeat steps 2-4.

7. If you keep repeating steps 2-4, you always end up at the number 6174 within at most seven total iterations.

8. Once you arrive at 6174, you stay there forever, because 7641 – 1467 = 6174.

In our example, the entire process looks like this:

Starting number is 8953
9853 – 3589 = 6264
6642 – 2466 = 4176
7641 – 1467 = 6174
6174 is the magic number, so we’re done.

Note that since we’re rearranging digits, this result depends on the fact that we’re using decimal arithmetic — base 10. In other bases, there may or may not be a single magic number.

As you’d expect, Kaprekar’s constant was discovered by a guy named Kaprekar — a schoolteacher from Maharashtra. Kaprekar was a weird dude — he checked all 9,990 possibilities by hand. This sort of thing was his hobby, and he would spend hours doing calculations for fun. He said

A drunkard wants to go on drinking wine to remain in that pleasurable state. The same is the case with me in so far as numbers are concerned.

 

Harmonic series minus 9s

The harmonic series is

    \[ $$\sum_{n=1}^{\infty} \frac{1}{n} = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \cdots$$ \]

That series diverges — that is, even though the terms get smaller, the sum is infinite. However, you can turn it into a convergent series by eliminating all terms that contain the digit ‘9’. So 1/9 is excluded, and so are 1/19, 1/29, etc.

At first glance, it feels counterintuitive that this would convert a divergent series into a convergent one. But it makes more sense when you consider the fact that as the denominator increases, the likelihood of finding the digit 9 somewhere in it increases. Only 1 out of 9 single-digit numbers qualifies (9 itself), but 18 out of 100 two-digit numbers qualify (19,29,…89, 90-99), 271 out of 1000 three-digit numbers qualify, and so on.

Without the 9s, the sum is an irrational number approximately equal to 22.92. It has no known relation to any of the fundamental mathematical constants, such as π or e.

The lonely runner problem

Imagine two runners running around a circular track of length one mile. Assume they are running at different speeds and that they continue running forever, as punishment for being MAGA Republicans. Regardless of their speeds, it is guaranteed that at some point they will be exactly opposite each other. That is, the distance between them will be half the length of the track: 1/2 mile.

A “lonely” runner is defined as one who is at least 1/n miles from every other runner, where n is the number of runners. The runners above become lonely when they are opposite each other — 1/2 mile apart — because n = 2, and 1/n is therefore 1/2.

In the case where n = 3, a runner becomes lonely when they are at least 1/3 mile from each of the other two runners. In the case where n = 4, a runner becomes lonely when they are at least 1/4 mile from the other three runners, and so on.

It has been proven that for values of n from 2 through 10, each runner is guaranteed to become lonely at some point. No one knows whether it is true when there are 11 or more runners.

17 thoughts on “Three mathematical nuggets

  1. What’s the point of it? Math often doesn’t make sense…
    ETA:
    Funny thing is when the math makes sense people don’t like it because they don’t understand it …

  2. J-Mac:

    What’s the point of it?

    Knowledge for the sake of knowledge. I don’t see any practical application of the nuggets in the OP, but they’re interesting. And if you’re like Kaprekar, you can become drunk on numbers. That’s worth something.

    Math often doesn’t make sense…

    If you mean that it can be counterintuitive, I agree. But mathematicians don’t take their results for granted. They demand that the results make sense. That’s why they require formal proofs.

  3. In the OP, I wrote that eventual loneliness has been proven for all values of n (the number of runners) from 2 through 10. There’s something unsatisfying about that, though, because for simplicity’s sake, we’d also like it to be true for n=1. It’s awkward having a hole there. It’s also counterintuitive to say that a single runner, alone on the track, doesn’t qualify as lonely.

    First I considered generalizing the definition of loneliness to include the distance to oneself as well as to all the other runners. If the distance from oneself to oneself is the entire circumference of the track, then this works, and a single runner counts as lonely, because the distance from that runner to him or herself is at least 1/1, or 1 mile. The problem is that it’s more natural to say that the distance from oneself to oneself is zero. “I’m a mile from myself” would be a strange statement to make.

    Then it occurred to me that there’s a way to look at this that doesn’t require a change in definitions. Here’s the definition of loneliness again:

    A “lonely” runner is defined as one who is at least 1/n miles from every other runner, where n is the number of runners.

    In mathematical logic, there is something known as “vacuous truth”, and it applies here. If there is only one runner X, and X therefore has no other runners to be distant from, then the statement “X is at least 1 mile from every other runner” is actually considered to be true. Likewise, the statement “All unicorns are yellow” is also considered to be true, because there are no unicorns to either be or not be yellow. In other words, a statement is considered to be true unless there is at least one counterexample.

    That means, sadly, that the lone runner is lonely and will always be lonely, unlike in the n > 1 cases, where the loneliness only lasts for a finite time. But at least we can now say that loneliness is possible for the lone runner, which matches our intuition about what loneliness entails.

    Loneliness has therefore been proven inevitable for n=1 through 10.

    But now, having written that, it occurs to me that loneliness is guaranteed for n = 0, too, for the same reason. If there are no runners at all, then there are no runners to be lonely, so the statement “Every runner will eventually be lonely” is actually true. But now loneliness doesn’t attach to any runners, because there are no runners for it to attach to. Loneliness is disembodied, a ghostly presence hovering over the track. We might say that the track itself is lonely, if we’re feeling poetic.

    With all of that established, we now know that the statement has been proven true for all n such that 0 ≤ n ≤ 10, which is much more satisfying than merely being able to claim proof for 2 ≤ n ≤ 10.

  4. Another property of Kaprekar’s numbers is that the suitable four-digit numbers (Kaprekar’s numbers) resolve to Kaprekar’s constant in at most seven steps. From 1000 to 9998, there are 356 numbers that resolve to the constant in a single step (besides number 6174, which is the constant itself), 519 numbers in two steps, 2124 numbers in three steps, 1124 numbers in four steps, 1379 numbers in five steps, 1508 numbers in six steps, and 1980 numbers in seven steps. Just for fun, here are the numbers that resolve to the constant in one single step:

    1036
    1063
    1137
    1173
    1247
    1274
    1306
    1317
    1357
    1360
    1371
    1375
    1427
    1467
    1472
    1476
    1537
    1573
    1577
    1603
    1630
    1647
    1674
    1713
    1724
    1731
    1735
    1742
    1746
    1753
    1757
    1764
    1775
    2006
    2046
    2060
    2064
    2147
    2174
    2248
    2284
    2358
    2385
    2406
    2417
    2428
    2460
    2468
    2471
    2482
    2486
    2538
    2578
    2583
    2587
    2600
    2604
    2640
    2648
    2684
    2688
    2714
    2741
    2758
    2785
    2824
    2835
    2842
    2846
    2853
    2857
    2864
    2868
    2875
    2886
    3016
    3056
    3061
    3065
    3106
    3117
    3157
    3160
    3171
    3175
    3258
    3285
    3359
    3395
    3469
    3496
    3506
    3517
    3528
    3539
    3560
    3571
    3579
    3582
    3593
    3597
    3601
    3605
    3610
    3649
    3650
    3689
    3694
    3698
    3711
    3715
    3751
    3759
    3795
    3799
    3825
    3852
    3869
    3896
    3935
    3946
    3953
    3957
    3964
    3968
    3975
    3979
    3986
    3997
    4026
    4062
    4066
    4127
    4167
    4172
    4176
    4206
    4217
    4228
    4260
    4268
    4271
    4282
    4286
    4369
    4396
    4602
    4606
    4617
    4620
    4628
    4639
    4660
    4671
    4682
    4693
    4712
    4716
    4721
    4761
    4822
    4826
    4862
    4936
    4963
    5036
    5063
    5137
    5173
    5177
    5238
    5278
    5283
    5287
    5306
    5317
    5328
    5339
    5360
    5371
    5379
    5382
    5393
    5397
    5603
    5630
    5713
    5717
    5728
    5731
    5739
    5771
    5782
    5793
    5823
    5827
    5832
    5872
    5933
    5937
    5973
    6002
    6013
    6020
    6024
    6031
    6035
    6042
    6046
    6053
    6064
    6103
    6130
    6147
    6200
    6204
    6240
    6248
    6284
    6288
    6301
    6305
    6310
    6349
    6350
    6389
    6394
    6398
    6402
    6406
    6417
    6420
    6428
    6439
    6460
    6471
    6482
    6493
    6503
    6530
    6604
    6640
    6714
    6741
    6824
    6828
    6839
    6842
    6882
    6893
    6934
    6938
    6943
    6983
    7113
    7124
    7131
    7135
    7142
    7146
    7153
    7157
    7164
    7175
    7214
    7241
    7258
    7285
    7311
    7315
    7351
    7359
    7395
    7399
    7412
    7416
    7421
    7461
    7513
    7517
    7528
    7531
    7539
    7571
    7582
    7593
    7614
    7641
    7715
    7751
    7825
    7852
    7935
    7939
    7953
    7993
    8224
    8235
    8242
    8246
    8253
    8257
    8264
    8268
    8275
    8286
    8325
    8352
    8369
    8396
    8422
    8426
    8462
    8523
    8527
    8532
    8572
    8624
    8628
    8639
    8642
    8682
    8693
    8725
    8752
    8826
    8862
    8936
    8963
    9335
    9346
    9353
    9357
    9364
    9368
    9375
    9379
    9386
    9397
    9436
    9463
    9533
    9537
    9573
    9634
    9638
    9643
    9683
    9735
    9739
    9753
    9793
    9836
    9863
    9937
    9973

  5. Erik:

    Another property of Kaprekar’s numbers is that the suitable four-digit numbers (Kaprekar’s numbers) resolve to Kaprekar’s constant in at most seven steps.

    Yes, I mentioned that in the OP. I should probably also mention why it’s required that at least one of the digits in the starting number be different from the rest. Consider the starting value 6666:

    With digits in descending order: 6666
    With digits in ascending order: 6666
    Subtract ascending from descending: 6666 – 6666 = 0 (or 0000 as a four-digit number)

    Now repeat the procedure on 0000:
    Descending order: 0000
    Ascending order: 0000
    Subtract ascending from descending:
    0000 – 0000 = 0000

    So 0 maps to itself, just like 6174 does. No other numbers do. In mathematical jargon, 0 and 6174 are called the fixed points of the Kaprekar procedure. If all four digits are the same, we end up at the fixed point 0 and stay there. If at least one digit differs, we end up at the fixed point 6174 and stay there. That exhausts the possibilities.

    This is not typical behavior. For bases other than 10 and/or digit counts other than 4, there are typically cycles: that is, that is, there are some numbers for which applying the procedure causes you to loop forever. For example, a cycle might look like this: for some number a, applying the procedure repeatedly will cause you to follow a loop: a -> b -> c -> a -> b -> c…

    You never stop.

  6. Another mathematical nugget I ran across recently, this one involving random walks:

    Imagine an infinite two-dimensional grid. A walker starts at a particular point on the grid. They then take a single step in one of four directions: right, left, up, or down. The direction is chosen randomly. Then they take another step, also chosen randomly. Then another, and another, and another, forever. The steps are always the same length, so that the person is always at the intersection of two grid lines.

    The probability that the person will eventually return to the starting point is 100%. That doesn’t mean that it’s certain — this is a quirk due to the fact that there are infinitely many possibilities. The person could in fact go left, left, left… forever and never return to the starting point, despite the fact that the odds of returning are exactly 100%.

    If the grid is one-dimensional — a line, in other words — the probability of returning to the starting point is also 100%. But if the grid is three-dimensional, the probability drops down to about 34%.

    I don’t understand why. It’s an interesting and counterintuitive result.

  7. keiths:
    J-Mac:

    Knowledge for the sake of knowledge. I don’t see any practical application of the nuggets in the OP, but they’re interesting. And if you’re like Kaprekar, you can become drunk on numbers. That’s worth something.

    If you mean that it can be counterintuitive, I agree. But mathematicians don’t take their results for granted. They demand that the results make sense. That’s why they require formal proofs.

    I’m surprised or even disappointed…
    What is the point of knowledge without purpose?

  8. keiths,

    Let’s just assume the evolutionary theory, the origin of life theory, don’t add up.
    There is a an Alien, an uncreated being who calls himself God. He can’ have a beginning in the sense we perceive it.
    So, what does he do? How does he deal with eternity and immortality?
    Are these legitimate questions?
    Yes or No?

  9. J-Mac:

    I’m surprised or even disappointed…
    What is the point of knowledge without purpose?

    I’m surprised and disappointed at your question. Have you never learned something for its own sake, simply out of curiosity, with no application in mind? If not, you’re missing out.

    Let’s just assume the evolutionary theory, the origin of life theory, don’t add up.
    There is a an Alien, an uncreated being who calls himself God. He can’ have a beginning in the sense we perceive it.
    So, what does he do? How does he deal with eternity and immortality?

    He entertains himself for eternity by pondering mathematical nuggets like the ones discussed in this thread.

    Are these legitimate questions?
    Yes or No?

    Yes, the question of how an immortal being could entertain itself for eternity (assuming it needs entertainment and is capable of experiencing it) is a legitimate question. Why do you ask? It sounds like you may be interested in the answer for its own sake, out of simple curiosity. There’s hope for you yet.

  10. A fourth nugget.

    Speaking during a U.S. Senate hearing, Kennedy said Trump has described that “TrumpRx,” a federal government website designed to provide Americans with discounted prices on brand-name prescription drugs, cuts the price of a $600 drug to $10 as a “600% reduction.”

    Kennedy, who appeared before the Senate Finance Committee on Wednesday morning, said “President Trump has a different way of calculating, there’s two ways of calculating percentages. If you have a $600 drug and you reduce it to $10, that’s a 600 percent reduction.” He acknowledged that Trump’s math departs from standard calculations.

    https://www.newsweek.com/rfk-jr-trump-different-way-calculating-drug-prices-warren-senate-11864840

  11. “President Trump has a different way of calculating, there’s two ways of calculating percentages”

    Yes, there is the right way and the wrong way. The right way is that 600 to 10 is a reduction of 98.33% { i.e. (590/600)*100} and the wrong way is anything else.

  12. I mentioned the harmonic series in nugget #2 of the OP:

        \[ \sum_{n=1}^{\infty} \frac{1}{n} = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \cdots \]

    That sum is infinite, but it grows at a glacially slow pace because the terms get tiny so quickly. Today I learned that if you had started summing that series at the time of the Big Bang, adding one term per second, the total would only be around 40 today.

  13. A cool application of the harmonic series:

    Here’s a mind-blowing experiment you can try at home: Gather some children’s blocks and place them on a table. Take one block and slowly push it over the table’s edge, inch by inch, until it’s on the brink of falling. If you possess patience and a steady hand, you should be able to balance it so that exactly half of it hangs off the edge. Nudge it any farther, and gravity wins. Now take two blocks and start over. With one stacked on top of the other, how far can you get the end of the top block to poke over the table’s edge?

    Keep going. If you stack as many blocks as you can, what is the farthest overhang you can achieve before the entire structure topples? Is it possible for the tower to extend a full block length beyond the lip of the table? Does physics permit two block lengths? The stunning answer is that the stacked bridge can stretch forever. In principle, a freestanding stack of blocks could span the Grand Canyon, no glue required.

    The key is that the blocks have to be stacked in a way that takes account of the harmonic series. In the image below, the blocks are all the same length. The overhang of the top block is half the block length, corresponding to the 1/2 term in the series. The next block’s overhang is 1/3, the next is 1/4, etc.

    Here’s a real-life image of a stack built with Jenga blocks:

    jenga block stack (Custom)

    As you can see, the overhangs don’t perfectly match the harmonic series. They’re slightly less. I suppose that’s because it’s really hard to push the blocks out to the tipping point without going over. The surfaces aren’t perfectly level, and there will even be a slight deformation of the lower blocks due to the weight of the stack.

    The principle is the same, though, and you can see that the entire length of the top block is beyond the edge of the bottom block.

    ETA:
    +10 OCD points to anyone who, like me, is annoyed that the Jenga logos aren’t all oriented right side up.

  14. keiths:
    A cool application of the harmonic series:

    The key is that the blocks have to be stacked in a way that takes account of the harmonic series. In the image below, the blocks are all the same length. The overhang of the top block is half the block length, corresponding to the 1/2 term in the series. The next block’s overhang is 1/3, the next is 1/4, etc.

    Here’s a real-life image of a stack built with Jenga blocks:

    As you can see, the overhangs don’t perfectly match the harmonic series. They’re slightly less. I suppose that’s because it’s really hard to push the blocks out to the tipping point without going over. The surfaces aren’t perfectly level, and there will even be a slight deformation of the lower blocks due to the weight of the stack.

    The principle is the same, though, and you can see that the entire length of the top block is beyond the edge of the bottom block.

    ETA:
    +10 OCD points to anyone who, like me, is annoyed that the Jenga logos aren’t all oriented right side up.

    If you believe “vaccines” work, why don’t prove it? You can, can’t you?

  15. J-Mac:

    If you believe “vaccines” work, why don’t prove it?

    For the same reason I don’t bother proving that atoms exist or that the Big Bang happened.

    Not sure why you posted that here when you seem to be responding to this comment in the Antivax thread.

Leave a Reply