What's special about 277777788888899? - Numberphile
Why Stack Overflow recommends it
Stack Overflow users link it as the source of their persistence-calculating code, or to explain what multiplicative persistence is when asking about their implementations.
Recommended by 0 people across 0 different months, 2019 to 2023.
What it is
A Numberphile episode in which Matt Parker explains multiplicative persistence, the number of times you multiply a number's digits together before reaching a single digit, and why 277777788888899 holds the known record for its size. He writes short Python code on screen to compute it.
Cited in 1 Wikipedia article, including Multiplicative digital root.
What people said
Cites Sam · 2019-04 · Stack Overflow · on “Why isn't vector.clear() working while in a loop?”
I am trying to create an application to calculate multiplicative persistence, like in this video: [this video] . However my problem is that it does not appear that my vector is being cleared during iterations of the while loop. Which means the output produced is growing exponentially instead of working down to 0. I am very new to coding c++ so any feedback would be appreciated. std::vector<int> per; int input; int result; int new_total = 1; int loop_total; std::cin >> input; //Moving the user input into a vector while (input > 0) { result = input % 10; input = input / 10; per.push_back(result); } //loops to multiply new sets of numbers together until "new_total" is 0 while (new_total > 0) { for (
Cites Ralph Louie O. Gatan · 2019-04 · Stack Overflow · on “multiplicative persistence in python”
I have one simple working def per(n,steps=0): if len (str(n))==1: print(n) print "TOTAL STEPS" + str(steps) return "DONE" steps += 1 digits = [int(i)for i in str(n)] result = 1 for j in digits: result *= j print(result) per(result,steps) per(277777788888899) This one is a basic manually edited input function. The function is only there to be a sort of input since the code itself is 'unneeding' of a more complex and ready-to-use method due to the fact it is live editing as shown in the video. The actual calculation process happens in steps += 1 digits = [int(i)for i in str(n)] result = 1 for j in digits: result *= j Don't rely on the first part of the code since the actual process is in the s
Cites Antoni Parellada · 2019-05 · Stack Overflow · on “What is in the meaning of `return "DONE"` at the end of a function in Python?”
For context, this code is written on a video within the channel Numberphile by Matt Parker [this video] talking about multiplication persistence. The code is written in Python 2, and my question is about the line return "DONE" . Evidently, this prevents an infinite loop from being generated, as it is clear running an example (below) with and without that line: def per(n, steps = 0): if len(str(n)) == 1: print "TOTAL STEPS " + str(steps) return "DONE" steps += 1 digits = [int(i) for i in str(n)] result = 1 for j in digits: result *= j print result per (result, steps) per(27) # 14 # 4 # TOTAL STEPS 2 Now, the same code without the line return "DONE" would not end the loop, and yield: 14 4 TOTAL STE
Cites Josh · 2023-06 · Stack Overflow · on “Strange RETURN behavior in Javascript logging to the console”
I am trying to return an output inside an if() statement in my function and have it logged to the console; however, the returned output is not being displayed in the console. I recently watched Numberphile's video on Multiplication Persistence [this video] and I thought it would be fun to try and write the function that he uses in the video to calculate the the persistence for a given number. I am coding in Javascript on replit. while doing so I found a strange behavior to my function and I was hoping someone could explain why this is happening? to explain: you can log the return statement of a function by calling the function inside console.log function logger () { return "this string will be lo
Cites Mark Gyomory · 2023-07 · Stack Overflow · on “How to have multipe threads write to a file at the same time?”
After watching a numberphile about persistence of a number, I decided to code it up. When I was doing it iteratively with a single core and saving the answers in a list running out of ram quickly because a problem so after the function ran I had it write directly to a file. After seeing taking a long time I decided to have it run multi core, however I knew ram was still going to be a problem so I would like it to keep writing directly to a file with the number and count of the persistence of the number. I know that not all the numbers will be in order, but I will deal with that later. Currently I would like for the code just to write everything to the file. Here is my code, I know it is a bi