A number is an   attractive number   if the number of its prime factors (whether distinct or not) is also prime.



Example

The number   20,   whose prime decomposition is   2 × 2 × 5,   is an   attractive number   because the number of its prime factors   (3)   is also prime.



Task

Show sequence items up to   120.



Reference

   The OEIS entry:   A063989: Numbers with a prime number of prime divisors.


import "/fmt" for Fmt
import "/math" for Int 
 
var max = 120
System.print("The attractive numbers up to and including %(max) are:")
var count = 0
for (i in 1..max) {
    var n = Int.primeFactors(i).count
    if (Int.isPrime(n)) {
        System.write(Fmt.d(4, i))
        count = count + 1
        if (count%20 == 0) System.print()
    }
}
System.print()