Continued fraction expansions of irrational square roots
I had no idea (until this Thursday, July 16 2011) that I had never seen a
proof of the fact that the continued fraction expansion of
D is periodic whenever D
is not a perfect square. But have no fear, I found out about something called a
reduced quadratic irrational and now have a proof. Here we go.
Definition:
An irrational root α of a quadratic equation
with integer coefficients is called reduced if
α>1 and its conjugate
α satisfies
−1<α<0.
■
Solutions (since assumed real) of such quadratics can be written
as
α=QD+P
where D,P,Q∈Z and
D,Q>0. It is also possible (though not required) to ensure
that Q divides D−P2. This is
actually a necessary assumption for some of the stuff I do, is mentioned
here
and generally frustrated the heck out of me, so that. As an example for some
enlightenment, notice
α=42+7
is reduced but 4 does not divide 7−22.
However, if we write this as 168+112, we
have our desired condition.
Definition:
We say a reduced quadratic irrational α is
associated to D if we can write
α=QP+D
and Q divides D−P2.
■
Lemma 1:
Transforming a reduced irrational root α
associated to D into its integer part and fractional part
via
α=⌊α⌋+α′1,
the resulting quadratic irrational α′ is reduced and
associated to D as well. (This is what one does during
continued fraction expansion, and as I did with 2
during my
last post.)
Proof:
Letting
α=QD+P
and X=⌊α⌋, we have
α′1=QD−(QX−P).
Since D is irrational, we must have
α′1>0 and since
α′1 is the fractional part we know
we have P′=QX−P and
Q′=Q1(D−(QX−P)2) and need
to show Q′∈Z. But
D−(QX−P)2≡D−P2modQ and since
α is associated to D,Q must divide this quantity, hence Q′
is an integer.
Since X=⌊QD+P⌋ is an
integer and α is irrational, we know
X<QD+P hence
P′=QX−P<D forcing
α′<0.
There are finitely many reduced quadratic irrationals associated to a
fixed D.
Proof:
As above write an arbitrary reduced irrational as
α=QD+P. Since
α>1 and
α>−1, we know
α+α=Q2P>0 hence
with the assumption Q>0 we have P>0.
Since α<0 we also have
P<D. Also, since α>1
by assumption we have Q<P+D<2D thus
there are finitely many choices for both P and
Q, forcing finitely many reduced quadratic irrationals
associated to a fixed D; the number of choices is strictly
bounded above by 2D. ■
Claim:
The continued fraction expansion of D is
periodic whenever D is not a perfect square.
Proof:
We'll use Lemma 1 to establish a series of reduced quadratic irrationals
associated to D and then use Lemma 2 to assert this
series must repeat (hence be periodic) due to the finite number of such
irrationals.
Write a0=⌊D⌋ and
D=a0+α01. From here, we will
prove
α0 is a reduced quadratic irrational associated to
D.
By defining ai+1=⌊αi⌋ and
αi=ai+1+αi+11,αi+1 is also a reduced quadratic
irrational associated to D (assuming all
α up until i are as well).
Since α01 is the fractional part of the
irrational D, we have
0<α01<1⇒α0>1.
By simple algebra, we have
α0=D−a02a0+D,α0=D−a02a0−D.
Since a0 is the floor, we know
a0−D<0⇒α0<0.
Since D∈Z⇒D>1 and
D>a0, we have
1<D+a0⇒D−a0<D−a02
hence
a0−D>−(D−a02)⇒α0>−1.
Thus α0 is a reduced quadratic irrational. Since
P0=a0 and Q0=D−a02=D−P02,Q0 clearly divides D−P02 so
α0 is associated to D as well.
Following the recurrence defined, since each αi is a
reduced quadratic irrational, each ai≥1. Also, by
Lemma 1, each αi+1 is reduced and associated to
D since α0 is. By Lemma 2, we only
have finitely many choices for these, hence there must be some smallest
k for which αk=α0.
Since αi+1 is determined completely by
αi we will then have
αk+j=αj for all j>0,
hence the αi are periodic. Similarly, as the
ai for i>0 are determined completely by
αi−1, the ai must be periodic
as well, forcing the continued fraction expansion