gcd and palindrome