Primality by Wilson's theorem

From Rosetta Code
Revision as of 04:39, 1 January 2020 by rosettacode>A-ee (Better explained there)
Task
Primality by Wilson's theorem
You are encouraged to solve this task according to the task description, using any language you may know.
Task

Write a boolean function that tells whether a given integer is prime.

Remember that   1   and all non-positive numbers are not prime.

Use Wilson's theorem.