factor out IsPalindrome()

to euler package