f(x:s)=x:f[a|a<-s,mod a x>0] main=mapM print$take 61[p|p<-f[2..],and[any(==c)"2357"|c<-show p]]