Calculate the sequence where each term   an   is the smallest natural number that has exactly   n   divisors.



Task
Show here, on this page, at least the first  15  terms of the sequence.



Related tasks

 Sequence: smallest number greater than previous term with exactly n divisors
 Sequence: nth number with exactly n divisors‎‎


See also

 OEIS:A005179


CARD FUNC CountDivisors(CARD a)
  CARD i,count
 
  i=1 count=0
  WHILE i*i<=a
  DO
    IF a MOD i=0 THEN
      IF i=a/i THEN
        count==+1
      ELSE
        count==+2
      FI
    FI
    i==+1
  OD
RETURN (count)
 
PROC Main()
  DEFINE MAX="15"
  CARD a,count
  BYTE i
  CARD ARRAY seq(MAX)
 
  FOR i=0 TO MAX-1
  DO
    seq(i)=0
  OD
 
  i=0 a=1
  WHILE i<MAX
  DO
    count=CountDivisors(a)
    IF count<=MAX AND seq(count-1)=0 THEN
      seq(count-1)=a
      i==+1
    FI
    a==+1
  OD
 
  FOR i=0 TO MAX-1
  DO
    IF i>0 THEN
      Print(", ")
    FI
    PrintC(seq(i))
  OD
RETURN