3 ms·
Well, there's a closed formula right? I wonder if it's faster to carry out the computation in Z[sqrt(5]).
by qsort 1y ago
Well, there's a closed formula right? I wonder if it's faster to carry out the computation in Z[sqrt(5]).
- seanhunter 1y agoYes. Binet’s formula https://mathworld.wolfram.com/BinetsFormula.html https://mathworld.wolfram.com/BinetsFormula.html
- qsort 1y agoYeah, there's a similar formula for all homogeneous linear recurrences if I'm not mistaken, but you can't evaluate it naively with floating point arithmetic. We can view (1 + sqrt(5)) and (1 - sqrt(5)) as elements of Z[sqrt(5)] though. It's probably extremely annoying to write because you have to implement the arithmetic operations in that field, but it wouldn't surprise me if it had faster runtime. Probably Claude can do it? Maybe I'll give it a try later :)
- meindnoch 1y agoGood luck calculating (1+sqrt(5))^n in Z[sqrt(5)].