Ad
  • Default User Avatar

    done

  • Default User Avatar

    I think that the first line of the instructions would be better phrased as:
    'Let be n an integer coprime with 10 e.g. 7.'

  • Default User Avatar

    The description says to return 'null' in C#, 'None' in Rust, etc. It doesn't say anything about return types in R.

    I think your point stands for the 'R' version though, because it is disproportionately difficult in R for an 8 Kyu kata - no beginner R programmer is going to think of the difference in return types between 'return(NULL)' and 'return(NA)'.

    I agree with you that the R version really needs a hint to use an 'NA' return type.

  • Default User Avatar

    My bad - I mixed up Wilson numbers (which include 1) and Wilson primes (which do not).

  • Custom User Avatar

    But 1 is not a prime at all, and Wilson primes are prime numbers with additional restriction. Since 1 is not a prime number, it cannot be a Wilson prime?

  • Default User Avatar

    In Python the test case P = 1 gives an incorrect result of False.

    This should be True.

    ((P-1)! + 1) / (P * P)
    ((1-1)! + 1) / (1 * 1)
    = ((0)! + 1) / (1 * 1)
    = (0! + 1) / 1
    = (1 + 1) / 1
    = 2 / 1
    = 2

    Since the result is an integer, P = 1 is a Wilson Prime is True and the test case should pass.