isPrime | R Documentation |
Determine if a number is a prime number
isPrime(x, div_v = T, print_v = T)
x |
number to test |
div_v |
boolean determining if divisors should be output or not. |
print_v |
boolean determining if answer should be printed to console |
list. 1st element - boolean of if x is prime or not. 2nd element - vector of divisors, if specified
test_v <- c(2, 10, 17, 567, 5678)
sapply(test_v, isPrime)
sapply(test_v, function(x) isPrime(x, print_v = F, div_v = F))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.