`modulus` <- function(n){ # Here 'n' is the modulus.
# Workflow modelled on sol() in the lorentz() package
if(missing(n)){ # An empty argument returns the working modulus, just like in the lorentz package sol() returns speed of light
return(getOption("M"))
} else { # working modulus, n, supplied
stopifnot(is.numeric(n))
stopifnot(length(n)==1)
stopifnot(n==round(n))
stopifnot(n>1)
options("M" = n)
options("phi" = numbers::eulersPhi(n))
options("prompt" = paste("Modulo(", n, ") > ",sep=""))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.