In the sequence above, we see that each term is the product of the previous term's digits. We say the persistence of 1476 is 4 because it take this process 4 steps to reach a single digit number.
What is the smallest positive integer whose persistence is equal to 7?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We can write some Python code to solve this via brute force in about 0 . 6 seconds.
While this works, there may be better ways to approach this computationally. For example, we might want to use memoization to avoid making the same computations over and over. How much would this improve our runtime? What else can we do to improve this solution in terms of either speed or memory used?