Author: Vincent Diepeveen
Date: 08:12:52 05/27/05
Go up one level in this thread
A retry : // Diepeveen test to find mersenne primes // test whether p is prime p = 2^n - 1 // when given n is prime t = 3; for( j = 1 ; j < n ; j++ ) t = t*t; // mod p if( t == p-3 ) printf("prime\n"); else printf("composite\n"); 3 9 19 20 28 <==> p-3 = 31 - 3 = 28 Vincent
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.