4 kyu

The smallest number with a given number of divisors

128 of 163user8729270

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 Trained1839
Total Skips82
Total Code Submissions5496
Total Times Completed163
Python Completions128
C# Completions11
JavaScript Completions32
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