ELI5: Explain Like I'm 5

Wilson's theorem

Okay kiddo, let me tell you about Wilson's Theorem.

Wilson's Theorem is a special rule that helps us figure out if a number is prime or not, just by looking at it. It says that if a number (let's call it "p") is prime, then (p-1)! (which means to multiply all the numbers from 1 up to p-1) is one less than a multiple of p.

So what does that mean?

Well, let's say we have the number 5. We want to know if it's prime or not, but we don't want to go through all the trouble of trying to divide it by every number under the sun. So, we use Wilson's Theorem. We know that 5 is a prime number, so we take (5-1)! (which is 4 x 3 x 2 x 1 = 24) and we subtract one from it. What do we get?

24 - 1 = 23.

Now, since 23 is not a multiple of 5, we know that Wilson's Theorem holds true for 5, and therefore 5 is prime.

Pretty cool, right? It's like a secret code that helps us figure out if a number is prime or not, without having to do a ton of calculations. But remember, Wilson's Theorem only works for prime numbers - if you try to use it on a non-prime number, you might get a false result.
Related topics others have asked about: