Python: faster than 99.22% and Memory usage less than 100.00%
\nfrom math import trunc\nclass Solution:\n    def primePalindrome(self, k: int) -> int:\n\t"""\n\tFind the closest root from the number and start from there ra
```\nfrom math import trunc\nclass Solution:\n    def primePalindrome(self, k: int) -> int:\n\t"""\n\tFind the closest root from the number and start from there rather than start from the first for all numbers\n\t"""\n        if k < 12:\n            for i in range(1, 12):\n                if self.__is_prime(i) and i >= k:\n                    return i\n        else:\n            string_k = str(k)\n            string_length = len(string_k)\n            if string_length % 2 == 0:\n                starting_root = str(10**(string_length-trunc(string_length/2)))\n                for root in range(int(starting_root), 10**6):\n                    palindrome_gen = int(str(root) + str(starting_root)[-2::-1])\n                    if self.__is_prime(palindrome_gen) and palindrome_gen >= k:\n                        return palindrome_gen\n            else:\n                starting_root = string_k[:string_length-trunc(string_length/2)]\n                for root in range(int(starting_root), 10**6):\n                    palindrome_gen = int(str(root) + str(root)[-2::-1])\n                    if self.__is_prime(palindrome_gen) and palindrome_gen >= k:\n                        return palindrome_gen\n\n\n    def __is_prime(self, num):\n        if num == 1:\n            return False\n        for i in range(2, int(num**0.5)+1):\n            if num % i == 0:\n                return False\n        return True\n```
[]