x=2 while x<2e4: if`x`==`x`[::-1]and~-2**x%x<2:print x x+=1