I wonder if there’s a simple worst-case proof that shows how complicated you need to let the seeds get in order to find the actual optimum. For example, if we look for the best integer under 10^85 rather than under 10^100, the seed that leads to this algorithm outputting the optimum is different, or at least the overlap seems small. But I’m having a hard time proving anything about this algorithm, because although small seed numerators could add up to almost anything, in practice they won’t.
Whaaa? I checked that. But you’re right. The last digit should simply not be there. I don’t know how that happened; presumably a bug in my convert-number-to-English-digit-names one-liner. Sorry.
Yeah. A bug in conversion to English digits, I think. (Unfortunately it was throwaway code in a now-closed window so I can’t check exactly what stupid thing I did.)
Funnily enough, I didn’t even write any code. Just figured out that I need a 100-digit numerator of a continued fraction convergent of pi, then found it on OEIS.
Ha! I can never remember which sorts of best approximation are guaranteed to be actual c.f. convergents and which might be “intermediate” ones that come from iterating the mediant construction. So I used PARI’s “bestappr” function. My bug was in code that had nothing to do with the actual mathematics.
Zvavzvmvat |fva(a)| vf rdhvinyrag gb zvavzvmvat |a-s(a)| jurer s(a) vf gur arnerfg zhygvcyr bs cv gb a; rdhvinyragyl, gb zvavzvmvat |a-z.cv| jurer a,z ner vagrtref naq 1<=a<=10^100; rdhvinyragyl, gb zvavzvmvat z|a/z-cv| jvgu gur fnzr pbafgenvag ba a. (Juvpu vf boivbhfyl zber be yrff rdhvinyrag gb fbzrguvat yvxr z<=10^100/cv+1.)
Gurer’f n fgnaqneq nytbevguz sbe guvf, juvpu lbh pna svaq qrfpevorq r.t. urer. V guvax gur erfhyg unf gur sbyybjvat qvtvgf:
bar fvk frira mreb svir gjb frira svir avar fvk guerr svir bar svir fvk svir bar svir fvk frira svir sbhe svir avar rvtug svir avar fvk bar bar mreb frira sbhe svir fvk fvk sbhe avar svir svir svir mreb frira guerr fvk gjb guerr bar guerr avar guerr rvtug bar rvtug rvtug rvtug svir avar mreb gjb frira bar mreb fvk gjb avar guerr frira rvtug sbhe svir gjb mreb avar svir gjb gjb avar svir mreb frira gjb sbhe mreb mreb rvtug gjb frira fvk bar frira svir fvk avar sbhe sbhe sbhe mreb fvk guerr
I wonder if there’s a simple worst-case proof that shows how complicated you need to let the seeds get in order to find the actual optimum. For example, if we look for the best integer under 10^85 rather than under 10^100, the seed that leads to this algorithm outputting the optimum is different, or at least the overlap seems small. But I’m having a hard time proving anything about this algorithm, because although small seed numerators could add up to almost anything, in practice they won’t.
To paraphrase Walter White—Say its (decimal) name!
It’s very long. I think just giving the sequence of digits is clearer.
SIN(your number)=0.879....
Then I goofed. Correction will follow shortly once I work out what ridiculous thing I did.
OK, I think what I meant was: frira fvk svir bar svir mreb gjb frira guerr sbhe rvtug frira frira bar sbhe svir sbhe sbhe gjb svir frira fvk bar gjb avar rvtug rvtug gjb gjb rvtug mreb bar sbhe svir avar avar frira guerr avar avar svir guerr guerr avar fvk sbhe avar avar bar fvk bar rvtug gjb rvtug frira bar bar svir sbhe mreb svir svir sbhe guerr guerr gjb gjb bar fvk mreb rvtug gjb sbhe frira svir guerr rvtug guerr sbhe svir fvk sbhe avar gjb bar avar guerr mreb mreb guerr rvtug rvtug svir svir svir fvk mreb sbhe frira rvtug avar.
Nope. Your number is too big. Bigger than 10^100.
Whaaa? I checked that. But you’re right. The last digit should simply not be there. I don’t know how that happened; presumably a bug in my convert-number-to-English-digit-names one-liner. Sorry.
… which agrees with cousin_it’s answer; I promise I didn’t cheat :-).
I think you have one extra digit at the end.
Yeah. A bug in conversion to English digits, I think. (Unfortunately it was throwaway code in a now-closed window so I can’t check exactly what stupid thing I did.)
Funnily enough, I didn’t even write any code. Just figured out that I need a 100-digit numerator of a continued fraction convergent of pi, then found it on OEIS.
Ha! I can never remember which sorts of best approximation are guaranteed to be actual c.f. convergents and which might be “intermediate” ones that come from iterating the mediant construction. So I used PARI’s “bestappr” function. My bug was in code that had nothing to do with the actual mathematics.
Congratulations to you, too!