Sha256: 5a31edd767743032377fea82fa594530170d76467c229e43f27e55fdcef8c060

Contents?: true

Size: 216 Bytes

Versions: 168

Compression:

Stored size: 216 Bytes

Contents

collatz <- function(num) {
  if (num <= 0)
    stop("num must be positive")
  else if (num == 1)
    return(0)
  else if (num %% 2 == 0)
    return(1 + collatz(num / 2))
  else
    return(1 + collatz(3 * num + 1))
}

Version data entries

168 entries across 168 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.179 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.178 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.177 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.176 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.175 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.174 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.173 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.172 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.171 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.170 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.169 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.167 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.166 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.165 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.164 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.163 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.162 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.161 tracks/r/docs/SNIPPET.txt
trackler-2.2.1.160 tracks/r/docs/SNIPPET.txt