fast prime generator in Java