Nothing
EratosthenesSieve <- function(n) {
# Print all prime numbers up to n (based on the sieve of Eratosthenes)
if (n >= 2) {
noMultiples <- function(j) sieve[(sieve %% j) != 0]
sieve <- seq(2, n)
primes <- c()
for (i in seq(2, n)) {
if (any(sieve == i)) {
primes <- c(primes, i)
sieve <- c(noMultiples(i), i)
}
}
return(primes)
} else {
stop("Input value of n should be at least 2.")
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.