Fibonacci Cube Graph | function to find fibonacci number ; function for finding number of vertices in fibonacci cube graph ; return fibonacci number for f ( n + 2 ) ; driver program
function fib ( n ) { if ( n <= 1 ) return n ; return fib ( n - 1 ) + fib ( n - 2 ) ; } function findVertices ( n ) { return fib ( n + 2 ) ; } var n = 3 ; document . write ( findVertices ( n ) ) ;