#' Iterated Logarithm (Base 2)
#'
#' This function calculates the number of times the logarithm function (base 2) must be iteratively applied before the result is less than or equal to 1.
#' @param num - An integer.
#' @export iteratedLogarithm
#' @examples
#' iteratedLogarithm(4)
#' 2
iteratedLogarithm <- function(num) {
if (num<=1) {
return(0)
} else {
iterator=1+iteratedLogarithm(log2(num))
}
return (iterator)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.