Add IsPrime from the book exercises