PrimeFactorsKata in Scala