Geeksforgeeks · Technology · 2026-08-16
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 on Geeksforgeeks Get the app
Licensed summary · LicensedSummary
Related briefs
- HMD 2760 Flip design and key specs leak, said to run Android 13 Go
- Samsung Announces Partnership With Call of Duty®: Modern Warfare® 4
- This Vivo Y Series Will Launch in India Soon: See Full Specifications List
- These Vivo Y Series Phone Are Now More Expensive in India
- Is the ‘Ultra’ Era Ending? Xiaomi 18 Ultra Reportedly Scrapped