Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Euler problem #25

0 views
Skip to first unread message

Anton Ertl

unread,
May 5, 2008, 11:48:26 AM5/5/08
to
|What is the first term in the Fibonacci sequence to contain 1000 digits?

They only want the index.

I used the formula of Moivre-Binet (and ignored the (1/phi)^n part):

5e fsqrt 1e f+ 2e f/ fconstant phi
999e 5e fsqrt flog f+ phi flog f/ f>d 1. d+ d.

Quite short compared to some of the stuff posted in the forum.

The 1. D+ is there to simulate rounding up (we don't want the last
term below, but the first term above).

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2008: http://www.complang.tuwien.ac.at/anton/euroforth/ef08.html

0 new messages