Ctrl K

Prime Budget, Full Divisors

Hard
You are given a positive integer budget. You build a positive integer n whose prime factorization (counting repeats) has at most budget factors. Call a divisor of n **full** if it is divisible by every prime that appears in the factorization of n. For example, n = 12 = 2 · 2 · 3 has the full divisors 6 and 12, while 3 and 4 are not full. Choose n to have as many full divisors as possible and return that count modulo 10⁹ + 7.
Example 1
budget=6 → 9

Take n = 2³ · 3³ = 216, which has six prime factors. A full divisor is 2ᵃ · 3ᵇ with 1 ≤ a ≤ 3 and 1 ≤ b ≤ 3, and there are 3 · 3 = 9 of them.

Example 2
budget=4 → 4

For example n = 2² · 3² = 36 has the full divisors 6, 12, 18 and 36.

Example 3
budget=1 → 1

n is a prime, and its only full divisor is n itself.

Constraints
  • 1 ≤ budget ≤ 10⁹
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsThe K-th Ordering of Digits HardPlus-Minus Calculator With Brackets HardHow Many Ones Are Written HardAmount in Words HardSimplify a Letter Polynomial Hard
loading Python…
Input
budget=6
Expected
9

Run checks the first 3 tests in your browser. Submit checks all 6 tests on the server, hidden ones included.