/**************************************************************************
class nos
From: gross@math.harvard.edu
To: was@abel.math.harvard.edu
Date: Thu, 5 Jul 2001 21:20:36 -0400 (EDT)


Dear William,

Can you tabulate for me the class numbers of the sextic fields with
generating polynomial f(x) = x^6 - a*x - x^4 + (2a-1)*x^3 - x^2 - a*x + 1,
for a in the range 0 <= a <= 1000 (or higher, if you feel like it). They
have discriminant (16*a^4 - 4*a^3 - 128*a^2 + 144*a + 229)^2. I did this
for the first few values of a in gp, using bnfclassunit(), but I'm not sure
how one writes a program to do this in gp. You probably have a better way to
compute the class numbers anyhow. I'm only interested in whether they are
even or odd.

Thanks, Dick Gross

**************************************************************************/

R<x> := PolynomialRing(Rationals());

function ClassNoTest(a)
   assert Type(a) eq RngIntElt;
   f := x^6 - a*x - x^4 + (2*a-1)*x^3 - x^2 - a*x + 1;
   K := NumberField(f);
   "Creating Maximal order";
   time O := MaximalOrder(K);
   "Computing class number of O.";
"GRH";
   time h1 := ClassNumber(O : Proof := "GRH");
h1;
"Bound 2";
   O := MaximalOrder(NumberField(f));
   time h2 := ClassNumber(O : Proof := "Bound", Bound := 2);
h2;
"Subgroup";
   O := MaximalOrder(NumberField(f));
   time h3 := ClassNumber(O : Proof := "Subgroup");
h3;
"Conditional";
   O := MaximalOrder(NumberField(f));
   time h4 := #ConditionalClassGroup(O);
h4;
   return h1;
end function;


function ClassNoB2(a)
   assert Type(a) eq RngIntElt;
   f := x^6 - a*x - x^4 + (2*a-1)*x^3 - x^2 - a*x + 1;
   "f = ", f;
   K := NumberField(f);
   time O := MaximalOrder(K);
   time h := ClassNumber(O : Proof := "Bound", Bound := 2);
   return h, K;
end function;
