1
$\begingroup$

How to compute $n$-th element in golomb's sequence? I've found that $A_n$ is approximately: $\phi^{2-\phi} * n^{\phi-1},\;\; \text{ where }\;\; \phi \;\;\text {is golden ratio}.$

As far as I checked with my python and C++ program it gives right answers for low numbers, but for high numbers like $10^9$ or $10^{18}$ it's totally wrong.

Is there another solution without computing so many numbers (even to $10^{18}$)?

Chris

  • 0
    python easily handle big ints, so i don't think this is the reason. Difference between big numbers as 10^9 is ~100.2011-06-13

0 Answers 0