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.


using Primes
 
# oneliner is println("The attractive numbers from 1 to 120 are:\n", filter(x -> isprime(sum(values(factor(x)))), 1:120))
 
isattractive(n) = isprime(sum(values(factor(n))))
 
printattractive(m, n) = println("The attractive numbers from $m to $n are:\n", filter(isattractive, m:n))
 
printattractive(1, 120)
 