2. De rij van Fibonacci

Function Fibo(Number)
    Dim Phi
    Phi = (5 ^ (1 / 2) + 1) / 2
    Fibo = (Phi ^ Number - (-Phi) ^ (-Number)) / (5 ^ (1 / 2))
End Function

Function Fibo2(Number)
    If Number > 2 Then
        Fibo2 = Fibo2(Number - 1) + Fibo2(Number - 2)
    Else
        Fibo2 = 1
    End If
End Function


1

1

1

2

1

1

3

2

2

4

3

3

5

5

5

6

8

8

7

13

13

8

21

21

9

34

34

10

55

55

11

89

89

12

144

144

13

233

233

14

377

377

15

610

610

16

987

987

17

1597

1597

18

2584

2584

19

4181

4181

20

6765

6765

21

10946

10946

22

17711

17711

23

28657

28657

24

46368

46368

25

75025

75025

De tweede kolom is fibo(...) en de tweede kolom is fibo2(...). Zoek de verschillen!

©2004-2018 W.v.Ravenstein