Re: Fibonacci[1,000,000,000] contains 208,987,640 decimal digits

From: Michael Taktikos (michael.taktikos_at_hanse.net)
Date: 08/11/04


Date: Wed, 11 Aug 2004 15:08:36 +0200


"Fred the Wonder Worm" <ftww@maths.usyd.edu.au> wrote:

> > [...] The version I would use (for n > 0) is:
> >
> > Ceiling(n*Log[10](phi) - Log[10](Sqrt(5)))
> >
> > where phi = (1 + Sqrt(5))/2.

> A slight correction to my post. I have used 'n' with two different
> meanings, right next to each other even. :( In the formula and the
> 1/phi^n comment it is intended to refer to the index of the Fibonacci
> number being computed; the other uses were for the sequence index,
> where n corresponds to the 10^n th Fibonacci number (and thus 10^n
> in the formula).

No problem, after "translating" the formula as Mathematica function

fredsFormula[n_] := Module[{phi = (1 + Sqrt[5])/2},
    Ceiling[n*Log[10, phi] - Log[10, Sqrt[5]] ]]

and testing it against the others it found the same results, but for very
large n,
the calculation of Sqrt[5] needs a higher than the standard precision, and
then
this function will be not so fast as the fastest until now mentioned in this
thread,

Round[(2*n*ArcCsch[2] + Log[2])/Log[100]]

Greetings,

Michael Taktikos