Good4lien / Fibonacci

Fibonacci numbers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image

Fibonacci numbers

Fibonacci numbers, commonly denoted Fn , form a sequence, the Fibonacci sequence, in which each number is the sum of the two preceding ones. The sequence commonly starts from 0 and 1, although some authors start the sequence from 1 and 1 or sometimes (as did Fibonacci) from 1 and 2. Starting from 0 and 1, the first few values in the sequence are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.

Definition

image
and
image
for n > 1.
Under some older definitions, the value image is omitted, so that the sequence starts with image and the recurrence image is valid for n > 2.

The first 20 Fibonacci numbers Fn are:

4

Here is my python code

Code:

1

Resoult:

2

...

3

About

Fibonacci numbers


Languages

Language:Python 100.0%