Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Fibonacci numbers

0,1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,.....
Comment

Fibonacci number

def fibonacciVal(n):  if n == 0:    return 0  elif n == 1:    return 1  else:    return fibonacciVal(n-1) + fibonacciVal(n-2)
Comment

fibonacci numbers

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
Comment

fibonacci numbers

0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
17711
28657
46368
75025
121393
196418
317811
514229
832040
1346269
2178309
3524578
5702887
9227465
14930352
24157817
39088169
63245986
Comment

Fibonacci numbers

function Fibonacci(num){
	        var before = 0;
	        var actual = 1;
	        var next = 1;

	        for(let i = 0; i < num; i++){
		        console.log(next)
		        before = actual + next;
		        actual = next
		        next = before
	        }
        }

        Fibonacci(100);
Comment

Fibonacci numbers

python fibo.py <arguments>
Comment

fibonacci numbers

f(n) = f(n-1) + f(n-2) 
                                  f(6)
                                   ^
  			                       /
                f(5)               +                       f(4)
                ^
               /                                           /
                
        f(4)    +           f(3)                     f(3)    +    f(2)
       ^                       ^                     ^              ^
      /                       /                    /            /
   
 f(3)   +       f(2)            f(2) +f(1)       f(2) + f(1)   f(1) +  f(0)             
   ^              ^                ^                ^
   /             /                /              /
    
f(2) + f(1)      f(1) +  f(0)     f(1)+ f(0)       f(1) + f(0)         
  ^
  /
f(1) +  f(0) 
  
//f(6) = 8   ==>  f(1)*8    f(1) appears 8 times 
 double feb  = (1/Math.pow(5,0.5)) * (Math.pow((1+Math.pow(5,0.5))/2,n)) - (1/Math.pow(5,0.5))* (Math.pow((1-Math.pow(5,0.5))/2,n));  
  
f(1) == 1;   
  
  
  
  
  
  
  
Comment

PREVIOUS NEXT
Code Example
Python :: precision and recall from confusion matrix python 
Python :: vscode in browser github 
Python :: cv2 read rgb image 
Python :: install json on python 
Python :: turtle with python 
Python :: python png library 
Python :: docker build python fastapi 
Python :: python crear dataframe 
Python :: encryption using python 
Python :: fill a column based on values in another column pandas 
Python :: python squared math function 
Python :: tkinter treeview clear 
Python :: csv to python dictionary 
Python :: get the list of column names whose data type is float python 
Python :: how to open folder in python 
Python :: unsupervised learning 
Python :: dropna pandas 
Python :: Select an element of a list by random 
Python :: hugingface ner 
Python :: gaussian filter 
Python :: pandas read_excel 
Python :: python single line if 
Python :: what does % do in python 
Python :: optimizationed bubble sort optimizationed 
Python :: data where values in column starts with particular value 
Python :: python convert list of lists to array 
Python :: Check status code urllib 
Python :: pandas dataframe display cell size 
Python :: run multiple test cases pytest 
Python :: matplotlib remove duplicate legend entries from plotting loop 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =