Ask HN: Unusual distribution of steps needed to reach Kaprekar's constant (6174)

2 points by hoyd 4 months ago

In the distribution of the number of steps needed to reach Kaprekar's constant (6174), I observe an unexpected distribution pattern, with three steps being the most common number of steps required. I cannot think of why this is the case. Has anyone done some though about this phenomenon? See a plot here: https://earth.hoyd.net/posts/distribusjonen-av-antall-steg-til-kaprekars-konstant/

gus_massa 4 months ago

Do you have an English version? Posts in other languages are usually ignored or flagged.

  • hoyd 4 months ago

    Sorry about that. The post itself isn't relevant, it's just the plot from it I refer to.

    • gus_massa 4 months ago

      You must post a (auto)translated version! My spider sense tell me I'll get like 30 points here. (Obviously, I can't guarantee that, only 1 upvote.) I guess even some interesting comments, and perhaps a solution.

      I read it. (I studied German in Primary School. I don't remember too much, but enough to skim the texts in Norwegian.) I'm also mathematician, so it's the kind of stuff I like. My guess is modulo 9 and then some bounds should explain most of it, but life is never so easy.

      If you post the (auto)tranlated version and nobody gives an answer, I promise to try to solve it. (Obviously, I can't guarantee a solution.)

      (In my experience, autotranlations does 90% of the job, but you need to polish it a little and in particular ensure the technical words are the correct ones.)

      • hoyd 4 months ago

        Sure, here is a translated post:

        Title: Distribution of the Number of Steps to Kaprekar's Constant

        We are trying Kaprekar's routine.

        I choose a four-digit number with at least two different digits: 2345. We find the largest possible variant 5432 and the smallest possible variant 2345 from the digits and begin the routine...

        5432 - 2345 = 3087 8730 - 0378 = 8352 8532 - 2358 = 6174

        We have arrived at Kaprekar's constant: 6174 after 3 steps.

        This is fine. If I now do this on all possible four-digit numbers, the number of steps required before 6174 is reached is distributed as follows:

        The diagram showing the distribution of steps: https://earth.hoyd.net/wp-content/uploads/2025/03/kaprekars_...

        This distribution seems a bit strange and not entirely intuitive. I immediately feel that the distribution should have been more evenly distributed.

        Perhaps not evenly, but I think that one step to 6174 should be rarer than seven steps, shouldn't it? It has to do with the calculation i guess. There are a limited number of combinations where the result is 6174 on the first attempt. It feels a bit obvious and matches the diagram above. It slowly rises towards seven steps, is that to be expected?

        What I find most strange is that three steps tops all others. Why is that? Why is there such a large presence of three? What does it mean? I would very much like to find an explanation for this.

        • gus_massa 4 months ago

          That what I understood. It's interesting. After the second step in your example, they are congruent with 3 modulo 11, but I'm not sure if it's just a coincidence...

          Anyway, I think that if you copy this to a new entry in your blog and then post it here, it may get traction and hopefully an answer.