Skip to content

Instantly share code, notes, and snippets.

@doryokujin
Created May 8, 2012 16:50
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 doryokujin/2637217 to your computer and use it in GitHub Desktop.
Save doryokujin/2637217 to your computer and use it in GitHub Desktop.
harmonic <- function(n){
sum(sapply(seq(1,n),function(n){ return(1/n) }))
}
res <- 44*harmonic(44) # res = 192.399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment