Statistics of incomplete quotients of continued fractions of quadratic   irrationalities
  V.I. Arnold has experimentally established that the limit of the statistics of incomplete quotients of partial continued fractions of quadratic irrationalities coincides with the Gauss--Kuz'min statistics. Below we briefly prove this fact for roots of the equation $r x^2+p x=q$ with fixed $p$ and $r$ ($r>0$), and with random $q$, $q\le R$, $R\to \infty$. In Section 3 we estimate the sum of incomplete quotients of the period. According to the obtained bound, prior to the passage to the limit, incomplete quotients in average are logarithmically small. We also upper estimate the proportion of the "red" numbers among those representable as a sum of two squares. 
E. Yu. Lerner