再帰と再帰式を理解する
F(n)= F(n – 1)+ F(n – 2)
fibonacci(0)= 0
fibonacci(1)= 1
フィボナッチ(2)=フィボナッチ(1)+フィボナッチ(0)= 1 + 0 = 1
フィボナッチ(3)=フィボナッチ(2)+フィボナッチ(1)= 1 + 1 = 2
フィボナッチ(4)=フィボナッチ(3)+フィボナッチ(2)= フィボナッチ数列 2 + 1 = 3
フィボナッチ(5)=フィボナッチ(4)+フィボナッチ(3)= 3 + 2 = 5
フィボナッチ(6)=フィボナッチ(5)+フィボナッチ(4)= 5 + 3 = 8
新しいフィボナッチ数(数n)を取得するたびに、次のフィボナッチnとして(n + 1)フィボナッチを見つけると、その数nは実際には(n – 1)数になります。 上記の反復ステップを見ると、n = 2の場合、
フィボナッチ(2)=フィボナッチ(2-1)+フィボナッチ(2-2)=フィボナッチ(1)+フィボナッチ(0)= フィボナッチ数列 フィボナッチ数列 フィボナッチ数列 フィボナッチ数列 フィボナッチ数列 1 + 0 = 1
フィボナッチ(3)=フィボナッチ(3-1)+フィボナッチ(3-2)=フィボナッチ(2)+フィボナッチ(1)= 1 + 1 = 2
つまり、nが増加するたびに、現在の(n – 1)番目と(n – 2)番目のフィボナッチの値も増加します。 しかし、nごとに(n – 1)と(n – 2)フィボナッチを追跡するのは面倒です。 自分自身を呼び出して反復タスクを自分で繰り返すメソッドを作成してはどうでしょうか。
自分自身を呼び出すメソッドは、再帰メソッドと呼ばれます。 再帰メソッドには、プログラムがそれ自体の呼び出しを停止する基本ケースが必要です。 フィボナッチ数列の基本ケースは、fibonacci(0)= 0およびfibonacci(1)= 1です。それ以外の場合、Fibonacciメソッドはそれ自体を1回呼び出します:fibonacci(n – 2)およびfibonacci(n – two)。 次に、それらを追加してfibonacci(n)を取得します。 n番目のフィボナッチを見つけるための再帰的な方法は次のように書くことができます-
よく見ると、再帰はスタックプロパティに従います。 小さなサブ問題を解決して、問題の解決策を取得します。 n> 1の場合、最後の行を実行します。 したがって、n = 6の場合、関数はfibonacci(6 – 1)とfibonacci(6 – 2)を呼び出して追加します。 fibonacci(6 – 1)またはfibonacci(5)は、fibonacci(5 – 1)およびfibonacci(5 – 2)を呼び出して追加します。 この再帰は、6がベースケース値(fibonacci(0)= 0またはfibonacci(1)= 1)に達するまで続きます。ベースケースに達すると、6つの基本値が追加され、フィボナッチ(XNUMX)。 以下は、再帰のツリー表現です。
再帰ツリー
ご覧のとおり、再帰はどれほど強力である可能性があります。 上記のツリーを作成しているのは4行のコードのみです(基本ケースを含む上記のコードの最後の行)。 Recursionはスタックを維持し、ベースケースにドリルダウンします。 動的計画法(DP):再帰は理解とコーディングが簡単ですが、時間とメモリの点でコストがかかる可能性があります。 以下の繰り返しツリーを見てください。 fib(4)で始まる左側のサブツリーとfib(3)で始まる右側のサブツリーはまったく同じです。 それらは500000である同じ結果を生成しますが、同じタスクをXNUMX回実行しています。 nが大きい場合(例:XNUMX)、同じサブタスクを複数回呼び出すため、再帰によってプログラムが非常に遅くなる可能性があります。
ツリーで囲まれた再帰
この問題を回避するには、動的計画法を使用できます。 動的計画法では、以前に解決したサブタスクを使用して、同じタイプの将来のタスクを解決できます。 これは、元の問題を解決するためのタスクを減らす方法です。 以前に解決したサブタスクのソリューションを格納する配列fib[]を作成しましょう。 lie [0]=0およびlie[1]=1であることはすでにわかっています。これら2つの値を保存しましょう。 さて、fib [0]の値は何ですか? lie [0]=1およびlie[1]= 2はすでに保存されているので、lie [1] = lie [0] +lie[3]とだけ言います。 同様に、fib [4] lie [5] lie [XNUMX]……、lie[n]を生成できます。 以前に解決されたサブタスクは、元のタスクが解決されなくなるまで次のサブタスクに対して呼び出され、冗長な計算が削減されます。
フィボナッチ数列
フィボナッチ(Fibonacci)数列は 0、1 で始まり、以後の項がその前の2つの項の和となる数列です。
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ・・・
漸化式: F0 = 0, F1 = 1, Fn = Fn-1 + Fn-2 ( n ≧ 2 )
トリボナッチ数列は 0、0、1 で始まり、以後の項がその前の3つの項の和となる数列です。
0, 0, 1, 1, 2, 4, 7, フィボナッチ数列 13, 24, 44, 81, 149, 274, ・・・
漸化式: F0 = 0, F1 = 0, F2 = 1, Fn = Fn-1 + Fn-2 + Fn-3 ( フィボナッチ数列 n ≧ 3 )
また、テトラナッチ数列は 0、0、0、1 で始まり、以後の項がその前の4つの項の和となる数列です。
0, 0, 0, 1, 1, 2, 4, 8, 15, 29, 56, 108, 208, 401, ・・・
漸化式: F0 フィボナッチ数列 フィボナッチ数列 = 0, F1 = 0, F2 = 0, F3 = 1, Fn = Fn-1 + Fn-2 + Fn-3 + Fn-4 ( n ≧ 4 ) フィボナッチ数列 フィボナッチ数列
ここでは漸化式により、これらの数列の各項の値( n ≦ 1000 )を計算し、表示します。
また、隣り合う項の比: Fn/Fn-1 も表示できます(小数点以下 300桁まで)。
この比の値が次第に一定値に収束する様子も確認できます。
・フィボナッチ数列: 1.6180339887 4989484820 4586834365・・・ (黄金比)
・トリボナッチ数列: 1.8392867552 1416113255 1852564653・・・ (トリボナッチ定数)
・テトラナッチ数列: 1.9275619754 フィボナッチ数列 フィボナッチ数列 8292530426 1905861736・・・
(注)ペンタナッチ数列(前5項の和)、ヘキサナッチ数列(前6項の和)などもある。
Fibonacci in Nature
The Fibonacci sequence of numbers forms the best whole number approximations to the Golden Proportion, which, some say, フィボナッチ数列 フィボナッチ数列 is most aesthetically beautiful to humans. “Empirical investigations of the aesthetic properties of the Golden Section date back to the very origins of scientific psychology itself, the first studies being conducted by Fechner in the 1860s” (Green 937). Debate remains as to whether or not humans naturally prefer Golden Ratio (フィボナッチ数列 1.61803…) proportions in the organization and structural symmetry of art, music or nature, and some even deny that the Golden Ratio is as ubiquitous in フィボナッチ数列 nature as others proclaim. Nevertheless, mathematical principles do appear to govern the development of many patterns and structures in nature, and as time passes, more フィボナッチ数列 フィボナッチ数列 and more scientific research finds evidence that the Fibonacci numbers and the Golden Ratio are prevalent in natural objects, from the microscopic structure proportions in フィボナッチ数列 the bodies of living beings on Earth to the relationships of gravitational forces and distances between bodies in the universe (Akhtaruzzaman and Shafie).
As it relates to the development and structure of a plant, it is not uncommon to find representations of the Fibonacci numbers or the Golden Ratio. Structural symmetry is one of the simplest ways an organism will demonstrate this fascinating phenomenon (Livio 115). For example, pentagonal symmetry (five parts around a central axis, 72° apart) is quite common in the natural world, particularly among the more “primitive” phyla, such as the water net (Hydrodictyaceae Hydrodictyon), a green フィボナッチ数列 algae (“Live”). Higher in the plant kingdom, many flowers exhibit Fibonacci-number petal symmetry, including fruit blossoms, water lilies, brier-roses and all the genus rosa, honeysuckle, carnations, geraniums, primroses, marsh-mallows, campanula, and passionflowers. Besides symmetrical number and arrangement of parts or petals, plants often illustrate the Fibonacci sequence in their seed フィボナッチ数列 sections or in the spirals that are formed as new parts and branches grow.
Flowers, Fruits, and Vegetables
Spanish poet Salvador Rueda (1857-1933) eloquently said, “las フィボナッチ数列 フィボナッチ数列 flores son matematicas bellas, compass, armonia callada, ritmo mudo,” (flowers are a beautiful mathematics, compass, silent harmony, mute rhythm) (Spooner 38).
Many flowers display figures フィボナッチ数列 フィボナッチ数列 adorned with numbers of petals that are in the Fibonacci sequence:
1 petal: White Calla Lily 2 petals: Euphorbia 3 petals: Lily, Iris, Euphorbia 5 petals: Buttercup, wild Rose, Larkspur, Columbine (Aquilegia), Hibiscus 8 petals: Delphiniums, Bloodroot 13 petals: Ragwort, Corn Marigold, Cineraria, Black Eyed Susan 21 petals: Aster, Shasta フィボナッチ数列 Daisy, Chicory 34 petals: Plantain, Pyrethrum, Daisy 55, 89 petals: Michaelmas Daisies, the Asteraceae family (Sinha; Akhtaruzzaman and Shafie)
One of the largest families of フィボナッチ数列 the vascular plants, compositae, contains nearly 2000 genera and over 32,000 species (“Plant List”) of flowering plants. Compositae (or Asteraceae) is commonly referred to as フィボナッチ数列 the aster, daisy, composite, or sunflower family. Family members are distributed worldwide and have a recognizable, “unique disc-shaped inflorescence, composed of numerous pentamerous florets packed フィボナッチ数列 on an involucrate head, surrounded by ray florets (petals) on the outside.” The numbers of ray-florets and disc-florets vary from one plant to another, but フィボナッチ数列 フィボナッチ数列 they all are all “beautiful phyllotactic configurations” due to the arrangement of seeds in the seed head.
The head of a composite displays definite equiangular フィボナッチ数列 フィボナッチ数列 spirals running counter-clockwise and clockwise. These bi-directional spirals intersect each other, such as: 2/3, 3/5, 5/8, 8/13, 13/21, 21/34, … The numerators or the denominators フィボナッチ数列 of this series are recognizable as the Fibonacci sequence. The petal counts of Field Daisies are usually thirteen, twenty-one or thirty-four and, in the close-packed フィボナッチ数列 フィボナッチ数列 arrangement of tiny florets in the core of a daisy blossom, we can see the equiangular spiral phenomenon clearly as twenty-one counterclockwise spirals swirl in delicate, picturesque motion with thirty-four clockwise spirals. In any daisy, the floral tango of logarithmic spirals generally consists of successive terms of the Fibonacci sequence (Britton; Livio 112).
The seeds are packed this way on the seed head presumably to “reduce the size of the florets to the optimum [size] necessary for quick production of an adequate number of single-seeded fruits” (Majumder and Chakravarti). The distribution of the ray- florets on the heads in Fibonacci number structure is indicative of “perfect growth,” according to Majumder and Chakravarti.
Research also indicates that “individual flowers emerge at a uniform speed at fixed フィボナッチ数列 フィボナッチ数列 フィボナッチ数列 intervals of time along a logarithmic spiral, with an initial angle at = 137.5° (Mathai and Davis, 1974)” (Majumder and Chakravarti).Passion flower, also フィボナッチ数列 フィボナッチ数列 known as Passiflora Incarnata, is a perfect example of a flower regally displaying Fibonacci Numbers, for three sepals protect the bud at the outermost layer, フィボナッチ数列 フィボナッチ数列 while five outer green petals are followed by an inner layer of five more, paler, green petals. With an array of purple and white stamens, フィボナッチ数列 there are 5 greenish T-shaped stamens in the center and three deep brown carpels at the uppermost layer (Akhtaruzzaman and Shafie).
Insufficient data and “careless methodological フィボナッチ数列 practices” cause many scientists to doubt or outright refute the notion that Fibonacci numbers or the Golden Ratio are an absolute “law of nature” (Green 937). Jonathan Swinton and Erinma Ochu aimed to remedy the lack of scientific evidence by studying and recording the occurrence of Fibonacci structure in the フィボナッチ数列 spirals (parastichies) of 657 sunflower (Helianthus annuus) seed heads at the MSI Turing’s Sunflower Consortium.
The sunflower has 55 clockwise spirals overlaid on either 34 フィボナッチ数列 or 89 counterclockwise spirals, a phi proportion (Phi Φ =1.618 …)(Wright). The most reliable data subset of 768 clockwise or anticlockwise parastichy numbers フィボナッチ数列 revealed a clear indication of a dominance of Fibonacci structure: 565 were Fibonacci numbers and 67 had a predefined type of Fibonacci structure. They also フィボナッチ数列 フィボナッチ数列 found “more complex Fibonacci structures not previously reported in sunflowers” and seed heads without Fibonacci structure (nearly 20%). Some seed heads without Fibonacci structure nevertheless フィボナッチ数列 had a tendency for counts to cluster near the Fibonacci number; in those, “parastichy numbers equal to one less than a Fibonacci number were present フィボナッチ数列 フィボナッチ数列 significantly more often than those one more than a Fibonacci number.” The research also revealed the “existence of quasi-regular heads, in which no parastichy number could be definitively assigned” (Swinton and Ochu).
The bumps and hexagonal scales (bracts) on the surface of pineapples form three distinct spirals in increasing steepness, フィボナッチ数列 creating a recognizable pattern of Fibonacci numbers (usually 5, 8, and 13) and the Romanesco Broccoli (looks and tastes like a cross between broccoli and フィボナッチ数列 フィボナッチ数列 cauliflower) has a shape almost like a pentagon with florets organized in spirals in both directions around the center point, where the florets are smallest (フィボナッチ数列 Posamentier and Lehmann; Knott). Other fruits have Fibonacci numbers in their seeds’ sectional arrangements. Three sections are easy to see in the cut cross-sections of the Banana, Cantaloupe, Cucumber, Kiwano fruit (African cucumber), and Watermelon. Star Fruit, Okra, and Apple seeds are arranged in a pentagram shape of five sections (Akhtaruzzaman and Shafie).
Spirals, Branches, and Leaves
According to Scotta and Marketos, the Fibonacci spiral is “fundamental to organic life.” They admit that it is “not フィボナッチ数列 always clear why these numbers appear,” but it appears that they “reflect minimization or optimization principles of some sort, namely the notion that nature is efficient yet ‘lazy,’ making the most of available resources” (Scotta and Marketos). New growth may simply form spirals so that the new leaves, petals, and フィボナッチ数列 branches will not block older leaves, etc. from sunlight or air, or so that the maximum amount of rain or dew will get directed down to the roots (Akhtaruzzaman and Shafie). Others suggest the logarithmic spiral may be a “natural outcome of the supply of genetic material in the form of pulses at constant intervals of time and obeying the law of fluid flow” (Majumder and Chakravarti).
In the world of nature, things grow by adding some unit, even if the unit is as small as a molecule. Michael Wright says phi is “an ideal rate of growth for things フィボナッチ数列 which grow by adding some quantity,” such as the nautilus and sunflower (Wright). In addition to pineapples, the nautilus, and the sunflower, spirals are found フィボナッチ数列 フィボナッチ数列 in pinecones, ginger plants, artichokes, and other plants, including numerous cacti (Britton; Livio 110-111).
In 1868, Wilhelm Hofmeister suggested that new cells destined to develop フィボナッチ数列 into leaves, petals, etc. (primordia) “always form in the least crowded spot” on the meristem (growing tip of a plant). Each successive primordium of a フィボナッチ数列 continuously growing plant “forms at one point along the meristem and then moves radially outward at a rate proportional to the stem’s growth” (Seewald). The フィボナッチ数列 second primordium grows as far as possible from the first, and the third grows at a distance farthest from both the first and the second フィボナッチ数列 フィボナッチ数列 フィボナッチ数列 primordia (Seewald). In the 1830s, scientist brothers found that the rotation tends to be an angle made with a fraction of two successive Fibonacci Numbers, フィボナッチ数列 フィボナッチ数列 フィボナッチ数列 such as 1/2, 1/3, 2/5, 3/8 (Akhtaruzzaman and Shafie). “As the number of primordia increases, the divergence angle eventually converges to a constant value” of 137.5° thereby creating Golden Angle Fibonacci spirals (Seewald).
The fact that branches and leaves of plants follow certain mathematical growth patterns was first noted フィボナッチ数列 in antiquity by Theophrastus (ca. 372 B.C. – ca. 287 B.C.) but the phenomenon was first called phyllotaxis (“leaf arrangement” in Greek) in 1754 フィボナッチ数列 by the Swiss naturalist Charles Bonnet (1720-1793) (Livio 109-110). Patterns with the other fractions are also observed, though uncommonly (Okabe). Professor Emeritus H. S. M. Coxeter at the University of Toronto, in his Introduction to Geometry admits that some plants exhibit phyllotaxis numbers that “do not belong to the sequence フィボナッチ数列 of f’s [Fibonacci numbers] but to the sequence of g’s [Lucas numbers] or even to the still more anomalous sequences 3,1,4,5,9,フィボナッチ数列 … or 5,2,7,9,16,….” He concludes we must face the fact that phyllotaxis is really not a universal law but only フィボナッチ数列 a fascinatingly prevalent tendency favored by nature (Coxeter).
The Sneezewort is a simple plant that exhibits the Fibonacci sequence. New shoots commonly spring from the フィボナッチ数列 main stem at an axil. Horizontal lines drawn through the axils highlight obvious stages of development in the plant. The pattern of development mirrors the フィボナッチ数列 growth of the rabbits in Fibonacci’s classic problem; that is, the number of branches at any stage of development is a Fibonacci number. “Furthermore, the フィボナッチ数列 number of leaves in any stage will also be a Fibonacci number” (Britton).
Palms are ideal specimens of the plants that display spiral phyllotaxis because フィボナッチ数列 フィボナッチ数列 their large leaves are prominently arranged (and therefore easily observed) on the trunk. Palm leaves are arranged in Fibonacci sequence spiral formation, overlap least and フィボナッチ数列 provide an “angular deflection between consecutive leaves that, together, comprise a photosynthetic surface optimally accessible to illumination” (Davis; Majumder and Chakravarti).
The initial leaves are often 180° apart. As the stem matures, it thickens, and the spiral pitch between leaves decreases. “The result of this process is that angular divergence フィボナッチ数列 フィボナッチ数列 of new leaves gradually approximates the golden angle. This gives rise to an approximate logarithmic spiral of touching leaves” (Green). On the oak tree, for フィボナッチ数列 example, the branch rotation is a Fibonacci fraction, 2/5, which means that five branches spiral two times around the trunk to complete one pattern. Other trees with the Fibonacci leaf arrangement are the elm tree (1/2), the beech (1/3), the willow (3/8) and the almond tree (5/13) (Livio 113-115).
Okabe refers フィボナッチ数列 to Fibonacci phyllotaxis as evidence of natural selection, which eliminates plants whose growth patterns do not turn following the Golden Angle 2πα0 = 137.5◦ フィボナッチ数列 He says those which follow this process are “favored in nature” because the Golden Angle is structurally “the most stable” because it undergoes the least (though inevitable) phyllotactic structural changes (stepwise transitions between phyllotactic fractions) during early stages of the growing process to a mature plant (Okabe).
再帰と再帰式を理解する
F(n)= F(n – 1)+ F(n – 2)
fibonacci(0)= 0
fibonacci(1)= 1
フィボナッチ(2)=フィボナッチ(1)+フィボナッチ(0)= 1 + 0 = 1
フィボナッチ(3)=フィボナッチ(2)+フィボナッチ(1)= 1 + 1 = 2
フィボナッチ(4)=フィボナッチ(3)+フィボナッチ(2)= 2 + 1 = フィボナッチ数列 3
フィボナッチ(5)=フィボナッチ(4)+フィボナッチ(3)= 3 + 2 = 5
フィボナッチ(6)=フィボナッチ(5)+フィボナッチ(4)= 5 + 3 = 8
新しいフィボナッチ数(数n)を取得するたびに、次のフィボナッチnとして(n + 1)フィボナッチを見つけると、その数nは実際には(n – 1)数になります。 上記の反復ステップを見ると、n = 2の場合、
フィボナッチ(2)=フィボナッチ(2-1)+フィボナッチ(2-2)=フィボナッチ(1)+フィボナッチ(0)= 1 + 0 = フィボナッチ数列 フィボナッチ数列 1
フィボナッチ(3)=フィボナッチ(3-1)+フィボナッチ(3-2)=フィボナッチ(2)+フィボナッチ(1)= 1 + 1 = 2
つまり、nが増加するたびに、現在の(n – 1)番目と(n – 2)番目のフィボナッチの値も増加します。 しかし、nごとに(n – 1)と(n – 2)フィボナッチを追跡するのは面倒です。 自分自身を呼び出して反復タスクを自分で繰り返すメソッドを作成してはどうでしょうか。
自分自身を呼び出すメソッドは、再帰メソッドと呼ばれます。 再帰メソッドには、プログラムがそれ自体の呼び出しを停止する基本ケースが必要です。 フィボナッチ数列の基本ケースは、fibonacci(0)= 0およびfibonacci(1)= 1です。それ以外の場合、Fibonacciメソッドはそれ自体を1回呼び出します:fibonacci(n – 2)およびfibonacci(n – two)。 フィボナッチ数列 次に、それらを追加してfibonacci(n)を取得します。 n番目のフィボナッチを見つけるための再帰的な方法は次のように書くことができます-
よく見ると、再帰はスタックプロパティに従います。 小さなサブ問題を解決して、問題の解決策を取得します。 n> 1の場合、最後の行を実行します。 したがって、n = 6の場合、関数はfibonacci(6 – 1)とfibonacci(6 – 2)を呼び出して追加します。 fibonacci(6 – 1)またはfibonacci(5)は、fibonacci(5 – 1)およびfibonacci(5 – 2)を呼び出して追加します。 この再帰は、6がベースケース値(fibonacci(0)= 0またはfibonacci(1)= 1)に達するまで続きます。ベースケースに達すると、6つの基本値が追加され、フィボナッチ(XNUMX)。 以下は、再帰のツリー表現です。
再帰ツリー
ご覧のとおり、再帰はどれほど強力である可能性があります。 上記のツリーを作成しているのは4行のコードのみです(基本ケースを含む上記のコードの最後の行)。 Recursionはスタックを維持し、ベースケースにドリルダウンします。 動的計画法(DP):再帰は理解とコーディングが簡単ですが、時間とメモリの点でコストがかかる可能性があります。 以下の繰り返しツリーを見てください。 fib(4)で始まる左側のサブツリーとfib(3)で始まる右側のサブツリーはまったく同じです。 それらは500000である同じ結果を生成しますが、同じタスクをXNUMX回実行しています。 nが大きい場合(例:XNUMX)、同じサブタスクを複数回呼び出すため、再帰によってプログラムが非常に遅くなる可能性があります。
ツリーで囲まれた再帰
この問題を回避するには、動的計画法を使用できます。 動的計画法では、以前に解決したサブタスクを使用して、同じタイプの将来のタスクを解決できます。 これは、元の問題を解決するためのタスクを減らす方法です。 以前に解決したサブタスクのソリューションを格納する配列fib[]を作成しましょう。 lie [0]=0およびlie[1]=1であることはすでにわかっています。これら2つの値を保存しましょう。 さて、fib [0]の値は何ですか? lie [0]=1およびlie[1]= 2はすでに保存されているので、lie [1] = lie [0] +lie[3]とだけ言います。 同様に、fib [4] lie [5] lie [XNUMX]……、lie[n]を生成できます。 以前に解決されたサブタスクは、元のタスクが解決されなくなるまで次のサブタスクに対して呼び出され、冗長な計算が削減されます。
フィボナッチ数列
フィボナッチ(Fibonacci)数列は 0、1 で始まり、以後の項がその前の2つの項の和となる数列です。
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ・・・
漸化式: F0 = 0, F1 = 1, フィボナッチ数列 Fn = Fn-1 + Fn-2 ( n ≧ 2 )
トリボナッチ数列は 0、0、1 で始まり、以後の項がその前の3つの項の和となる数列です。
0, 0, 1, 1, 2, 4, 7, 13, 24, 44, 81, フィボナッチ数列 フィボナッチ数列 149, 274, ・・・
漸化式: F0 = 0, F1 = 0, F2 = 1, Fn = Fn-1 + Fn-2 + Fn-3 ( n ≧ 3 ) フィボナッチ数列
また、テトラナッチ数列は 0、0、0、1 で始まり、以後の項がその前の4つの項の和となる数列です。
0, 0, 0, 1, 1, 2, 4, 8, 15, 29, 56, 108, 208, 401, ・・・
漸化式: F0 = 0, F1 = フィボナッチ数列 フィボナッチ数列 0, F2 = 0, F3 = 1, Fn = Fn-1 + Fn-2 + Fn-3 + Fn-4 ( n ≧ 4 )
ここでは漸化式により、これらの数列の各項の値( n ≦ フィボナッチ数列 1000 )を計算し、表示します。
また、隣り合う項の比: Fn/Fn-1 も表示できます(小数点以下 300桁まで)。
この比の値が次第に一定値に収束する様子も確認できます。
・フィボナッチ数列: 1.6180339887 4989484820 4586834365・・・ (黄金比)
・トリボナッチ数列: 1.8392867552 1416113255 1852564653・・・ (トリボナッチ定数)
・テトラナッチ数列: 1.9275619754 8292530426 1905861736・・・
(注)ペンタナッチ数列(前5項の和)、ヘキサナッチ数列(前6項の和)などもある。
コメント