How to resolve the algorithm Wilson primes of order n step by step in the Phix programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Wilson primes of order n step by step in the Phix programming language

Table of Contents

Problem Statement

A Wilson prime of order n is a prime number   p   such that   p2   exactly divides:

If   n   is   1,   the latter formula reduces to the more familiar:   (p - n)! + 1   where the only known examples for   p   are   5,   13,   and   563.

Calculate and show on this page the Wilson primes, if any, for orders n = 1 to 11 inclusive and for primes p < 18   or, if your language supports big integers, for p < 11,000.

Let's start with the solution: