  We study a dynamical system that was originally defined by Romik in 2008
using an old theorem of Berggren concerning Pythagorean triples. Romik's system
is closely related to the Farey map on the unit interval which generates an
additive continued fraction algorithm. We explore some number theoretical
properties of the Romik system. In particular, we prove an analogue of
Lagrange's theorem in the case of the Romik system on the unit quarter circle,
which states that a point possesses an eventually periodic digit expansion if
and only if the point is defined over a real quadratic extension field of
rationals.
