compute_s_n <- function(n){
x <- 1:n
sum(x)
}
m <- 25
s_n <- vector(length = m)
for(n in 1:m){
cat("\n","n is ",n ," ** ",sep = "")
s_n[n] <- compute_s_n(n)
cat("compute_s_n(",n,") is ",compute_s_n(n) ," ** ",sep = "")
cat("s_n[",n,"] is ", s_n[n] ," ** " ,sep = "")
}
cat is a function that prints the arguments that you pass (pasting them together with the chosen sep-erator. within cat "\n" means make a newline