Draft

Composed Integers Having Prime Factors Only Once

34 of 49raulbc777
Description
Loading description...
Fundamentals
Mathematics
Algorithms
Data Structures
  • Please sign in or sign up to leave a comment.
  • dfhwze Avatar

    JS Fork solving the issue everyone encountered.

  • Blind4Basics Avatar
    • no fixed or random tests with nMax < 6
    • the status of 0 and 1 should be clarified (or explicitely excluded from the input range)
  • saudiGuy Avatar

    Tests should not print to stdout.

  • ejini战神 Avatar

    Description should be language-agnostic

  • user1430804 Avatar

    marginally passed in 9 seconds.. :)

  • FArekkusu Avatar

    The output format should be changed to something more reasonable than what it is now.

  • FArekkusu Avatar

    Test framework and solution should be imported explicitly in Python.

  • FArekkusu Avatar

    Tests shouldn't log anything.

  • FArekkusu Avatar

    New test frameworks should be used in all languages.

  • anter69 Avatar

    I'm afraid that @ChristianECooper's comment is still valid: 1 should not be included (not a compound, etc). I know that this exception is mentioned in the example, but it's just not right... and if you really stick to it, state it clearly in the description, not "hidden" in the example.

    Furthermore, the description should specify if the upper limit has to be included or not (based on the tests, not).

    Oh, I suggest to make the example shorter, to make it less cluttered: e.g. up 50.

    Cheers

  • ITSOES Avatar

    Why aren't primes counted? Their prime factors are themselves.

  • smile67 Avatar

    Hi Raul, just submitted a JS solution, but i think there's an error in your testcases, for example look here:

    :
    nMax = 973 (1 Passed, 0 Failed)
      nMax = 880 (1 Passed, 0 Failed)
      nMax = 529 (1 Passed, 0 Failed)
      nMax = 967
    ✘ Expected: '[{ \'amount numbers\': 426 }, { \'total Sum\': 213164 }, { odd: 230 }, { even: 196 }]', instead got: '[{ \'amount numbers\': 425 }, { \'total Sum\': 212197 }, { odd: 229 }, { even: 196 }]'
     Completed in 5ms
    : 
    

    As you can see, there's always a difference of one odd number which is your nMax number only if it is a prime number. Your solution adds this nMax prime number, but this isn't correct. My code does it too, to pass your tests - so will get invalid after your correction;-). Later on i will pass a correct version too...

  • ChristianECooper Avatar

    I hate to be that guy, but... :)

    The inclusion of 1 in your example as following this rule is invalid, it has no prime factors! :)