rename statics/euler and sync b93 code with main repo
This commit is contained in:
13
www/statics/euler/Euler_Problem-092_explanation.md
Normal file
13
www/statics/euler/Euler_Problem-092_explanation.md
Normal file
@@ -0,0 +1,13 @@
|
||||
My approach to this problem is pretty crude. Perhaps I will later come back and try to find a better algorithm.
|
||||
Currently we iterate (brute-force) through all possible numbers and count the chains that end with one.
|
||||
The `next()` function is implemented like this:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
0\>:55+%:*\ :#v_$$
|
||||
^/+55g05+p05<
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
We also remember in an 8x71 cache all previously found numbers so we can abort some sequences before we reach `1` or `89`.
|
||||
This is the main optimization from pure brute-force in this program.
|
||||
|
||||
We can prove that an 568-element cache is enough because no number in the sequence (except the first) can be greater than `9^2 * 7` (` = 567`)
|
||||
Reference in New Issue
Block a user