Sequence: nth number with exactly n divisors: Difference between revisions
Sequence: nth number with exactly n divisors (view source)
Revision as of 04:06, 28 June 2020
, 4 years ago→simple: use get_prime()
m (Phix/mpfr) |
m (→simple: use get_prime()) |
||
Line 836:
whereas a limit of 25 would need to invoke factors() 52 million times which would no doubt take a fair while.
<lang Phix>constant LIMIT = 24
constant LIMIT = 24
include mpfr.e
mpz z = mpz_init()
sequence fn = 1&repeat(0,LIMIT-1)
integer k = 1
printf(1,"The first %d terms in the sequence are:\n",LIMIT)
for i=1 to LIMIT do
▲ mpz_ui_pow_ui(z,primes[i],i-1)
printf(1,"%2d : %s\n",{i,mpz_get_str(z)})
else
Line 892 ⟶ 886:
24 : 1170
</pre>
===cheating slightly===
No real patterns that I could see here, but you can still identify and single out the troublemakers (of which there are about 30).
|