Fibonacci Calculator

Fibonacci Sequence Generator

to

How the Fibonacci Calculator Works:

With this tool:

  • Single Fibonacci Number Calculation: You can compute the Fibonacci number for a given n.
  • Fibonacci Sequence Calculation: You can generate a sequence of Fibonacci numbers between two values, n1 and n2.
  • The calculator supports numbers in the range of -200 to 200 for n.

Fibonacci Formula:

For positive values of n, the Fibonacci sequence is defined recursively by the following relation:

Fn=Fn1+Fn2F_{n} = F_{n-1} + F_{n-2}

where the initial values are:

F0=0andF1=1F_0 = 0 \quad \text{and} \quad F_1 = 1

For negative values of n, the Fibonacci sequence is defined as:

Fn=(1)n+1FnF_{-n} = (-1)^{n+1} F_{n}

This ensures that the Fibonacci sequence maintains its recursive structure but alternates in sign for negative values of n.

Examples

  1. Single Fibonacci Number Calculation:

    • Input: n=10n = 10
    • Formula: F10=F9+F8F_{10} = F_9 + F_8
    • Calculation: F9=34,F8=21soF10=34+21=55F_9 = 34, \quad F_8 = 21 \quad \text{so} \quad F_{10} = 34 + 21 = 55
    • Result: F10=55F_{10} = 55
  2. Fibonacci Sequence Calculation:

    • Input: n1=4n_1 = 4, n2=7n_2 = 7
    • Formula for each Fibonacci number: F4=F3+F2=2+1=3F_4 = F_3 + F_2 = 2 + 1 = 3F5=F4+F3=3+2=5F_5 = F_4 + F_3 = 3 + 2 = 5F6=F5+F4=5+3=8F7=F6+F5=8+5=13
    • Result: F4=3,F5=5,F6=8,F7=13
    • Sequence: 3,5,8,133, 5, 8, 13
  3. Negative Fibonacci Number Calculation:

    • Input: n=5n = -5
    • Formula: F5=(1)5+1F5=1×5=5
    • Result: F5=5F_{-5} = -5

Key Features:

  1. Custom Result Format: You can format the Fibonacci sequence as a table, list, or separated by commas, spaces, or new lines.
  2. Thousands Separator: For large Fibonacci numbers, separators (such as commas or periods) can be applied to enhance readability.

Quick Tips:

  • Range for n: Input values must be between -200 and 200.
  • Sign of Negative Fibonacci Numbers: Negative Fibonacci numbers alternate in sign, following the formula for FnF_{-n}.
Advertisements