How to calculate smallest number with certain number of divisors?

前端 未结 9 1379
野性不改
野性不改 2020-12-29 07:51

From Project Euler problem 500

The number of divisors of 120 is 16. In fact 120 is the smallest number having 16 divisors.

Find the smalle

9条回答
  •  攒了一身酷
    2020-12-29 08:11

    The Prime Factorization (PF), in abbreviated form, for the smallest integer having 2**500,500 divisors is shown below:

    2**31 * (3...7)**15 * (11...47)**7 * (53...2,713)**3 * (2,719...7,370,029)
    

    The smallest positive integer having 2^n divisors is the product of the sequence of the first n primes and powers of primes. Powers of primes (pp) are primes raised to the 2^(2^e) power (powers are 2,4,8,16...). First 3 pp are 4,9 and 16 (2^2,3^2 and 2^4).

    Since only prime factors are used in a PF, you will notice that the pp are aggregated with the prime factors. For n = 500,550 here are some stats or counts: 5 terms in the PF (powers 31,15,7,3,1). Total Primes (P) = 500,084 Powers of primes(pp) = 416 Total P + pp = n = 500,500 See theorem above.

    Single primes (the last term of the PF) total 499,688.
    

    You can calculate this PF (and others for 2^n) using Sage Math and Excel (although with Excel you'll need a prime counting function).

    Also, you should check your PF solution. This can be done several ways by assigning weights to the various pp and single primes to check the original n.

提交回复
热议问题