Odd squarefree semiprimes: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: Add Ruby) |
|||
Line 1,169: | Line 1,169: | ||
} |
} |
||
def semiPrimes(limit: Int): Seq[Int] = { // odd |
def semiPrimes(limit: Int): Seq[Int] = { // odd, squarefree generator |
||
def iter(primeList: Seq[Int], acc: Seq[Int]): Seq[Int] = { |
def iter(primeList: Seq[Int], acc: Seq[Int]): Seq[Int] = { |
||
val (start, primeList1) = (primeList.head, primeList.tail) |
val (start, primeList1) = (primeList.head, primeList.tail) |