Created
August 8, 2022 04:30
-
-
Save AsifITk/d8eed316ef8c7a74ea162cb6fc6a5e08 to your computer and use it in GitHub Desktop.
This file contains 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
function nBonacciRatio(n) { | |
function fib(x, tem = [0, 1, 1]) { | |
if (tem[x]) { | |
return tem[x]; | |
} | |
tem[x] = n * fib(x - 1, tem) + fib(x - 2, tem); | |
return tem[x]; | |
} | |
return n + fib(50) / fib(51); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment