POV-Ray : Newsgroups : povray.off-topic : Project Euler : Re: Project Euler Server Time
11 Oct 2024 05:18:52 EDT (-0400)
  Re: Project Euler  
From: John VanSickle
Date: 25 Nov 2007 13:15:54
Message: <4749bbda$1@news.povray.org>
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

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