procedure Eigenforms(k, prec)
   M := ModularForms(1,k);
   S := CuspidalSubspace(M);
   print "Computing T7";
   time T7 := HeckeOperator(S,2);
   print "T2 = ", T2;
   print "Computing charpoly T2";
   time f := HeckePolynomial(S,2);
   print "f = ", f;
   K<p> := pAdicField(7,prec);
   R<x> := PolynomialRing(K);
   print "Factoring charpoly(T_2) to precision", prec;
   time FAC := Factorization(R!f);
   print "FAC = ", FAC;
   print "Computing eigenforms";
   for i in [1..#FAC] do
      print "Evaluating T_2 to get eigenform", i;
      time h := &*[FAC[j][1] : j in [1..#FAC] | j ne i];
      time v := Evaluate(h,T2)[1];
      if v[1] eq 0 then
         error "The q-term is 0, which is nonsense!!!";
      end if;
      print "Dividing";
      time v := v/v[1];
      print "The eigenvalues [a2, a3, a5, ..., a_p], p<=dim(S_k), are:";
      print "The eigenvalues mod 7^11 are:";
      printf "f[%o] := %o;\n", i, [Integers()!v[p] mod 7^11: p in [2..Degree(v)] |IsPrime(p)];
      printf "slope[%o] := %o;\n\n", i, Valuation(v[2]);
   end for;
end procedure;


prec := 30000;

print "\n\n// k = 378";
//time Eigenforms(378,prec);

