From 982c42cb20f6a6797ea0ce5c5a8c1a040b170d65 Mon Sep 17 00:00:00 2001 From: Felix Laurie von Massenbach Date: Tue, 27 May 2014 12:55:20 +0100 Subject: Try skipping over the adding and just picking a new random number. Generates a number coprime to 2, 3, 5, 7, 11. Speed: Trial div (add) : trial div (retry) : coprime 1 : 0.42 : 0.84 --- tools/primes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/primes.py b/tools/primes.py index c4be13baae..61de99f000 100644 --- a/tools/primes.py +++ b/tools/primes.py @@ -1,7 +1,7 @@ -primes = [2, 3, 5, 7] -safe = True +primes = [2, 3, 5, 7, 11] +safe = False # Not sure if the period's right on safe primes. -muliplier = 1 +muliplier = 1 if not safe else 2 for p in primes: muliplier *= p -- cgit v1.2.3