Using Ruby built-in prime generator.