POV-Ray : Newsgroups : povray.off-topic : Project Euler : Re: Project Euler Server Time
11 Oct 2024 13:15:01 EDT (-0400)
  Re: Project Euler  
From: John VanSickle
Date: 27 Nov 2007 17:38:12
Message: <474c9c54@news.povray.org>
John VanSickle wrote:
> 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) )

It turns out that this formula is wrong.  The correct formula is:

1/sqrt(5) *
  ( (phi^(n+3)-1)/(phi^3-1) - ((1-phi)^(n+3)-1)/((1-phi)^3-1) )


Regards,
John


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.