429 
MECHANICAL DEVICE FoR TESTING MERSENNE NUMBERS 
FOR PRIMES. 
THos. 1. Mason. 
Lucas,* in a note in “‘Récreations Mathématiques,” gives a method 
4a+3__1 for primes. The purpose of this 
of testing numbers of the form 2 
note is to show how the labor of that method can be shortened, and how a 
machine could be constructed which would do most of the labor. If such a 
machine were constructed the labor of verifying the Mersenne numbers would 
be reduced to hours where it now requires weeks and months, for example, 
for numbers like 2!27—1. 
Lucas makes use of the following theorem: In order that the number 
gf1+3 
v= —1 shall be prime, it is necessary and sufficient that the congruence 
| —1=2 cos— (mod p), 
a 
aes 
shall be satisfied, that is, that 
(Ses. V ono oe. (cna , (mod p), 
shall be verified after the successive removal of the radical. In other words, 
if we form the set of numbers V,, 
Vo=1, Vi=3, V2=7, Vs=47, Vs=2207, . .. , 
such that each after the second is the square of the preceding diminished 
by 2 units, and then consider only the residues, modulo p, if the residue of 
the number V,, where n=4q+2, is zero the number p is prime. 
The process of Lucas makes use of the binary system of numeration. 
In this system multiplication consists simply in the longitudinal displacement 
of the multiplicand. It is evident also that the residue of the division of 
™ by 2"—1 is equal to 2", r designating the residue of the division of m 
by n; consequently, in trying 27—1, it is sufficient to operate upon numbers 
having at most 7 of the figures 0 or 1. Figure I gives the calculation of V4 
deduced from the calculation of V; by the formula 
Vi=V, —2 (mod 27— 1); 
the dark squares represent the units of different orders of the binary system 
*Tucas, Récreations Mathématiques, Vol. 2, pp. 230-235. 
