📜  关于斐波那契数的有趣事实

📅  最后修改于: 2021-04-27 05:57:59             🧑  作者: Mango

我们知道斐波那契数, F n = F n-1 + F n-2。

前几个斐波那契数是0、1、1、2、3、5、8、13、21、34、55、89、144、233、377、610、987,…。 。

以下是有关斐波那契数的一些有趣事实:

1.斐波那契数字的最后一位数字的模式:
前几个斐波那契数字的最后数字是:

0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, ... 

最后几位的序列以60的循环长度重复(有关此结果的说明,请参考此信息)。

C
// C program to demonstrate that sequence of last 
// digits of Fibonacci numbers repeats after 60.
#include
#define max 100
int main()
{
    long long int arr[max];
    arr[0] = 0;
    arr[1] = 1;
  
    // storing Fibonacci numbers
    for (int i = 2; i < max; i++)
        arr[i] = arr[i-1] + arr[i-2];
  
    // Traversing through store numbers
    for (int i = 1; i < max - 1; i++)
    {
        // Since first two number are 0 and 1
        // so, if any two consecutive number encounter 0 and 1
        // at their unit place, then it clearly means that
        // number is repeating/ since we just have to find
        // the sum of previous two number
        if ((arr[i] % 10 == 0) && (arr[i+1] % 10 == 1))
            break;
    }
    printf("Sequence is repeating after index %d", i);
}


Java
// Java program to demonstrate that sequence of last 
// digits of Fibonacci numbers repeats after 60. 
  
class GFG{
static int max=100; 
public static void main(String[] args) 
{ 
    long[] arr=new long[max]; 
    arr[0] = 0; 
    arr[1] = 1;
    int i=0;
  
    // storing Fibonacci numbers 
    for (i = 2; i < max; i++) 
        arr[i] = arr[i-1] + arr[i-2]; 
  
    // Traversing through store numbers 
    for (i = 1; i < max - 1; i++) 
    { 
        // Since first two number are 0 and 1 
        // so, if any two consecutive number encounter 0 and 1 
        // at their unit place, then it clearly means that 
        // number is repeating/ since we just have to find 
        // the sum of previous two number 
        if ((arr[i] % 10 == 0) && (arr[i+1] % 10 == 1)) 
            break; 
    } 
    System.out.println("Sequence is repeating after index "+i); 
} 
}
// This code is conributed by mits


Python3
# Python3 program to demonstrate that sequence of last
# digits of Fibonacci numbers repeats after 60.
  
  
if __name__=='__main__':
    max = 100
    arr = [0 for i in range(max)]
    arr[0] = 0
    arr[1] = 1
  
# storing Fibonacci numbers
    for i in range(2, max):
        arr[i] = arr[i - 1] + arr[i - 2]
  
    # Traversing through store numbers
    for i in range(1, max - 1):
          
  
    # Since first two number are 0 and 1
    # so, if any two consecutive number encounter 0 and 1
    # at their unit place, then it clearly means that
    # number is repeating/ since we just have to find
    # the sum of previous two number
        if((arr[i] % 10 == 0) and (arr[i + 1] % 10 == 1)):
            break
  
    print("Sequence is repeating after index", i)
  
# This code is contributed by
# Sanjit_Prasad


C#
// C# program to demonstrate that sequence of last 
// digits of Fibonacci numbers repeats after 60. 
  
class GFG{
static int max=100; 
public static void Main() 
{ 
    long[] arr=new long[max]; 
    arr[0] = 0; 
    arr[1] = 1;
    int i=0;
  
    // storing Fibonacci numbers 
    for (i = 2; i < max; i++) 
        arr[i] = arr[i-1] + arr[i-2]; 
  
    // Traversing through store numbers 
    for (i = 1; i < max - 1; i++) 
    { 
        // Since first two number are 0 and 1 
        // so, if any two consecutive number encounter 0 and 1 
        // at their unit place, then it clearly means that 
        // number is repeating/ since we just have to find 
        // the sum of previous two number 
        if ((arr[i] % 10 == 0) && (arr[i+1] % 10 == 1)) 
            break; 
    } 
    System.Console.WriteLine("Sequence is repeating after index "+i); 
} 
}
// This code is conributed by mits


PHP


C
// C program to demonstrate divisibility of Fibonacci
// numbers.
#include
#define MAX 90
  
int main()
{
    // indexes variable stores index of number that
    // is divisible by 2, 3, 5 and 8
    long long int arr[MAX], index1[MAX], index2[MAX];
    long long int index3[MAX], index4[MAX];
  
    // storing fibonacci numbers
    arr[0] = 0;
    arr[1] = 1;
    for (int i = 2; i < MAX; i++)
        arr[i] = arr[i-1] + arr[i-2];
  
    // c1 keeps track of number of index of number
    // divisible by 2 and others c2, c3 and c4 for
    // 3, 5 and 8
    int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  
    // separating fibonacci number into their
    // respective array
    for (int i = 0; i < MAX; i++)
    {
        if (arr[i] % 2 == 0)
            index1[c1++] = i;
        if (arr[i] % 3 == 0)
            index2[c2++] = i;
        if (arr[i] % 5 == 0)
            index3[c3++] = i;
        if (arr[i] % 8 == 0)
            index4[c4++] = i;
    }
  
    // printing index arrays
    printf("Index of Fibonacci numbers divisible by"
           " 2 are :\n");
    for (int i = 0; i < c1; i++)
        printf("%d  ", index1[i]);
    printf("\n");
  
    printf("Index of Fibonacci number divisible by"
           " 3 are :\n");
    for (int i = 0; i < c2; i++)
        printf("%d  ", index2[i]);
    printf("\n");
  
    printf("Index of Fibonacci number divisible by"
           " 5 are :\n");
    for (int i = 0; i < c3; i++)
        printf("%d  ", index3[i]);
    printf("\n");
  
    printf("Index of Fibonacci number divisible by"
           " 8 are :\n");
    for (int i = 0; i < c4; i++)
        printf("%d  ", index4[i]);
    printf("\n");
}


Java
// Java program to demonstrate divisibility of Fibonacci 
// numbers. 
  
class GFG
{
static int MAX=90; 
  
// Driver code
public static void main(String[] args) 
{ 
    // indexes variable stores index of number that 
    // is divisible by 2, 3, 5 and 8 
    long[] arr=new long[MAX];
    long[] index1=new long[MAX];
    long[] index2=new long[MAX]; 
    long[] index3=new long[MAX];
    long[] index4=new long[MAX]; 
  
    // storing fibonacci numbers 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i - 1] + arr[i - 2]; 
  
    // c1 keeps track of number of index of number 
    // divisible by 2 and others c2, c3 and c4 for 
    // 3, 5 and 8 
    int c1 = 0, c2 = 0, c3 = 0, c4 = 0; 
  
    // separating fibonacci number into their 
    // respective array 
    for (int i = 0; i < MAX; i++) 
    { 
        if (arr[i] % 2 == 0) 
            index1[c1++] = i; 
        if (arr[i] % 3 == 0) 
            index2[c2++] = i; 
        if (arr[i] % 5 == 0) 
            index3[c3++] = i; 
        if (arr[i] % 8 == 0) 
            index4[c4++] = i; 
    } 
  
    // printing index arrays 
    System.out.print("Index of Fibonacci numbers divisible by" +
        " 2 are :\n"); 
    for (int i = 0; i < c1; i++) 
        System.out.print(index1[i] + " "); 
    System.out.print("\n"); 
  
    System.out.print("Index of Fibonacci number divisible by" +
        " 3 are :\n"); 
    for (int i = 0; i < c2; i++) 
        System.out.print(index2[i] + " "); 
    System.out.print("\n"); 
  
    System.out.print("Index of Fibonacci number divisible by" + 
        " 5 are :\n"); 
    for (int i = 0; i < c3; i++) 
        System.out.print(index3[i] + " "); 
    System.out.print("\n"); 
  
    System.out.print("Index of Fibonacci number divisible by" +
        " 8 are :\n"); 
    for (int i = 0; i < c4; i++) 
        System.out.print(index4[i] + " "); 
    System.out.print("\n"); 
} 
}
  
// This code is contributed by mits


Python3
# Python3 program to demonstrate divisibility
# of Fibonacci numbers. 
MAX = 90; 
  
# indexes variable stores index of number 
# that is divisible by 2, 3, 5 and 8 
arr = [0] * (MAX);
index1 = [0] * (MAX);
index2 = [0] * (MAX); 
index3 = [0] * (MAX);
index4 = [0] * (MAX); 
  
# storing fibonacci numbers 
arr[0] = 0; 
arr[1] = 1; 
for i in range(2, MAX): 
    arr[i] = arr[i - 1] + arr[i - 2]; 
  
# c1 keeps track of number of index 
# of number divisible by 2 and others  
# c2, c3 and c4 for 3, 5 and 8 
c1, c2, c3, c4 = 0, 0, 0, 0;
  
# separating fibonacci number into
# their respective array 
for i in range(MAX): 
    if (arr[i] % 2 == 0): 
        index1[c1] = i;
        c1 += 1;
    if (arr[i] % 3 == 0): 
        index2[c2] = i;
        c2 += 1;
    if (arr[i] % 5 == 0): 
        index3[c3] = i;
        c3 += 1;
    if (arr[i] % 8 == 0): 
        index4[c4] = i;
        c4 += 1;
  
# printing index arrays 
print("Index of Fibonacci numbers",
           "divisible by 2 are :"); 
for i in range(c1): 
    print(index1[i], end = " "); 
print(""); 
  
print("Index of Fibonacci number", 
          "divisible by 3 are :"); 
for i in range(c2): 
    print(index2[i], end = " "); 
print(""); 
  
print("Index of Fibonacci number", 
          "divisible by 5 are :"); 
for i in range(c3): 
    print(index3[i], end = " "); 
print(""); 
  
print("Index of Fibonacci number", 
          "divisible by 8 are :"); 
for i in range(c4): 
    print(index4[i], end = " "); 
print("");
  
# This code is contributed by mits


C#
// C# program to demonstrate divisibility 
// of Fibonacci numbers. 
  
class GFG{
static int MAX = 90; 
  
static void Main() 
{ 
    // indexes variable stores index of number that 
    // is divisible by 2, 3, 5 and 8 
    long[] arr = new long[MAX];
    long[] index1 = new long[MAX];
    long[] index2 = new long[MAX]; 
    long[] index3 = new long[MAX];
    long[] index4 = new long[MAX]; 
  
    // storing fibonacci numbers 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i-1] + arr[i-2]; 
  
    // c1 keeps track of number of index of number 
    // divisible by 2 and others c2, c3 and c4 for 
    // 3, 5 and 8 
    int c1 = 0, c2 = 0, c3 = 0, c4 = 0; 
  
    // separating fibonacci number into their 
    // respective array 
    for (int i = 0; i < MAX; i++) 
    { 
        if (arr[i] % 2 == 0) 
            index1[c1++] = i; 
        if (arr[i] % 3 == 0) 
            index2[c2++] = i; 
        if (arr[i] % 5 == 0) 
            index3[c3++] = i; 
        if (arr[i] % 8 == 0) 
            index4[c4++] = i; 
    } 
  
    // printing index arrays 
    System.Console.Write("Index of Fibonacci numbers" + 
                    "divisible by 2 are :\n"); 
    for (int i = 0; i < c1; i++) 
        System.Console.Write(index1[i]+" "); 
    System.Console.Write("\n"); 
  
    System.Console.Write("Index of Fibonacci number "+
                        " divisible by 3 are :\n"); 
    for (int i = 0; i < c2; i++) 
        System.Console.Write(index2[i]+" "); 
    System.Console.Write("\n"); 
  
    System.Console.Write("Index of Fibonacci number "+
        "divisible by 5 are :\n"); 
    for (int i = 0; i < c3; i++) 
        System.Console.Write(index3[i]+" "); 
    System.Console.Write("\n"); 
  
    System.Console.Write("Index of Fibonacci number "+
        "divisible by 8 are :\n"); 
    for (int i = 0; i < c4; i++) 
        System.Console.Write(index4[i]+" "); 
    System.Console.Write("\n"); 
} 
}
  
// This code is contributed by mits


PHP


C++
// C program to demonstrate that Fibonacci numbers
// that are divisible by their indexes have indexes
// as either power of 5 or multiple of 12.
#include
#define MAX 100
  
int main()
{
    // storing Fibonacci numbers
    long long int arr[MAX];
    arr[0] = 0;
    arr[1] = 1;
    for (int i = 2; i < MAX; i++)
        arr[i] = arr[i-1] + arr[i-2];
  
    printf("Fibonacci numbers divisible by "
          "their indexes are :\n");
    for (int i = 1; i < MAX; i++)
        if (arr[i] % i == 0)
            printf("%d  ", i);
}


Java
// Java program to demonstrate that Fibonacci numbers 
// that are divisible by their indexes have indexes 
// as either power of 5 or multiple of 12. 
  
class GFG
{
  
static int MAX = 100; 
  
public static void main(String[] args) 
{ 
    // storing Fibonacci numbers 
    long[] arr = new long[MAX]; 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i - 1] + arr[i - 2]; 
  
    System.out.print("Fibonacci numbers divisible by "+
        "their indexes are :\n"); 
    for (int i = 1; i < MAX; i++) 
        if (arr[i] % i == 0) 
            System.out.print(i + " "); 
}
}
  
// This code is contributed by mits


Python3
# Python3 program to demonstrate that Fibonacci numbers
# that are divisible by their indexes have indexes
# as either power of 5 or multiple of 12.
  
if __name__=='__main__':
    MAX = 100
# storing Fibonacci numbers
    arr = [0 for i in range(MAX)]
    arr[0] = 0
    arr[1] = 1
    for i in range(2, MAX):
        arr[i] = arr[i - 1] + arr[i - 2]
  
    print("Fibonacci numbers divisible by their indexes are :")
    for i in range(1, MAX):
        if(arr[i] % i == 0):
            print(i,end=" ")
  
# This code is contributed by
# Sanjit_Prasad


C#
// C# program to demonstrate that Fibonacci 
// numbers that are divisible by their 
// indexes have indexes as either power of 5 
// or multiple of 12. 
using System;
  
class GFG
{
static int MAX = 100; 
static void Main() 
{ 
    // storing Fibonacci numbers 
    long[] arr = new long[MAX]; 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i - 1] + arr[i - 2]; 
  
    Console.Write("Fibonacci numbers divisible by " +
                           "their indexes are :\n"); 
    for (int i = 1; i < MAX; i++) 
        if (arr[i] % i == 0) 
            System.Console.Write(i+" "); 
}
}
  
// This code is contributed by mits


输出:

Sequence is repeating after index 60

2.斐波那契数的因素:仔细观察,我们可以观察到以下几点:

  • 每3个斐波那契数是2的倍数
  • 每4个斐波纳契数是3的倍数
  • 每5个斐波纳契数是5的倍数
  • 每6个斐波纳契数是8的倍数

有关详情,请参阅此。

C

// C program to demonstrate divisibility of Fibonacci
// numbers.
#include
#define MAX 90
  
int main()
{
    // indexes variable stores index of number that
    // is divisible by 2, 3, 5 and 8
    long long int arr[MAX], index1[MAX], index2[MAX];
    long long int index3[MAX], index4[MAX];
  
    // storing fibonacci numbers
    arr[0] = 0;
    arr[1] = 1;
    for (int i = 2; i < MAX; i++)
        arr[i] = arr[i-1] + arr[i-2];
  
    // c1 keeps track of number of index of number
    // divisible by 2 and others c2, c3 and c4 for
    // 3, 5 and 8
    int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  
    // separating fibonacci number into their
    // respective array
    for (int i = 0; i < MAX; i++)
    {
        if (arr[i] % 2 == 0)
            index1[c1++] = i;
        if (arr[i] % 3 == 0)
            index2[c2++] = i;
        if (arr[i] % 5 == 0)
            index3[c3++] = i;
        if (arr[i] % 8 == 0)
            index4[c4++] = i;
    }
  
    // printing index arrays
    printf("Index of Fibonacci numbers divisible by"
           " 2 are :\n");
    for (int i = 0; i < c1; i++)
        printf("%d  ", index1[i]);
    printf("\n");
  
    printf("Index of Fibonacci number divisible by"
           " 3 are :\n");
    for (int i = 0; i < c2; i++)
        printf("%d  ", index2[i]);
    printf("\n");
  
    printf("Index of Fibonacci number divisible by"
           " 5 are :\n");
    for (int i = 0; i < c3; i++)
        printf("%d  ", index3[i]);
    printf("\n");
  
    printf("Index of Fibonacci number divisible by"
           " 8 are :\n");
    for (int i = 0; i < c4; i++)
        printf("%d  ", index4[i]);
    printf("\n");
}

Java

// Java program to demonstrate divisibility of Fibonacci 
// numbers. 
  
class GFG
{
static int MAX=90; 
  
// Driver code
public static void main(String[] args) 
{ 
    // indexes variable stores index of number that 
    // is divisible by 2, 3, 5 and 8 
    long[] arr=new long[MAX];
    long[] index1=new long[MAX];
    long[] index2=new long[MAX]; 
    long[] index3=new long[MAX];
    long[] index4=new long[MAX]; 
  
    // storing fibonacci numbers 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i - 1] + arr[i - 2]; 
  
    // c1 keeps track of number of index of number 
    // divisible by 2 and others c2, c3 and c4 for 
    // 3, 5 and 8 
    int c1 = 0, c2 = 0, c3 = 0, c4 = 0; 
  
    // separating fibonacci number into their 
    // respective array 
    for (int i = 0; i < MAX; i++) 
    { 
        if (arr[i] % 2 == 0) 
            index1[c1++] = i; 
        if (arr[i] % 3 == 0) 
            index2[c2++] = i; 
        if (arr[i] % 5 == 0) 
            index3[c3++] = i; 
        if (arr[i] % 8 == 0) 
            index4[c4++] = i; 
    } 
  
    // printing index arrays 
    System.out.print("Index of Fibonacci numbers divisible by" +
        " 2 are :\n"); 
    for (int i = 0; i < c1; i++) 
        System.out.print(index1[i] + " "); 
    System.out.print("\n"); 
  
    System.out.print("Index of Fibonacci number divisible by" +
        " 3 are :\n"); 
    for (int i = 0; i < c2; i++) 
        System.out.print(index2[i] + " "); 
    System.out.print("\n"); 
  
    System.out.print("Index of Fibonacci number divisible by" + 
        " 5 are :\n"); 
    for (int i = 0; i < c3; i++) 
        System.out.print(index3[i] + " "); 
    System.out.print("\n"); 
  
    System.out.print("Index of Fibonacci number divisible by" +
        " 8 are :\n"); 
    for (int i = 0; i < c4; i++) 
        System.out.print(index4[i] + " "); 
    System.out.print("\n"); 
} 
}
  
// This code is contributed by mits

Python3

# Python3 program to demonstrate divisibility
# of Fibonacci numbers. 
MAX = 90; 
  
# indexes variable stores index of number 
# that is divisible by 2, 3, 5 and 8 
arr = [0] * (MAX);
index1 = [0] * (MAX);
index2 = [0] * (MAX); 
index3 = [0] * (MAX);
index4 = [0] * (MAX); 
  
# storing fibonacci numbers 
arr[0] = 0; 
arr[1] = 1; 
for i in range(2, MAX): 
    arr[i] = arr[i - 1] + arr[i - 2]; 
  
# c1 keeps track of number of index 
# of number divisible by 2 and others  
# c2, c3 and c4 for 3, 5 and 8 
c1, c2, c3, c4 = 0, 0, 0, 0;
  
# separating fibonacci number into
# their respective array 
for i in range(MAX): 
    if (arr[i] % 2 == 0): 
        index1[c1] = i;
        c1 += 1;
    if (arr[i] % 3 == 0): 
        index2[c2] = i;
        c2 += 1;
    if (arr[i] % 5 == 0): 
        index3[c3] = i;
        c3 += 1;
    if (arr[i] % 8 == 0): 
        index4[c4] = i;
        c4 += 1;
  
# printing index arrays 
print("Index of Fibonacci numbers",
           "divisible by 2 are :"); 
for i in range(c1): 
    print(index1[i], end = " "); 
print(""); 
  
print("Index of Fibonacci number", 
          "divisible by 3 are :"); 
for i in range(c2): 
    print(index2[i], end = " "); 
print(""); 
  
print("Index of Fibonacci number", 
          "divisible by 5 are :"); 
for i in range(c3): 
    print(index3[i], end = " "); 
print(""); 
  
print("Index of Fibonacci number", 
          "divisible by 8 are :"); 
for i in range(c4): 
    print(index4[i], end = " "); 
print("");
  
# This code is contributed by mits

C#

// C# program to demonstrate divisibility 
// of Fibonacci numbers. 
  
class GFG{
static int MAX = 90; 
  
static void Main() 
{ 
    // indexes variable stores index of number that 
    // is divisible by 2, 3, 5 and 8 
    long[] arr = new long[MAX];
    long[] index1 = new long[MAX];
    long[] index2 = new long[MAX]; 
    long[] index3 = new long[MAX];
    long[] index4 = new long[MAX]; 
  
    // storing fibonacci numbers 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i-1] + arr[i-2]; 
  
    // c1 keeps track of number of index of number 
    // divisible by 2 and others c2, c3 and c4 for 
    // 3, 5 and 8 
    int c1 = 0, c2 = 0, c3 = 0, c4 = 0; 
  
    // separating fibonacci number into their 
    // respective array 
    for (int i = 0; i < MAX; i++) 
    { 
        if (arr[i] % 2 == 0) 
            index1[c1++] = i; 
        if (arr[i] % 3 == 0) 
            index2[c2++] = i; 
        if (arr[i] % 5 == 0) 
            index3[c3++] = i; 
        if (arr[i] % 8 == 0) 
            index4[c4++] = i; 
    } 
  
    // printing index arrays 
    System.Console.Write("Index of Fibonacci numbers" + 
                    "divisible by 2 are :\n"); 
    for (int i = 0; i < c1; i++) 
        System.Console.Write(index1[i]+" "); 
    System.Console.Write("\n"); 
  
    System.Console.Write("Index of Fibonacci number "+
                        " divisible by 3 are :\n"); 
    for (int i = 0; i < c2; i++) 
        System.Console.Write(index2[i]+" "); 
    System.Console.Write("\n"); 
  
    System.Console.Write("Index of Fibonacci number "+
        "divisible by 5 are :\n"); 
    for (int i = 0; i < c3; i++) 
        System.Console.Write(index3[i]+" "); 
    System.Console.Write("\n"); 
  
    System.Console.Write("Index of Fibonacci number "+
        "divisible by 8 are :\n"); 
    for (int i = 0; i < c4; i++) 
        System.Console.Write(index4[i]+" "); 
    System.Console.Write("\n"); 
} 
}
  
// This code is contributed by mits

的PHP


输出:

Index of Fibonacci numbers divisible by 2 are :
0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 
48 51 54 57 60 63 66 69 72 75 78 81 84 87 
Index of Fibonacci number divisible by 3 are :
0 4 8 12 16 20 24 28 32 36 40 44 48 52 
56 60 64 68 72 76 80 84 88 
Index of Fibonacci number divisible by 5 are :
0 5 10 15 20 25 30 35 40 45 50 
55 60 65 70 75 80 85 
Index of Fibonacci number divisible by 8 are :
0 6 12 18 24 30 36 42 48
54 60 66 72 78 84 

3.具有指数因子的斐波那契数:我们有一些斐波那契数,例如F(1)= 1可以被1整除,F(5)= 5可以被5整除,F(12)= 144可以被12整除,F(24)= 46368可以被24整除,F(25)= 75025可以被25整除。这种类型的索引号遵循某种模式。首先,让我们看一下那些索引号:
1,5,12,24,25,36,48,60,72,84,96,108,120,125,132,…..
在观察时,此序列由12的倍数组成的每个数字以及满足pow(5,k)条件的所有数字组成,其中k = 0、1、2、3、4、5 6,7,…….

C++

// C program to demonstrate that Fibonacci numbers
// that are divisible by their indexes have indexes
// as either power of 5 or multiple of 12.
#include
#define MAX 100
  
int main()
{
    // storing Fibonacci numbers
    long long int arr[MAX];
    arr[0] = 0;
    arr[1] = 1;
    for (int i = 2; i < MAX; i++)
        arr[i] = arr[i-1] + arr[i-2];
  
    printf("Fibonacci numbers divisible by "
          "their indexes are :\n");
    for (int i = 1; i < MAX; i++)
        if (arr[i] % i == 0)
            printf("%d  ", i);
}

Java

// Java program to demonstrate that Fibonacci numbers 
// that are divisible by their indexes have indexes 
// as either power of 5 or multiple of 12. 
  
class GFG
{
  
static int MAX = 100; 
  
public static void main(String[] args) 
{ 
    // storing Fibonacci numbers 
    long[] arr = new long[MAX]; 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i - 1] + arr[i - 2]; 
  
    System.out.print("Fibonacci numbers divisible by "+
        "their indexes are :\n"); 
    for (int i = 1; i < MAX; i++) 
        if (arr[i] % i == 0) 
            System.out.print(i + " "); 
}
}
  
// This code is contributed by mits

Python3

# Python3 program to demonstrate that Fibonacci numbers
# that are divisible by their indexes have indexes
# as either power of 5 or multiple of 12.
  
if __name__=='__main__':
    MAX = 100
# storing Fibonacci numbers
    arr = [0 for i in range(MAX)]
    arr[0] = 0
    arr[1] = 1
    for i in range(2, MAX):
        arr[i] = arr[i - 1] + arr[i - 2]
  
    print("Fibonacci numbers divisible by their indexes are :")
    for i in range(1, MAX):
        if(arr[i] % i == 0):
            print(i,end=" ")
  
# This code is contributed by
# Sanjit_Prasad

C#

// C# program to demonstrate that Fibonacci 
// numbers that are divisible by their 
// indexes have indexes as either power of 5 
// or multiple of 12. 
using System;
  
class GFG
{
static int MAX = 100; 
static void Main() 
{ 
    // storing Fibonacci numbers 
    long[] arr = new long[MAX]; 
    arr[0] = 0; 
    arr[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        arr[i] = arr[i - 1] + arr[i - 2]; 
  
    Console.Write("Fibonacci numbers divisible by " +
                           "their indexes are :\n"); 
    for (int i = 1; i < MAX; i++) 
        if (arr[i] % i == 0) 
            System.Console.Write(i+" "); 
}
}
  
// This code is contributed by mits

输出:

Fibonacci numbers divisible by their indexes are :
1  5  12  24  25  36  48  60  72  96

4. f(n-1)* f(n + 1)– f(n)* f(n)的值为(-1) n 。请参阅卡西尼号的身份以获取详细信息。

参考 :
http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibmaths.html