EyeNewz Tech Get the app

Geeksforgeeks · Technology

Fibonacci Expression

Given a number n, evaluate the following expression. f(n-1)*f(n+1) - f(n)*f(n) where f(n) is the n-th Fibonacci number with n >= 1. Fibonacci Sequence is 0, 1, 1, 2, 3, 5, 8,13,... (here 0 is the 0th Fibonacci number).Examples:Input: n = 1Output: -1Explanation: f(n+1)*f(n-1) - f(n)*f(n) = 1*0 - 1*1 = -1.Input: n = 2Output:

Read original Open in app

Licensed summary · LicensedSummary