Is Prime Function

Summary

Returns true if the number n is prime, false otherwise.

Syntax

isprime(n)

Usage

The isprime function returns true if the input is prime and false otherwise. For example, given the input of 13 the function returns true since is a prime number.

 isprime(13) = true

Examples

 isprime(2) = true
 isprime(3) = true
 isprime(4) = false
 isprime(5) = true
 isprime(6) = false