Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def is_simple(n):
- if( n%2 == 0):
- return False
- i = 3
- k =math.sqrt(n)
- while n%i != 0 and i <= k:
- i = i+2
- return n%i != 0
- def is_polyndrom(n):
- a = []
- while n > 0:
- d = n%10
- n = int(n/10)
- a.append(d)
- return a[::1] == a[::-1]
- n = int(input())
- while is_polyndrom(n) == False or is_simple(n)==False:
- n=n+1
- print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement