Created
April 22, 2020 09:35
-
-
Save dmishin/32542f3671eec9ce7aeb1f58d512292c to your computer and use it in GitHub Desktop.
Numerically checking surprising identities regarding the sums involving Fibonacci numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #%metadata% | |
| #url: https://twitter.com/diegorattaggi/status/1252654580720119810/photo/1 | |
| from sympy import * | |
| mfib = Matrix([[0,1],[1,1]]) | |
| fib0 = Matrix([0,1]) | |
| luc0 = Matrix([2,1]) | |
| eye = Matrix([[1,0],[0,1]]) | |
| def fibo(n): | |
| return (mfib**n*fib0)[0,0] | |
| def luca(n): | |
| return (mfib**n*luc0)[0,0] | |
| assert [fibo(i) for i in range(6)] == [0,1,1,2,3,5] | |
| assert [luca(i) for i in range(6)] == [2,1,3,4,7,11] | |
| print("Checking Diego Rattagi's identity: ...=4") | |
| s = 0 | |
| for n in range(1,10): | |
| s += Rational(3,fibo(2**n)**2) + Rational(5,luca(2**n)**2) | |
| print(n, "Sn - 4=",float(s-4),"=", s-4) | |
| print("Checking Srinivasa Raghava K's identity ...=620/147") | |
| s = 0 | |
| for n in range(1,10): | |
| t = Rational(3*fibo(n),fibo(2**n)**2) + Rational(5*luca(n),luca(2**n)**2) | |
| s += t | |
| print(n, "Sn-620/147=",float(s-620/147), "=", s-Rational(620,147), "term is:",float(t)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment