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


10 DEFINT A-Z
20 FOR K=1 TO 5
30 PRINT USING "K = #:";K;
40 I=2: C=0
50 F=0: P=2: N=I
60 IF F >= K OR P*P > N THEN 100
70 IF N MOD P = 0 THEN N = N/P: F = F+1: GOTO 70
80 P = P+1
90 GOTO 60
100 IF N > 1 THEN F = F+1
110 IF F = K THEN C = C+1: PRINT USING " ###";I;
120 I = I+1
130 IF C < 10 THEN 50
140 PRINT
150 NEXT K