4 kyu

The smallest number with a given number of divisors

122 of 151user8729270

Description:

You have a natural number d.

You need to write a function f(d) which finds the smallest positive number n having d divisors .

For example:

f(1) = 1
f(3) = 4
f(60) = 5040
f(420) = 9979200

In this kata all the tests will be with 1 <= d <= 10000

Keep in mind that n can be on the order of 1030010^{300}, so iterating over n and finding the divisors in total for O(n(n)O(n\sqrt{\mathstrut n}) operations is not an option.

Good luck!

Mathematics
Recursion
Algorithms
Number Theory
Performance

Stats:

CreatedDec 3, 2022
PublishedDec 3, 2022
Warriors Trained1802
Total Skips81
Total Code Submissions5434
Total Times Completed151
Python Completions122
C# Completions9
JavaScript Completions27
Total Stars109
% of votes with a positive feedback rating97% of 33
Total "Very Satisfied" Votes31
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes0
Total Rank Assessments5
Average Assessed Rank
4 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
5 kyu
Ad
Contributors
  • user8729270 Avatar
  • hobovsky Avatar
  • MaGu Avatar
  • dfhwze Avatar
Ad