cumsd <- function(x) {
  n <- seq_along(x)
  sqrt(cumsum(x^2) / n - (cumsum(x) / n)^2)
}

set.seed(12345L)
x <- rnorm(10)

cumsd(x)



Vectorize(function(k) sd(x[1:k]) * sqrt((k - 1) / k))(seq_along(x))