Mardi Gras True Fibs
|
03-01-2017, 12:41 AM
(This post was last modified: 03-01-2017 01:55 AM by Gerson W. Barbosa.)
Post: #1
|
|||
|
|||
Mardi Gras True Fibs
This is a follow-up of the recent thread about the Reciprocal Fibonacci Constant.
Quoting from Wikipedia: "The reciprocal Fibonacci constant, or ψ, is defined as the sum of the reciprocals of the Fibonacci numbers: \(\psi = \sum_{k=1}^{\infty} \frac{1}{F_k} = \frac{1}{1} + \frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{5} + \frac{1}{8} + \frac{1}{13} + \frac{1}{21} + \cdots.\) " That was an exercise on computing this series up to a certain number of terms. A number of you have contributed interesting codes and ideas, to which I am grateful. It has been mentioned that the computation of the constant to d digits requires at least ⌈(d*ln(100) - ln(20))/(2*ln(φ)⌉ terms, where φ is the golden ratio ( (1 + √5)/2 ), using the plain series. Thus, for 100 digits we would need to sum up to 476 terms of the series. The demonstration is trivial and is left as an exercise for the reader. 476 terms to compute 100 digits looks somewhat inefficient, so my goal has shifted to finding a way to lower this number. Here I share what I have found. Again, without a proof, but only because I have none: \[\psi = \frac{1}{F_{1}}+\frac{1}{F_{2}}+\frac{1}{F_{3}}+\cdots +\frac{1}{F_{n-1}}+\frac{1}{F_{n}}+\frac{1}{F_{n-1}-\frac{F_{1}^{2}}{F_{n+2}\cdot F_{1}+F_{n-1}\cdot F_{2}-\frac{F_{2}^{2}}{F_{n+2}\cdot F_{2}+F_{n-1}\cdot F_{3}-\frac{F_{3}^{2}}{F_{n+2}\cdot F_{3}+F_{n-1}\cdot F_{4}-\frac{F_{4}^{2}}{F_{n+2}\cdot F_{4}+F_{n-1}\cdot F_{5}-\frac{F_{5}^{2}}{F_{n+2}\cdot F_{5}+F_{n-1}\cdot F_{6}-\frac{F_{6}^{2}}{F_{n+2}\cdot F_{6}+F_{n-1}\cdot F_{7}-... }}}}}}}\] Code:
This HP 50g user RPL program, using the LongFloat library, requires two parameters. The first is the number of terms of the continued fraction and the second is n in the expression above, the number of terms of the original series. The following is an evaluation of the expression above with various parameters. When we compare the results with the true reciprocal Fibonacci constant in the first line, we notice that best results are achieved with approximately equal numbers of terms of the continued fraction and terms of the plain series. In this case we have obtained 99 correct decimals using only 30 terms in the last line. 30 is about 6.3% of 476. Not bad! 3.359885666243177553172011302918927179688905133731968486495553815325130318996683383615416216456790087 2 12 3.359885666242129988464989239268857623668736813180767663357400070297267494293999199307997271121544920 2 20 3.359885666243177553167433281787748928648776577928290964879706040408646726702491028523646222602832650 2 30 3.359885666243177553172011302918764514065619978389958675293504780890783041151282869607821301725790765 2 40 3.359885666243177553172011302918927179688899353919213085077297503281892745245057092283592271334021082 2 50 3.359885666243177553172011302918927179688905133731968281128034773312024205107370483101951938492442443 4 10 3.359885666243177552933037307174019435890442521909028053549830953375137979954347559962927929423499662 4 20 3.359885666243177553172011302918927179651795581225695045861072258099578065882672826328709609425804709 4 30 3.359885666243177553172011302918927179688905133731968486489791485719247471989816805452564095340121083 4 40 3.359885666243177553172011302918927179688905133731968486495553815325130318995788615553566782514358382 4 50 3.359885666243177553172011302918927179688905133731968486495553815325130318996683383615416216456651148 10 20 3.359885666243177553172011302918927179688905133731968486495553815325130318996683383615416201795067149 11 20 3.359885666243177553172011302918927179688905133731968486495553815325130318996683383615416216456790047 14 14 3.359885666243177553172011302918927179688905133731968486495553815325130318996683383615414413089430501 15 14 3.359885666243177553172011302918927179688905133731968486495553815325130318996683383615416216455221736 14 16 3.359885666243177553172011302918927179688905133731968486495553815325130318996683383615416216456790085 Hopefully there are not HP-49/50g-exclusive commands in the following RPL program. It is more difficult to be used with the LongFloat library, though. Code:
Comments, corrections and code optimizations are welcome. Definitely it looks like I have to find something more interesting to do during Easter and Carnival holidays ( Mardi Gras Basic Trigs (HP-12C), Easter Sunday Basic Trigs (HP-12C), Easter Sunday Trigs ( rpn38-CX) ). Next year I think I'll go to Rio :-) Edited to fix a couple of typos and minor mistakes. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Mardi Gras True Fibs - Gerson W. Barbosa - 03-01-2017 12:41 AM
RE: Mardi Gras True Fibs - Don Shepherd - 03-01-2017, 01:32 AM
RE: Mardi Gras True Fibs - Gerson W. Barbosa - 03-01-2017, 04:34 AM
RE: Mardi Gras True Fibs - Gerson W. Barbosa - 03-04-2017, 03:34 PM
RE: Mardi Gras True Fibs - Gerson W. Barbosa - 06-14-2018, 12:41 AM
RE: Mardi Gras True Fibs - Gerson W. Barbosa - 06-17-2018, 06:00 PM
|
User(s) browsing this thread: 1 Guest(s)