在斐波那契数列中,fib(0)是0还是1? [英] In the Fibonacci sequence, is fib(0) 0 or 1 ?

查看:280
本文介绍了在斐波那契数列中,fib(0)是0还是1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将fib(0)定义为= 1时在一个主题中执行任务.但这不对吗? fib(0)是0吗?

I'm doing a task in a subject were fib(0) is defined to = 1. But that can't be right? fib(0) is 0?

Program with fib(0) = 1; spits out fib(4) = 5
Program with fib(0) = 0; spits out fib(3) = 3

正确的定义是什么?

推荐答案

您在正确. 斐波那契序列的定义是种子值fib(0) = 0fib(1) = 1.这是要求其余序列正确(并且不能偏移一个或任何东西)的要求.

You're correct. The Fibonacci sequence is formally defined with seed values fib(0) = 0 and fib(1) = 1. This is a requirement for the rest of the sequence to be right (and not offset by one or anything).

在数学中,通常称为F_n的斐波那契数形成一个称为斐波那契数列的序列,这样每个数都是从0和1开始的两个前一个数的和.

In mathematics, the Fibonacci numbers, commonly denoted F_n, form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1.

在数学中,通常用Fn表示的斐波那契数形成一个称为斐波那契数列的序列,这样每个数都是从0和1开始的两个前一个数的总和.

In mathematics, the Fibonacci numbers, commonly denoted Fn, form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1.

我不得不承认,还有另一种方法(很少见,通常是非正式的)通过将值1和1植入种子来定义序列,但这不是常规的方法.以任何方式.在我所见过的所有形式化数学定义中,当然都不推荐使用它,例如整数序列在线百科全书.

I have to concede that there is another (much less common, and usually informal) way to define the sequence by seeding it with values 1 and 1, but this is not the conventional one by any means. It is certainly not preferred in all the formal mathematical definitions I’ve seen, like The On-Line Encyclopaedia of Integer Sequences.

这篇关于在斐波那契数列中,fib(0)是0还是1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆