/*****************************************
  tabulate the triples

       { (a_2(f)-a_2(f_o))/3,    (a_5(f)-a_5(f_o))/3,
(a_7(f)-a_7(f_o))/3 }

  that you get in (F_3)^3. 
******************************************/

function div3(x)
   case x:
      when 0:
         return Integers(3)!0;
      when 3:
         return Integers(3)!1;
      when 6: 
         return Integers(3)!2;
      else
         error "div3: Can not divide by 3!";
   end case;
end function;

function mod3vec(f1,f2)
   return [div3(Coefficient(f1,i)-Coefficient(f2,i)) : i in [2,5,7]]; 
end function;
