Greg_Deckler's avatar
Greg_Deckler
Community Champion
8 years ago

Fibonacci

Takes a single input, "n", where "n" is the nth Fibonacci number. 

 

 

Fibonacci = 
VAR n = MAX(<"n">)
VAR GoldenRatio = (1+SQRT(5))/2
VAR Part1 = POWER(GoldenRatio,n)
VAR Part2 = POWER(-1*DIVIDE(1,GoldenRatio),n)
VAR Numerator = Part1-Part2
VAR Denominator = SQRT(5)
RETURN DIVIDE(Numerator,Denominator)