Skip to content

Instantly share code, notes, and snippets.

@dvberkel
Created April 13, 2012 11:58
Show Gist options
  • Save dvberkel/2376358 to your computer and use it in GitHub Desktop.
Save dvberkel/2376358 to your computer and use it in GitHub Desktop.
Magma code to determine Sophie Germain primes, which are excellent candidates for Brands scheme for the Mammon project.
bits := 32; batchSize := 100;
maxQ := -1;
for index in [1..batchSize] do
q := RandomPrime(bits - 1);
if q gt maxQ and IsPrime(2*q + 1) then
maxQ := q;
print 2*q + 1, q;
end if;
end for;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment