|
|
Tim Attwood wrote:
> I'm mostly stalled at 43%, I've seen several
> problems that are easy enough to express
> solutions to that are none-the-less difficult
> to compute in any reasonable amount of time.
Some of the questions state an iterative problem for which there is a
direct solution.
For instance, the second problem looks iterative, but there is a direct
formula for any member of the Fibonacci series, there is a direct
formula for the sum of a power series, and the even-valued members of
the Fibonacci series occur at every third position starting with 0.
When you put that together, the sum is
(1/sqrt(5) * ( (phi^(n+3)-1)/(phi-1) - ((1-phi)^(n+3)-1)/(1-phi-1) )
where n is equal to the index of the highest even-valued member of the
Fibonacci series that is below one million. It turns out that n is 30
in this case, and therefore the sum is 5702886.
Regards,
John
Post a reply to this message
|
|