Markoff Numbers, Principal Ideals and Continued Fraction Expansions