We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Figured this one out, but I have an odd solution. I wonder if anyone else used the same method. I suspect there is a simpler solution that I am missing.
The value of sum can be obtained by direct formula with Fibonacci number - that's the approach that I've submitted (fib has Pisano period, so it's like O(log(n%1e10)). Genertally I wouldn't call this approach easy.
Another option I see is to express sum in terms of few previous sums (recurence) and use fast matrix exponentiation - this sounds like no brainer.
There seems to be a typo, either G2 is 1 or series Ag(1/2) is wrong. If I am to use the provided Gk series (1,4,5,9,14,...), Ag(1/2) is larger than 2 from the first 3 terms.
hey can anyone tell me where i am wrong https://www.mathblog.dk/project-euler-137-fibonacci-golden-nuggets/
How to solve the diophantine equation x^2-5*y^2=d???
Are there any additional restrictions on T, L, and R for the final test case?
Figured this one out, but I have an odd solution. I wonder if anyone else used the same method. I suspect there is a simpler solution that I am missing.
The value of sum can be obtained by direct formula with Fibonacci number - that's the approach that I've submitted (fib has Pisano period, so it's like O(log(n%1e10)). Genertally I wouldn't call this approach easy.
Another option I see is to express sum in terms of few previous sums (recurence) and use fast matrix exponentiation - this sounds like no brainer.
There seems to be a typo, either G2 is
1
or seriesAg(1/2)
is wrong. If I am to use the providedGk
series (1,4,5,9,14,...),Ag(1/2)
is larger than2
from the first 3 terms.From the table below,
Ag(1/2)
is5
. Ag(1/2) is a copy of Af(1/2) if project euler 137. This is wrong Ag is not equal to Af.Sorry for the confusion. I removed the "Surprisingly" part. You're correct. It was mistakenly copied from #137.