Skip to content

Instantly share code, notes, and snippets.

@dvberkel
Created April 10, 2012 09:57
Show Gist options
  • Save dvberkel/2349984 to your computer and use it in GitHub Desktop.
Save dvberkel/2349984 to your computer and use it in GitHub Desktop.
Magma code to determine possible candidates for Brands scheme for the Mammon project in a random fasion
bits := 32; batchSize := 100;
p := -1; maxQ := -1;
for i in [1..batchSize] do
p := RandomPrime(bits);
phi := EulerPhi(p);
factors := Factorization(phi);
q, _ := Max([factor[1] : factor in factors]);
primitiveCount := EulerPhi(phi);
if (q gt maxQ) then
maxQ := q;
printf "%o, %o, %o\n", p, factors, primitiveCount;
end if;
end for;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment