EyeNewz EyeNewz

Home / Headlines

Fibonacci Expression

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