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



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



See also
 OEIS:A069654


Related tasks
 Sequence: smallest number with exactly n divisors
 Sequence: nth number with exactly n divisors‎‎


 
# The number of prime factors (as in prime factorization)
def numfactors:
  . as $num
  | reduce range(1; 1 + sqrt|floor) as $i (null;
       if ($num % $i) == 0 
       then ($num / $i) as $r
       | if $i == $r then .+1 else .+2 end
       else . 
       end );
 
# Output: a stream
def A06954:
  foreach range(1; infinite) as $i ({k: 0};
     .j = .k + 1
     | until( $i == (.j | numfactors); .j += 1)
     | .k = .j ;
     .j ) ;
 
"First 15 terms of OEIS sequence A069654: ",
[limit(15; A06954)]