A   k-Almost-prime   is a natural number   



n


{\displaystyle n}

   that is the product of   



k


{\displaystyle k}

   (possibly identical) primes.



Example

1-almost-primes,   where   



k
=
1


{\displaystyle k=1}

,   are the prime numbers themselves.

2-almost-primes,   where   



k
=
2


{\displaystyle k=2}

,   are the   semiprimes.



Task

Write a function/method/subroutine/... that generates k-almost primes and use it to create a table here of the first ten members of k-Almost primes for   



1
<=
K
<=
5


{\displaystyle 1<=K<=5}

.



Related tasks

   Semiprime
   Category:Prime Numbers


go =>
  N = 10,
  Ps = primes(100).take(N),
  println(1=Ps),
  T = Ps,
  foreach(K in 2..5)
    T := mul_take(Ps,T,N),
    println(K=T)
  end,
  nl,
  foreach(K in 6..25)
    T := mul_take(Ps,T,N),
    println(K=T)
  end,
  nl.
 
% take first N values of L1 x L2 
mul_take(L1,L2,N) = [I*J : I in L1, J in L2, I<=J].sort_remove_dups().take(N).
 
take(L,N) = [L[I] : I in 1..N].