Ad
  • Custom User Avatar

    The kata was retired in the meantime, so don't put too much effort in fixing it...

  • Default User Avatar

    You are right! Sorry for abruptly dismissing your criticism. I have gone and fixed this in the code and updated the test cases.

  • Default User Avatar

    It seems you are confusing prime factors with factors/divisors. I will update the Kata description to make this distinction more clear.

  • Default User Avatar

    I'll add some when I figure out how. This is my first published Kata so I am still learning the mechanics. :)

  • Default User Avatar

    2 is the largest prime factor of 8, not the largest factor. My usage of the term is not wrong. Please see here: https://www.splashlearn.com/math-vocabulary/division/divisor

  • Custom User Avatar

    @PBearson, your solution is wrong, because you need to check prime factors in range(start, end+1), not in range(start, end), because in Python range works as [start, end).

  • Custom User Avatar

    no random tests

  • Custom User Avatar

    I think you either mix factor with divisor, or your calculation is wrong:

    i      =  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]
    S(i)   =  [0, 1, 1, 2, 1, 3, 2, 5, 3, 2, 3, ...]
    

    Let's take i = 8

    8 = 2 * 2 * 2  -->  largest factor = 2, so j = 2
    S(j-1) + S(j-2) = S(1) + S(0) = 1 + 0 = 1   <--  but you have 3 in your list
    

    however, if I use the largest divisor:

    8  -->  largest divisor = 4, so j = 4
    S(3) + S(2) = 3
    

    But the 2nd approach fails for your fixed tests 916 and 1521...

  • Custom User Avatar

    why so long?