intrinsic RationalGame(size::RngIntElt, trunc::RngIntElt)  
              -> FldPrElt, FldRatElt
{}
   n := Random(10^size);
   repeat
      d := Random(10^size);
   until d ne 0;
   a := n/d;
   R := RealField(trunc+size+10);
   x := R!(n/d);
   x := Round(x*10^trunc) / (R!10)^trunc;
   return x, a; 
end intrinsic;

intrinsic Conv(a::SeqEnum) -> SeqEnum
{The partial convergents p_n/q_n associated to the continued fraction a. 
The answer sequence c has the property that c[n+1] is p_n/q_n.}
   p := a[1];  // p0
   pp := 1;
   q := 1;     // q0
   qq := 0;
   c := [p/q];
   for i in [2..#a] do
      np := a[i]*p + pp;
      nq := a[i]*q + qq;
      Append(~c,np/nq);
      pp:= p;
      p := np;
      qq:= q;
      q := nq;
   end for;
   return c;
end intrinsic;

intrinsic cf(a::.) -> SeqEnum
{}
   return ContinuedFraction(a);
end intrinsic;
