diff --git a/scala/Problem7.scala b/scala/Problem7.scala new file mode 100644 index 0000000..0bf0b96 --- /dev/null +++ b/scala/Problem7.scala @@ -0,0 +1,4 @@ +lazy val ps: Stream[Int] = 2 #:: Stream.from(3).filter(i => + ps.takeWhile(j => j * j <= i).forall(i % _ > 0)) + +val r = ps(10000)