An Algorithm for Testing the Primality of any Integer