Removed integers and placed long, after 19 entered digits, the program is broken, returns the try/catch error statement.

Also replaced isPrime from 2 * i to Math.pow(i,2)