F(n) = F(n−1) + F(n−2)

Compute the n-th Fibonacci number and the sequence up to that term.

📐 計算公式
斐波那契數列第 n 項(本頁程式碼口徑):自 a=0、b=1 用 BigInt 精確迭代 n 次(t=a+b; a=b; b=t),取 a 即 F(n)(F(0)=0、F(1)=1)。聯動量:後繼比值 F(n+1)÷F(n)=b÷a(n=0 時 a=0,比值無定義)、ln F(n)(F(0)=0 時無定義)。校驗:n 必須為非負整數,空值、小數、負數報錯;為保證效能上限 1000,超限明確報錯而非靜默截斷。判據:無固定分級,後繼比值隨 n 增大收斂黃金分割比 ≈1.618034;大整數完整展示,不再受雙精度 2⁵³ 限制。

迭代計算斐波那契數列第 n 項。

📌 計算說明
  • F(0)=0, F(1)=1。
  • F(20) = 6765。