5 kyu

Following the Paths of Numbers Through Prime Factorization

128 of 166raulbc777
Description
Loading description...
Mathematics
Data Structures
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Great math kata to have some fun with by the way.

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • ASchreiber Avatar

    At least Python: All test cases count 1 extra divisor, which is wrong.

    Even the kata description is wrong: there are 70 not 71 factors in the example list: [2, 3, 4, 5, 6, 8, 9, 10, 12, 13, 15, 18, 20, 24, 25, 26, 30, 36, 39, 40, 45, 50, 52, 60, 65, 72, 75, 78, 90, 100, 104, 117, 120, 130, 150, 156, 180, 195, 200, 225, 234, 260, 300, 312, 325, 360, 390, 450, 468, 520, 585, 600, 650, 780, 900, 936, 975, 1170, 1300, 1560, 1800, 1950, 2340, 2600, 2925, 3900, 4680, 5850, 7800, 11700].

  • ejini战神 Avatar
    • JS Node 14 should be enabled

    • Python new test framework should be used

  • ejini战神 Avatar
    • Description should be language-agnostic

    • The upper bound of output should be specified at least ( or mention about performance requirements )

  • Prathamesh24 Avatar

    My code is working properly after clicking on the test button but I'm getting the message as 'execution timed out' after clicking on the attempt button.

  • zhaoxiaojia Avatar

    time out .How to fix it

  • Paul.s.sh Avatar

    Testing for: [ 1301 ]
    Expected: [1301, 1, 1301, 1]

    In accordance to task conditions:
    [1301 - number, to which the prime factorization belongs
    1 - divisors count
    1301 - min divisor
    1 - max divisor]

    How it's possible?? 1 and 1301 shouldn't be taken into account. That's why the result array must be like [1301, 0, 0, 0]. Who can explain?

  • gillmatic Avatar

    I'm a little stuck on this one. I can get the first 3 parts, but my max divisor is wrong, even though I'm dividing the same product by the same minimum divisor, which mathematically should get me the max divisor?

    For example:

    [640210194275124949, 53, 7, 91458599182160704] should equal [640210194275124949, 53, 7, 91458599182160707]

    My own IDE returns 91458599182160704 as the max divisor, so I'm not totally sure what's going on

  • raulbc777 Avatar

    Enabled for python 2 and 3!

  • raulbc777 Avatar

    It will be enabled for Python 3 soon.

  • Firefly2002 Avatar

    JavaScript translation submitted. Numbers are limited to 2**53, but other than that it's the same :)

  • Voile Avatar

    Approved

  • jungerstein Avatar

    I am sorry, but your test cases failed to count the factors in the way as in the kata description. Please consider to revise them so that at least they agree.

    For example, in your case of 297, the factors that you want to count is

    3 9 11 27 33
    99 
    

    There is still 1 and 297, but they are not expected to be counted, as you said

    (not considering 1 and the integer 23400 itself)

    Thence the second item of the answer should be 6, instead of your given 7.

    UPDATE

    I found your definition of 'total divisors' (= prime + compound) agree with the test cases. All you need to change is the list in the example of 23400 in your kata description.