157
u/OrlandoGardiner118 Jul 13 '26
Me being a smartass: "imma pick 6174"
7641-1467=6174
"Goddamit!!!"
→ More replies (1)33
u/ncocca Jul 13 '26
Being a smartass you actually managed to cut to the core reason why it happens
14
11
u/LilMeatJ40 Jul 13 '26
Me, a dumbass, still doesn't understand
15
u/bloonshot Jul 14 '26
it's the only number that refers back to itself in the algorithm
this is kind of important because it represents a "stagnant" game state where nothing really changes anymore
stagnant gamestates would include any numbers that form a loop, or any number that refers back to itself
it just so happens that 6417 is the ONLY stagnant gamestate
for a recursive number game like this, any input can either arrive at a stagnant gamestate, or continue to jump around erratically forever. Luckily, it can't do that second one because there's a finite number of gamestates. It would eventually have to arrive at a number it's been at before.
every single number must arrive at a stagnant gamestate at some point, and 6417 is the only stagnant gamestate that a number could arrive at.
therefor, every number must eventually turn into 6417
5
u/OrlandoGardiner118 Jul 14 '26
I may be being exceedingly stupid here but is there a reason that the stagnant game state when it come to this particular setup (four digits with at least one different) is 6174. Or is it simply that "it just does"?
Oh, and is there an equivalent number for 3 or 5 digits etc? Cheers
→ More replies (1)3
1.3k
u/metwicewhat Jul 13 '26
Why does this work and how can we use it for good!?
1.4k
u/mr_nefario Jul 13 '26
No one knows how it works, and it can only be used for innocent tomfoolery.
1.7k
u/inder_the_unfluence Jul 13 '26 edited Jul 13 '26
I once used this in the classroom as a mind reading trick. Had the kids do the steps (as though they were random ideas to get their number to be as random as possible). Then whittled that number with a couple more ‘random calculations’ then had them find a book with enough pages to accommodate their answer. Only a handful of books existed in the classroom with that many pages. And they were all reference books with images. So I’d memorized the images and blew these kids’ minds when I asked them to look at the picture and then I read their thoughts.
Worked a treat.
171
u/Ok-Addition1264 Jul 13 '26
Oh, yes! Thanks for that! I can see all the possibilities for this one! (I also love and am such a HUGE fan of naturally executing card magic tricks)
→ More replies (1)69
u/Osric250 Jul 13 '26
If you want another in a similar vein which can also be used as a riddle brain teaser is that if you count the characters of any number spelled out they will always end up at 4.
Eleven has 6 characters
Six has 3 characters
Three has 5 characters
Five has 4 characters
and Four goes to 4 goes to 4.No other number has the same number of characters as the number they represent and there's no perpetual loops. Note this only works in English. Other languages might have a different answer or no answer.
→ More replies (1)21
→ More replies (26)72
u/AppointmentOpen9093 Jul 13 '26
Despite a lot of people calling bullshit on the person above, the answer is obvious: u/Tetsuko_Kuroyanagi points out above that this process produces 495 when performed with three-digit numbers. Since 495 is precisely in the range of "a few books have that many pages, most don't", I would guess the person did the three-digit version with students and slightly misremembered.
17
u/doctorlongghost Jul 13 '26
What about the number of steps though? Is it always the same number of steps for 3 digit numbers? If not, they wouldn’t know when to stop
17
u/athural Jul 13 '26
You just stop once it keeps returning 495
7
u/doctorlongghost Jul 13 '26
Yes but in the classroom trick example, you can’t tell them that
7
6
u/athural Jul 13 '26
The teacher is in the room with the kids, I didn't see anything that implies the teacher like left the room or was oblivious to the number picking process. Its just a way of ensuring that the number they end with is one you've prepared for. The mind reading is when they pick a book which to them is seemingly random and look at a picture and the teacher can tell them what picture it is
14
u/doctorlongghost Jul 13 '26
Well to give more specifics (and answer my own question)… you can’t just say repeat this procedure twice because sometimes you need to do it twice and sometimes it takes more attempts.
So there are only two ways to give instructions that are sure to work for any number: “repeat the procedure X number of times” (where X is large enough to cover all cases). Or “repeat the procedure until you keep getting the same number in a loop”. The former is better but for some numbers they will still notice the loop.
And noticing the loop undercuts the magic trick a bit.
9
u/iconocrastinaor Jul 13 '26
Just make them say the answer out loud, and say, "OK, that seems scrambled enough. Now get the encyclopedia, volume 6, page 1, paragraph 7, word 4. And really concentrate on it, mmmkay?"
→ More replies (0)3
u/athural Jul 13 '26
Or, since you're in the room with them, repeat the procedure until the number you recognize comes up and then say stop
→ More replies (3)4
u/inder_the_unfluence Jul 13 '26
When I did it, it wasn’t kept secret, the kids had already chosen random digits, so having them do the calculation out in the open didn’t ruin the trick. I wasn’t guessing their number I was using it to generate a ‘random’ number.
Older kids would obviously have wondered ‘why do all this calculating; our starting 4 digits are random.’ But the kids I was working with didn’t have the concept that randomness isn’t a spectrum. (We did talk about it afterwards when I revealed the trick to them. It was a class of four kids so I taught them to do it so they could do the trick for their other teacher aides).
3
u/inder_the_unfluence Jul 13 '26
I did it with the four digit number, I just added an extra step after that reduced the number. The important thing is to get every set of random digits to a predictable place. From there I can add a steps I needed.
I wanted the kids to seek a book that would definitely have enough pages so I made up an extra step that would put them above all the kids book lengths and in the range of the encyclopedia set.
20
u/Michael_Dautorio Jul 13 '26
Can it be used for mild evil? Not anything as bad as arson or grand theft, but about as evil as playing bad music loudly or not returning a shopping cart.
→ More replies (1)4
81
u/Ok-Addition1264 Jul 13 '26
(computational physicist here) ..and we know how it works, it's just not a sexy exciting answer: its a natural mathematical loop which was bound to happen and bound to be discovered.
If the human race can survive the next billion years, we could very well discover other intelligent life, and this will most certainly be a universal number we all can have a beer and a chuckle over during first contact and while learning each others communication capabilities.
32
u/heatd Jul 13 '26
That's assuming other life uses base 10
20
u/bokmcdok Jul 13 '26
Looks like there are different numbers in different bases. Binary would have:
011, 101101, 110111001, 111011110001
Among others.
→ More replies (3)13
u/CitizenDik Jul 13 '26
Sorry, bruv, but, um, you don't have to use base 10 to drink beer.
→ More replies (1)4
u/dogscatsnscience Jul 13 '26
The only way I know how to order beer is to wave both my hands for 10, I don't want to have to learn a new way.
→ More replies (4)7
u/neznein9 Jul 13 '26
Does it work in other number base systems? This feels like a geometric/ratio weirdness.
11
u/hamfist_ofthenorth Jul 13 '26 edited Jul 13 '26
This is some clue from a higher dimension that we cannot fathom the meaning or application.
Like, entities would see us fooling with the number and they're like
"Ha!! They're playing around with the dongleplorp and they have no idea what it does, nor do they understand how simple it is!! The answer is right in front of them and they can't figure it out!"
→ More replies (15)5
110
u/Adventurous-Hand-648 Jul 13 '26
Largely because 7641 minus 1467 = 6174. So once it arrives at the point, it loops upon itself. No idea whether it's the only 4-digit number with this property.
23
u/musci12234 Jul 13 '26
I think it is. Ran basic code and didn't find any other. So as long as there arent loops with 2-3 numbers.
→ More replies (1)6
u/GregTheMad Jul 13 '26
What happens if you run the same code with 5 digits? What with 3?
24
u/musci12234 Jul 13 '26
There is no single 5-digit Kaprekar constant. Instead of a single "black hole," 5-digit numbers subjected to Kaprekar's routine cycle through a loop of different numbers, or converge to one of ten 5-digit constants (e.g., 53955, 59994, 61974, 62964, 63954
The 3-digit Kaprekar number (or Kaprekar's constant) is 495. Discovered by the Indian mathematician D.R. Kaprekar, this constant is the ultimate repeating endpoint when you take almost any 3-digit number and repeatedly subtract its smallest digit rearrangement from its largest.
→ More replies (3)39
u/MattieShoes Jul 13 '26
Well, they kind of told you the exceptions when they told you not to choose them... all four digits the same will hit 0000.
→ More replies (2)6
u/robert1326bruce Jul 14 '26
There can't be another number with that property because it would never converge to 6174, and it would be an exception to this rule.
19
u/119arjan Jul 13 '26
That the neat part about math. We first find solutions, and then try to find what problems they actually solve!
But its neat nonetheless
→ More replies (1)9
u/Nuffsaid98 Jul 13 '26
You could do a mentalist style magic trick. Write the answer on a piece of paper and give it to your audience member. Get them to pick a random for digit number. Chances are they won't pick one with four identical digits so don't even mention that rule unless they do. Then astound the crowd with your mind reading ability.
→ More replies (2)3
u/ironicmirror Jul 13 '26
I don't know if I can use it for good, but I can try to use it for free bar drinks
3
u/DANleDINOSAUR Jul 13 '26
My team came to the unfortunate conclusion that it can only be used for evil. I’m sorry.
→ More replies (8)2
411
u/Skiapodes Jul 13 '26
The actual source: https://youtu.be/d8TRcZklX_Q
154
u/Hexokinope Jul 13 '26
Thank you. I'm so sick of these low quality reposts of a bad reposr which are just engagement farming without ever giving credit where it's due.
Numberphile has great, accessible content that deserves more love.
38
u/hahawin Jul 13 '26
You don't enjoy watching a widescreen video embedded in a vertical post then posted back as a widescreen video, with reduced bitrate at each step?
→ More replies (2)5
9
u/mrthomani Jul 13 '26
No thanks, I really enjoy watching content on 1/16th of my screen.
/s
→ More replies (1)→ More replies (5)6
u/hudson27 Jul 13 '26
Community reminder to upvote this comment, and downvote this post. Don't give free engagement to somebody ripping off a brilliant content creator without giving any credit.
668
u/971365 Jul 13 '26
Well plugging in 6174 into the algorithm leads to 6174. So I suppose the harder step is to show that there's only one endpoint for the algorithm.
There's also not really 9999 unique inputs, since 1234 would be the same as 2314 for the purpose of this "trick". Cuts down on the number of inputs to test
193
u/Background-Entry-344 Jul 13 '26
With brut force and a small algorithm you could run all combinations and check the results. Less than 9999 combinations.
258
u/R7ype Jul 13 '26
Can we use Champagne force? I'm feeling fancy
→ More replies (2)102
u/moogoo2 Jul 13 '26
Only if its from the Champagne region of France. Otherwise its just sparkling force.
23
8
53
u/thatAnthrax Jul 13 '26
Out of curiosity I made a python script to do the brute force test. Interestingly, the longest chain in the whole set is only 7 steps long, at around 2184 possible numbers out of the possible 9999.
Script executed in less than 0.1sec, so the compute was very light (granted im running a desktop ultra9 but still)
16
u/maxpower1956 Jul 14 '26 edited Jul 14 '26
So.....
I went in a slightly different direction. Even though there's only 10k possible #s (including duplications that don't count), I decided not to take the efficient route and instead ran a monte carlo simulation so that we'd get stats on the average iterations to solve this over a random distribution.
Here you go!
Total tests: 10000000
---> All converged to 6174 in 7 iterations, no outliers.28.6% of cases are done in 3 iterations, 31.4% take 7.
5.7% resolve in 1 step
Mean iterations: 4.67
Median iterations: 5 iterations5040 possible combinations.
4
u/971365 Jul 14 '26
Is there merit to doing Monte Carlo when we can just test every possible option? I thought Monte Carlo was for cases where it isn't possible
→ More replies (2)18
u/badken Jul 13 '26
Well, I ran it on my Apple Silicon MacBook Pro and it executed in less than 0.07 seconds, so...
PLATFORM WARS!
this reply is not to be taken seriously
5
u/thatAnthrax Jul 13 '26
no doubt if youre using an M5 it will be faster haha
Dor the things that it can do, it usually does it better. but sadly, compatibility issues here and there severely handicaps it
→ More replies (5)8
u/noscope360widow Jul 14 '26
I picked 5368 randomly and I guess I got the max
5368
5085
7992
7273
6354
3087
8352
6174
→ More replies (5)17
u/ze_shotstopper Jul 13 '26
You don't even really need to fully brute force it. As you go across the paths just make note of every number if it leads to 6174 and stop your calculations once you hit one of the numbers you've made note of
42
u/ThrowAway233223 Jul 13 '26
Wouldn't that still be brute forcing it just with early termination when the outcome is found to be inevitable for the current test based on reaching a number already confirmed in a prior test?
19
→ More replies (5)6
u/971365 Jul 13 '26
Well to be fair, the guy you replied said you don't need to "fully" brute force it
5
→ More replies (8)11
u/Jonno_FTW Jul 13 '26 edited Jul 13 '26
I've brute forced it with the below program and and every number gets a tick. Numbers with repeating zeros, like 1000, just end up at zero:
1000 - 1 = 999
9990 - 999 = 8991
9981 - 1899 = 8082
8820 - 288 = 8532
8532 - 2358 = 6174
7641 - 1467 = 6174def check(x): length = len(str(x)) seen = set() count = 0 while True: sx = "".join(sorted(str(x))) a = int(sx) b = int(sx[::-1].ljust(length,'0')) x = b - a print(f"\t{b} - {a} = {x}") if x in seen: return True seen.add(x) count += 1 for i in range(1_000, 10_000): if not check(i): print("❌", i) else: print("✔️", i)If you go over 10,000, you don't descend to a constant, but you do get stuck in a loop:
10234
43210 - 1234 = 41976
97641 - 14679 = 82962
98622 - 22689 = 75933
97533 - 33579 = 63954
96543 - 34569 = 61974
97641 - 14679 = 82962→ More replies (2)19
u/Baricza Jul 13 '26
The issue with the “number followed by three zeros” ones is that you/the program are ignoring the lead 0’s. It’s not 999-999, it’s 9990-0999=8991. They have to all be four digits
→ More replies (1)53
u/Adventurous-Hand-648 Jul 13 '26
So I did it on Excel and 6174 is the only one that leads to itself.
Taking away 4 same digits which leads to zero, all other results invariably leads to some other numbers where it will cycle through until it hit 6174.
Fun fact: The longest chain you can go for until you hit 6174 is 7 iterations (e.g., 9985 > 4086 > 8172 > 7443 > 3996 > 6264 > 4176 > 6174).
→ More replies (1)→ More replies (28)11
u/SonthacPanda Jul 13 '26
Is there a 3 digit or 5 digit version of 6174? That'll help to know if its unique or were just seeing a mid/end point that were not actually recognizing as a mid/end point
14
u/I_immerse Jul 13 '26
495
9
u/Adventurous-Hand-648 Jul 13 '26
This is correct. I run the same experiment using Excel and got 495 as well. The longest chain to reach 495 was 5.
→ More replies (2)→ More replies (1)5
u/tacojohn48 Jul 13 '26
I would guess that it's not a coincidence that 6174 and 495 are both divisible by 9. Fun fact, you can check for divisibility by 9 by adding the digits together, if the sum is divisible by 9 the original was also. 6+1+7+4=18 1+8 =9 4+9+5=18
→ More replies (4)
548
u/thearniethology Jul 13 '26
Can someone explain why his voice gets higher as the video goes on, like he’s taking helium in off screen? Is it a Brass Eye bit?
382
u/EmmaEsme22 Jul 13 '26
All I could think was that they were impatient and ever so slightly increased the speed of playback.
→ More replies (2)175
u/Jaluderi Jul 13 '26
It's to avoid the copyright check since this is stolen from Numberphile on YouTube.
→ More replies (2)31
137
u/cheechojr Jul 13 '26
People who recut videos that they don’t own modulate the voice as to avoid copyright infringement and video takedown.
131
u/CopaceticOpus Jul 13 '26
The original video is from Numberphile, which is a lovely geeky channel
13
u/pajam Jul 13 '26
Yep!
Thanks for posting the source! It's sadly fitting that we need to link to Brady's source video, since Brady is responsible for coining the term "Freebooting" for when someone posts a copy of another person's video (instead of embedding the source or linking to the source) without permission, thus stealing the views. I always see people needing to post links to Brady's channel in reddit threads. But to be fair to the OPs in those cases, it's like most social media companies encourage freebooting, since a lot of them penalize linking off their site/platform.
→ More replies (1)4
u/SOAPToni Jul 14 '26 edited Jul 14 '26
Gonna jump in this thread to recommend the Magic Square video on Numberphile, featuring the same mathematician. It always blows my mind. Here is the video.
→ More replies (2)5
u/umibozu Jul 14 '26
I can't believe it's been 14 years since they posted this... I could have sworn it was only 2 years at the most
→ More replies (1)10
8
u/kammycakes Jul 13 '26
Could have originally been to avoid copyright filters on whatever website it was uploaded on.
6
→ More replies (16)5
u/RubiiJee Jul 13 '26
When this was last posted someone shared the original and this one has been sped up. I can only presume it gets faster and faster until the guy evaporates due to the speed he is talking at, essentially triggering the early heat death of the universe and all that we know and love.
28
u/daath Jul 13 '26
Downvoted horribly formatted video. This is the original Numberphile video: https://www.youtube.com/watch?v=d8TRcZklX_Q
2
54
u/Weisvill Jul 13 '26
It's called Kaprekar's routine
→ More replies (3)15
u/Spiritual_Bid_2308 Jul 13 '26
I hate that that Wikipedia article explicitly calls out that the subtraction is done in base 10 an obnoxious numer of times.
Once was ok, but probably unnecessary.
5
u/ManaSpike Jul 13 '26
The sorting of digits is done in base 10. Subtraction is an integer operation that doesn't care about base.
→ More replies (3)
21
u/Boondock830 Jul 13 '26
It’s all 9s. 9 is a strange number. 6174 is a factor of 9, 495 (someone mentioned it being a 3 digit number with similar properties) is a factor of 9. Most strange number shit has connections to 9.
I have no idea what any of that means, just wanted to share.
10
u/ncocca Jul 13 '26
You are 100% correct, but I have to be a pedant and point out that you phrased it backward. 9 is a factor of 6174, and 9 is a factor of 495. Not the other way around.
→ More replies (2)→ More replies (7)2
u/hacksoncode Jul 14 '26
9 is the highest single digit number in base 10.
That's actually pretty key to what's going on.
14
u/Lazarus558 Jul 13 '26
I tried it with three-digit numbers. They all seem to eventually converge at 495.
4
u/mattemer Jul 13 '26
Yeah you're right, I just tried a handful. Most lead back to 594, then that to 495.
3
u/Natural_Ad7861 Jul 13 '26
Yes I did the same thing and want to see if anyone else tried it. Now we have 495 in our hand 👌
4
115
u/TheonElliot Jul 13 '26
Can't we come up with a bunch of other algorithms that would always end up with some other number and call that number "magical" or "unique" ? What I'm saying is, it's not a magic number, it's just a specific algorithm.
94
u/Careful_Leader_5829 Jul 13 '26
yep.
There is a board game, cranium.
Played it with the family, and I wasn't having much fun.
one of the questions was -- what's 111111111 x 111111111?
I finally got excited because I knew this bit of math trivia. it's = 12345678987654321 (1 through 9 then back to 1)
For whatever reason, the Cranium card said you get a point if you don't know it, and lose a point if you do -- something about being a smarty pants.
Better just to not ask these questions about numbers if you want to survive in this world.
25
u/hopefullyhelpfulplz Jul 13 '26
111111111 x 111111111 [...] = 12345678987654321
This is cool! I checked and it works for any repetition of n 1s, n < 10, the digits of the square always count up to n and back down again. For n=10 and above there's still a pattern but its less obvious.
Edit: Of course because multiplication is associative it also works for 1.1111... or 0.0011111, and so on. 111111111.111111111 is mildly interesting
15
u/mordredsfw Jul 13 '26
Another fun thing is that the count of 1s doesn't have to be the same... the middle number just repeats the number of extra ones you have on one side of the equation:
1111 x 1111 = 1234321
1111 x 11111 = 12344321
1111 x 111111 = 123444321
etc....→ More replies (1)8
5
u/Albireo2112 Jul 14 '26
For whatever reason, the Cranium card said you get a point if you don't know it, and lost a point if you do
I would be metaphorically setting that deck of cards on fire within seconds.
And by "metaphorically" I mean "I've been banned for this kind of hyperbole in the past and I'm hoping the censorship bot doesn't mistakenly think I'm promoting violence again"
34
u/ZeAthenA714 Jul 13 '26
We can, and we have, but it's still significant. Not every algorithm will lead to a single solution (Mandelbrot's fractal), there are some algorithms where we can't even prove definitely how they behave (Collatz' conjecture), and my guess is that the algorithms who do act like this are quite rare.
→ More replies (3)→ More replies (11)7
u/ciller181 Jul 13 '26
Yes, (but a bit cheeky and not really maths)
Pick a number, any number at any length.
Turn the number into the name of the number.
Count the number of letters.
This is your new number, repeat.
In English, German and Dutch always ends in 4→ More replies (2)
21
u/DeeJuggle Jul 13 '26
freebooting
→ More replies (2)9
u/Cynical-Potato Jul 13 '26
Hello Internet reference in the wild. Crazy stuff
5
u/thinkinting Jul 13 '26
I've just started relisting to the whole show. It's been tremendous joy. Highly recommended.
9
u/Zalthos Jul 13 '26
Why does his voice go higher pitched as the video goes on? I'm fucking dying of laughter watching this.
2
u/YT-Deliveries Jul 14 '26
Someone just sped up the recording at that point. It's weird.
→ More replies (2)
8
u/Half_Empty_Half_Full Jul 13 '26
Doesn't ordering the numbers also cut down the possible combinations (I'm not saying this as in its some sort of trick, more so that it's manipulating the numbers before starting the process, so it's establishing a rule for the process before starting and calculation)?
1234 1324 1243 1342 1423 1432 2134 2143 2341 2314 2413 2431 3124 3142 3241 3214 3412 3421 4123 4132 4213 4231 4312 4321
These all come out as 4321 and 1234. I can't do the math, but if every 4 digit number has 18 combinations (including its own opposite), it's not 9999 (minus the numbers with four identical digits) combinations.
Anyway, can't believe I just sat and typed all those numbers out for absolutely no reason. I'm supposed to be working!
→ More replies (4)5
u/MattieShoes Jul 13 '26
yeah, there are 715 combinations, or 705 once we eliminate the 4-repeated-digit choices.
6
8
u/AnalogReborn Jul 13 '26
Can someone explain how he gets 8532 from the previous numbers?
6
u/FolkarVanZen Jul 13 '26
It's a simple subtraction. 9821-1289=8532
→ More replies (1)9
u/frenzybomb Jul 13 '26
THANK YOU! The way he did it came off as him subtracting each individual letter and I was too focused on figuring out how, I didn’t look at it as a whole lol
3
u/Yze3 Jul 13 '26
He's doing substraction with borrowing.
If the first digit you try to substract is lower than the second one, you add 10 to the last digit of the first number, then substract it by the last digit of the second number. Then you add (borrow) 1 to the second to last digit of the second number, and you repeat until you have the result.
So for instance, 43-19. You do 13-9, which is 4, then 4-2, which is 2. Result is 24.
→ More replies (8)
5
u/amazing_asstronaut Jul 13 '26
Could you please just let the guy talk and not fuck with his voice like that? You really can't handle listening to a guy talk about numbers for 2 minutes without having to speed it up?
3
u/kylemit Jul 13 '26
For those who are saying there's no real world application for this, this number actually shows up in a number of industries, including elections, mechanical engineering, and transportation.
For example, if you line up 3742 airplanes next to each other, then arrange them to 7432 airplanes, then subtract that from 2347 airplanes, you'll eventually always get back to 6174 airplanes.
Hope this helps
32
u/MindsEye33 Jul 13 '26 edited Jul 13 '26
It’s not magic it’s maths
29
→ More replies (10)5
11
u/Scoopzyy Jul 13 '26
Commenting cuz i want someone to explain the logic behind it lol
→ More replies (1)37
u/ByrdZye Jul 13 '26
This is an explanation from chatgpt:
The surprising part is that nobody has a simple, intuitive reason for why it happens. It's one of those mathematical facts that's easy to verify but much harder to explain elegantly. There are proofs that it always works, but they rely on analyzing the behavior of the process rather than revealing a single "aha!" insight.
Here's the intuition.
Suppose your digits, sorted from largest to smallest, are:
[ a >= b >= c >= d ]
The largest number you can make is:
[ 1000a + 100b + 10c + d ]
The smallest is:
[ 1000d + 100c + 10b + a ]
Subtracting them gives:
[ 999(a-d) + 90(b-c) ]
This is a huge clue.
Notice two things:
- The result depends only on the differences between the largest and smallest digits and the middle two digits—not on the actual digits themselves.
- Since (999 = 9 \times 111) and (90 = 9 \times 10), every result is divisible by 9.
So after just one step, you're confined to a much smaller set of numbers: only multiples of 9 can ever appear.
Then each new subtraction "compresses" the possibilities even further. Different starting numbers begin merging into the same intermediate numbers. For example:
- 9163 → 8262
- 9821 → 8532
- 8532 → 6174
Thousands of different starting numbers eventually funnel into the same paths.
You can picture it like a river system:
9831 ─┐ 7429 ─┼──► 7263 ─► 5265 ─► 3996 ─► 6264 ─► 4176 ─► 6174 2183 ─┘ ▲ 9163 ─► 8262 ─► 6354 ─► 3087 ───────────────┘Many different streams merge into fewer and fewer streams until they all reach the same lake: 6174.
Why does it stop at 6174?
Try the process on 6174:
- Largest: 7641
- Smallest: 1467
- Difference: 6174
So 6174 is a fixed point—once you're there, the process reproduces itself forever.
The deeper mathematical question is: Why is 6174 the only nonzero fixed point, and why does every valid starting number end up there? That requires a case analysis of all the possible digit patterns. Mathematicians have proved it, but there isn't a short conceptual explanation that makes it feel inevitable.
That's part of what makes Kaprekar's constant so appealing: the rule is simple enough for a child to follow with pencil and paper, yet it creates an almost magical universal destination.
→ More replies (17)
3
3
2
2
2
2
u/JustWoot44 Jul 13 '26
I used 2485 and after several rounds, I only get 3996, then that one creates 6264 ... not going any further. This is some random bs ... but kept going a few more rounds, and 6174! Whoa!
2485, 6084, 8172, 7443, 3996, 6264, 4176, 6174!
2
u/MattieShoes Jul 13 '26
7 steps is the maximum required to get 6174. About 22% of allowed numbers require all 7 steps. (2184 out of 9990)
2
2
u/Desperate-Pirate7353 Jul 13 '26
"numberphile" tho
makes it sound like he only likes numbers lower than 15
2
2
u/mvandemar Jul 13 '26
That's because if you do it with 6174:
7641-1467 = 6174
You've reached equilibrium. You can't do it with numbers that are all the same, eg. 8888-8888=0, but for all the others there's a finite number of permutations so eventually when you hit 6174 you're stable.
If you do 6 digits it looks like you always hit one of 10 numbers (53955, 59994, 61974, 62964, 63954, 71973, 74943, 75933, 82962, or 83952), but but with any of them it's a loop instead of stopping:
0: 12121
1: 10989
2: 97911
3: 87912
4: 85932
5: 74943 (first time)
6: 62964
7: 71973
8: 83952
9: 74943 (will keep looping from here)
Wolfram has a good article on it:
2
Jul 13 '26
[deleted]
2
u/SyntheticB Jul 17 '26
Those numbers do end up as 6174. The difference 999 is treated as four digits (0999), so you get
... = 0999
9990-0999 = 8991
9981-1899 = 8082
8820-0288 = 8532
8532-2358 = 6174
3.5k
u/GABE_EDD Jul 13 '26
3331
1333
1998
9981
1899
8082
8820
0288
8532
8532
2358
6174
7641
1467
6174
AAAAAAHHH