Skip to content

Instantly share code, notes, and snippets.

@timyates

timyates/fac.R Secret

Created October 27, 2015 11:48
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 timyates/f2ef0637ed016085da80 to your computer and use it in GitHub Desktop.
Save timyates/f2ef0637ed016085da80 to your computer and use it in GitHub Desktop.
library(gmp)
fib <- function(n) {
res <- c(as.bigz(1), as.bigz(1), numeric(n-2))
for (i in 3:length(res))
res[i] <- res[i-1] + res[i-2]
return(res)
}
res <- fib(1447)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment