Sequence: smallest number with exactly n divisors: Difference between revisions
Sequence: smallest number with exactly n divisors (view source)
Revision as of 15:39, 8 June 2019
, 5 years ago→{{header|Phix}}
Line 412:
elsif f[2]>2 -- (see note)
and f[$] = power(f[2],lf-1) then ri = power(product(get_primes(-(lf-1))),f[2]-1) -- p^k (eg f={1,3,9,27})
elsif
else populate_found(i) ri = found[i] -- do the rest manually
end if
printf(1,"%d->%d\n",{i,ri})
end for</lang>
Note: the f[2]>2 test should really be something more like >log(
apparently, but everything seems ok within the IEEE 754 53/64 bit limits this imposes.
It takes longer, afaict, to print the answers that it did to calculate them, tee hee!
{{out}}
|