Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Number of divisors (D) of every number (N) can be calculated as:
D = (pow_0 + 1)*(pow_1 + 1)* ... *(pow_n + 1) (1)
where
pow_{i}
are powers of prime numbers in the source number (N
) factorization (N = prime_0**pow_0 + prime_1**pow_1 + ... + prime_m**pow_m
). Our task is to minimizeN
with fixedD
, so we should check all possible variants of powers which correspond to (eq. 1) and use the minimum possible prime number for maximum power.pow_variants
- returns all possible variants of powers which correspond to (eq. 1) sorted in descending order.math.prod(PRIMES[i]**p for i, p in enumerate(powers))
- returns minimal possible number for current powers combination