These are chat archives for **Codewars/codewars.com/kata-solving-help**

Hmmm I really don´t get this one :

@natacha-beck you're not going to believe it

what ?

the result of this kata

!

Seriously I stuck

When I did it I laughed :smile:

```
def am_I_Wilson(p)
my_fact = fact(p-1) + 1
my_div = p*p.to_f
res = my_fact / my_div
res == res.ceil rescue true
end
def fact(n)
n == 0 ? 1 : n * fact(n-1)
end
```

For the moment I cry :(

I solved in Python I think

I´m stuck with big number

My logic seems to be not so bad

Let me remember the Wilson primes are the ones that

`(fact(p - 1) + 1 ) % p**2 == 0`

```
import math
def am_i_wilson(n):
if n <= 0:
return False
else:
return (math.factorial(n - 1) + 1 ) % n**2 == 0
```

failed

:(

The point is that you don't have a primality test in your code.

You may use Miller-Rabin test or the one that you prefer. In Ruby with

`require 'prime'`

you have the it in `isprime()`

Grhhhhhh!!!!! Thanks a lot got it in ruby

!!

:+1:

a 8 kyu seriously... it's easy but I passed too much time on it

thanks for the hint

But you didn't realize about the result?

```
def am_I_Wilson(p)
[5, 13, 563].include? p
end
```

!!!

It's a joke ?

There are only 3 Wilson Primes!!

Clever and best practice in ruby !

Moahha

Some users investigated at https://oeis.org/A007540 and got the result

ok I need a break after this kind of kata...! Thanks Raul for the help and for the reference

is really helpful and interesting

:+1: