Learn R Programming

blocksdesign (version 3.6)

isPrime: Prime number test

Description

Tests if a given number v is prime and returns TRUE or FALSE

Usage

isPrime(v)

Arguments

v

is the number to be tested for primality

Value

logical TRUE or FALSE

Details

primality of any positive integer based on the fact that all primes except 2 and 3 can be expressed as 6k-1 or 6k+1

Examples

Run this code
# NOT RUN {
isPrime(731563)
isPrime(7315631)
 
# }

Run the code above in your browser using DataLab