; This Mathomatic input file contains the mathematical formula to
; directly calculate the "n"th Fibonacci number,
; from the endless integer sequence:
; 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 ...
;
; Any Fibonacci number is always the sum of the previous two Fibonacci numbers.

phi = (1 + (5^(1/2)))/2 ; the golden ratio constant
fibonacci = ((phi^n) - ((1 - phi)^n))/(5^(1/2))
eliminate phi ; Fibonacci formula:
simplify ; Note that Mathomatic rationalizes the denominator here.
