[Python] [5] [demo experimental practice examples] [Print Fibonacci number]

Fibonacci columns description:

Fibonacci number (Fibonacci sequence), also known as golden columns, because mathematician Leonardo Fibonacci (Leonardoda Fibonacci) as an example to the rabbit breeding and the introduction, it is also known as the " Rabbit series ," referring to such a series is: 1,1,2,3,5,8,13,21,34, ...... mathematically, Fibonacci numbers are listed in the following recursive method is defined: F (1) = 1, F (2) = 1 , F (n) = F (n-1) + F (n-2) (n> = 3, n∈N *) the fields of modern physics, quasi-crystalline structure, chemistry, etc., fibonacci numbers have a direct application, for which the American mathematical Society published a mathematics magazine "fibonacci Quarterly" in the name since 1963, is devoted to research in this area.

 

Relations with golden

Interestingly, this is a completely natural number series of general term formula is used irrational numbers to express. And when n tends to infinity, with an odds before getting an approximation of the golden section 0.618 (a ratio of a fractional part of the closer and closer to the front or rear 0.618).
1÷1=1,1÷2=0.5,2÷3=0.666...,3÷5=0.6,5÷8=0.625…………,55÷89=0.617977……………144÷233=0.618025…46368÷75025=0.6180339886…...
More to the back, the ratio is closer to the golden ratio.

 

 

 

 

 
 My source code:

 

#!/usr/bin/python
# encoding=utf-8
# -*- coding: UTF-8 -*-

# Fibonacci number 
# prints the Fibonacci column 
L = []
l.append(1)
l.append(1)
for i in range(2,300):
    l.append(l[i-1]+l[i-2])
    print(l)
    
    

 

result:

 

 

 

Several original title given implementation:

 

 

 

 

 

 

-------- (I am dividing line) --------

reference:

1. RUNOOB.COM  : https://www.runoob.com/python/python-exercise-example6.html

2. Baidu Encyclopedia: https://baike.baidu.com/item/%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E6%95%B0%E5% 88% 97/99145? fr = aladdin

 

Remarks:

Initial modified: September 24, 2019 12:16:20

Environment: Windows 7 / Python 3.7.2

 

Guess you like

Origin www.cnblogs.com/kaixin2018/p/11577659.html