Skip to content

Instantly share code, notes, and snippets.

@AsifITk
Created August 8, 2022 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AsifITk/d8eed316ef8c7a74ea162cb6fc6a5e08 to your computer and use it in GitHub Desktop.
Save AsifITk/d8eed316ef8c7a74ea162cb6fc6a5e08 to your computer and use it in GitHub Desktop.
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