Prime generator in Scala.