开根号那个回文数可以减小复杂度,也同时能够反应整体情况
import math
x = input()
y=''.join([i for i in reversed(x)][1:])
num=int(x+y)
if num > 1: #质数大于1
for i in range(2,int(math.sqrt(num))):
if (num % i) == 0:
print('noprime')
break
else:
print('prime')
else:
print('noprime')