rewrite prime? and solve euler10