converges to e*. Use the first 20 terms of the series to approximate e. Use vector operation without...

You can try to use the following R code to achieve: #Set the largest nn <- 20 # Calculate the value of the nth item x <- (1 + 1/n)^n # Calculate the sum of the first 20 items <- sum ((1 + 1/1:n)^1:n)# Calculate the asymptotic value e <- x/sumprint(e)

Guess you like

Origin blog.csdn.net/weixin_42590539/article/details/129563737