POV-Ray : Newsgroups : povray.off-topic : Some math problems : Re: Some math problems Server Time
5 Sep 2024 09:24:33 EDT (-0400)
  Re: Some math problems  
From: Warp
Date: 23 Sep 2009 15:18:32
Message: <4aba7488@news.povray.org>
Neeum Zawan <m.n### [at] ieeeorg> wrote:
> On 09/22/09 15:44, clipka wrote:
> > Thus, the number of trailing zeros can be expressed as:
> >
> > floor(n/5) + floor (n/(5^2)) + floor(n/(5^3)) + ...
> >
> > which is a perfectly valid, non-recursive (albeit infinite) mathematical
> > formula for the desired thing. (Unfortunately the floor() function

>         While he didn't state it in his original phrasing, he meant closed form.

  If we allow recursive functions, then the simplest answer would be:

f(0) = 0
f(n) = floor(n/5) + f(floor(n/5))

-- 
                                                          - Warp


Post a reply to this message

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