Ad
  • Custom User Avatar
  • Custom User Avatar

    You should explain the math notations: not all users have a math-college background (hint: I don't ;) )

    Also names are not to be chosen randomly. If you can switch the function name from sum_not_prime to sum_prime without changing anything else, this means the name has nothing to do with the task (or one of them is totally wrong).

  • Custom User Avatar

    Sorry, this is my first attempt at creating a kata. I don't understand what the problem is in my description. Maybe you can help me?

  • Custom User Avatar

    The description still doesn't describe the actual task.

    What do the mathy shenanigans mean?

    also, sum_not_prime became sum_prime whithout any additional explanation: this smells absolutely bad for the quality of the description.

  • Custom User Avatar

    ready

  • Custom User Avatar

    ready

  • Custom User Avatar

    Also, the tags show there are performances requirements => theere should be some kind of info about that in the description. Typically (when relevant): number of tests, range of inputs, ...

  • Custom User Avatar

    The description still doesn't make any sense... When I see "sum not prime", I expect to sum non prime numbers. Obviously, the examples are showing something completely different. Please, properly explain the task.

  • Custom User Avatar

    What does this kata add that other kata's about primes haven't done before?

  • Custom User Avatar

    I enjoyed everything, it was an awesome challenge.

  • Custom User Avatar

    ready

  • Custom User Avatar

    ready

  • Custom User Avatar

    ready

  • Custom User Avatar

    Very confusing description. (Copy paste the markdown)

    Task :

    Hello, warrior!

    In this kata, you need to complete the function sum_not_prime, which takes two parameters :

    • max_prime.
    • max_num.
      and must return an array of length max_num where for each index 0 <= i <= max_num -1 :
    array[i] = \sum_{p \, \le max-prime, p | i} p
    

    Example :

    • sum_not_prime(10, 15)
      The primes that need to be considered : $2$, $3$, $5$ and $7$.

      1. With $p=2$ : [0, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2]
      2. With $p=3$ : [0, 0, 2, 3, 2, 0, 2+3=5, 0, 2, 3, 2, 0, 2+3=5, 0, 2]
      3. With $p=5$ : [0, 0, 2, 3, 2, 5, 5, 0, 2, 3, 2+5=7, 0, 5, 0, 2]
      4. With $p=7$ : [0, 0, 2, 3, 2, 5, 5, 7, 2, 3, 7, 0, 5, 0, 2+7=9]

      Final result : [0, 0, 2, 3, 2, 5, 5, 7, 2, 3, 7, 0, 5, 0, 9]

    Note :

    Although 0 % prime == 0, index 0 is always excluded from being updated.

  • Custom User Avatar

    The description isn't clear. I needed to study the example pretty carefully to figure out what needed to be done. For one thing, it should be clarified that the prime divisor is never added to the element at index 0, despite the fact that 0 % [prime] equals 0.

  • Loading more items...