So its been a while since I posted. I have to finish implementing 5 constraint problem search techniques for my AI class's Sudoku Solver project so this post will be short.
I have been browsing TopCoder in order to brush up on my programming skills. I ran across this problem that just wouldn't leave me alone. Its statement is really simple:
Given an positive integer k, find the smallest integer with exactly k divisors.
We denote this number by A(k).
Since we had learnt how to count the number of distinct positive divisors for a given prime factorization of a number in my combinatorics class,
(e.g. 2^2 x 3 x 5 = 60 has (2+1) (1+1)(1+1) = 12 distinct positive divisors. Here is a brief explanation ... to form a divisor you need a number that is some combination of multiples of 60's factors. You can either have 2, 4 or 1 as a first choice coming from the 2^2 => 3 choices , 3 or 1 coming from the 3 => 2 choices and 5 or 1 coming from the 5 => 2 choices. The total number of options you end up with is 3x2x2 = 12)
I noticed that the above problem was related to what we did. I proceeded to implement a solution to the above (it is not complete yet) in python based on Nick's puzzle 47.
In my shortsightedness, I didn't realize that there would have to be exceptions to my implementation. For some special types of k, there is a 1968 paper that categorizes solutions. I think I'm going to study the TopCoder solutions a bit more closely but my preliminary impressions are that they all search exhaustively rather than shortcut based on what kind of number k is (e.g. if k is prime then A(k) = 2^k-1).
Ok I should go work on backtracking Sudoku ... more update on this problem as I make progress.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment