Calculate is a number is a prime number

A prime number is a number > 1 and cannot be produced from the product of two smaller numbers. For example 13 is prime, so 1 * 13 is its only factor. While 15 is not prime because 3 * 5 = 15.

Examples

isPrime(13); // true
isPrime(15); // false