From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,55603c56db8d8307 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-19 22:15:02 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!firth From: firth@sei.cmu.edu (Robert Firth) Subject: Re: Fibonacci Numbers? Message-ID: <1994Sep19.075720.22683@sei.cmu.edu> Sender: netnews@sei.cmu.edu (Netnews) Organization: Software Engineering Institute References: <35fl28$1h3@garuda.csulb.edu> Date: Mon, 19 Sep 1994 07:57:20 EDT Date: 1994-09-19T07:57:20-04:00 List-Id: In article <35fl28$1h3@garuda.csulb.edu> zoltan@csulb.edu (S. Hegede) writes: >Hey! I'm an a beginning Ada programmer and I've been stuck for a while >on trying to write a program in which a user can get the number in a >Fibonacci series( Ex. 1,1,2,3,5,8,13,21...) by typing its position in >the series. I only need help on getting the formula down that would >calculate the next number in the series. Thanks for the help. F0 = 0; F1 = 1; Fn = Fn-1 + Fn-2 There's also a closed form, but since it involves exponentiation of real numbers it's probably faster to compute via the recurrence formula.