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。