add function isPerfectSquare using mpz_perfect_square_p