POV-Ray : Newsgroups : povray.off-topic : Small math/programming problem : Re: Small math/programming problem Server Time
16 Jun 2024 20:16:08 EDT (-0400)
  Re: Small math/programming problem  
From: Kevin Wampler
Date: 2 Jul 2010 00:11:41
Message: <4c2d66fd@news.povray.org>
Kevin Wampler wrote:
> 
> Now for a tricker question, say I add another loop:
> 
> n = 2
> for(a = n; a > 0; a--)
>   for(b = n; b > 0; b--)
>     for(c = n; c > 0; c--)
>       for(d = n; d > 0; d--)
>         for(e = n; e > 0; e--)
>           n++
> print n
> 
> What are the last five digits printed?
> 

Ok, I haven't been able to post today since I've been on airplanes on or 
airports without wireless the whole time, but I implemented the solution 
and it seems to work, so this problem is totally solvable, and only 
takes a fraction of a second on my computer.

It turns out that the solution is actually quite simple too!  Possibly 
even more so than that to the last puzzle -- although certainly not as 
mathematically concise.

Actually pretty fun, so feel free to give it a shot knowing that it does 
indeed have a relatively simple solution!


Post a reply to this message

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