Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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
Javascript :: hostlistener 
Javascript :: Promise.all() with async and await 
Javascript :: Using fetch to upload files 
Javascript :: how to make an event listener only work once 
Javascript :: how to create a object in javascript 
Javascript :: es6 concat array 
Javascript :: change events 
Javascript :: how to get last item in array in javascript 
Javascript :: sticky sessions 
Javascript :: mongodb find and update one field 
Javascript :: circle progress bar react 
Javascript :: how to get the last element in javascript 
Javascript :: javascript unknown number of parameters 
Javascript :: how to select an adjacent element javascript 
Javascript :: mongoose patch document 
Javascript :: Create An Event With JavaScript 
Javascript :: onclose modal bootstrap 
Javascript :: how to append in javascript 
Javascript :: how copy url of page to clipboard javascript 
Javascript :: arrow function javascript 
Javascript :: javascript math ceiling function 
Javascript :: Modal dismiss react native by click outside 
Javascript :: Check if instance is array 
Javascript :: chrome extension onclick not working 
Javascript :: get largest no in the array javascript 
Javascript :: shuffle array 
Javascript :: export json / array to excel in javascript 
Javascript :: String operators in JavaScript 
Javascript :: no internet connection html page 
Javascript :: express mysql sessions 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =