Add isPrime function in Number

Added isPrime to Number to check if it is prime or not.