Loading [MathJax]/jax/output/HTML-CSS/jax.js

Monday, July 18, 2011

Continued fraction expansions of irrational square roots

I had no idea (until this Thursday, July 16) 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 α=D+PQ where D,P,QZ and D,Q>0. It is also possible (though not required) to ensure that Q divides DP2. 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 α=2+74 is reduced but 4 does not divide 722. However, if we write this as 8+11216, we have our desired condition.

Definition: We say a reduced quadratic irrational α is associated to D if we can write α=P+DQ and Q divides DP2


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 α=D+PQ and X=α, we have 1α=D(QXP)Q.

  • Since D is irrational, we must have 1α>0 and since 1α is the fractional part we know 0<1α<1α>1. 
  • Transforming α=QD(QXP)D+(QXP)D+(QXP)=D+(QXP)1Q(D(QXP)2), we have P=QXP and Q=1Q(D(QXP)2) and need to show QZ. But D(QXP)2DP2modQ and since α is associated to D, Q must divide this quantity, hence Q is an integer.
  • Since X=D+PQ is an integer and α is irrational, we know X<D+PQ hence P=QXP<D forcing ˜α<0.
  • Since α>1 we know X10X1. Thus ˜α=PDQ<0X1Q<D+(QXP)Q(D(QXP))<D(QXP)2˜α=D(QXP)1Q(D(QXP)2)<1 hence ˜α>1 and α is reduced.
  • Since Q=1Q(D(P)2), we know D(P)2QQ0modQ hence α is associated to D.

Thus α is both reduced and associated to D.


Lemma 2: There are finitely many reduced quadratic irrationals associated to a fixed D.

Proof: As above write an arbitrary reduced irrational as α=D+PQ.  Since α>1 and ˜α>1, we know α+˜α=2PQ>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 (this amount 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+1α0. From here, we will prove

  • α0 is a reduced quadratic irrational associated to D.
  • By defining ai+1=αi and αi=ai+1+1αi+1αi+1 is also a reduced quadratic irrational associated to D (assuming all α up until i are as well).


Since 1α0 is the fractional part of the irrational D, we have 0<1α0<1α0>1. By simple algebra, we have α0=a0+DDa20,~α0=a0DDa20. Since a0 is the floor, we know a0D<0~α0<0. Since DZD>1 and D>a0, we have 1<D+a0Da0<Da20a0D>(Da20)~α0>1. Thus α0 is a reduced quadratic irrational. Since P0=a0 and Q0=Da20=DP20, Q0 clearly divides DP20 so α0 is associated to D as well.

Following the recurrence defined, since each αi is a reduced quadratic irrational, each ai1. 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 αi1, the ai must be periodic as well, forcing the continued fraction expansion D=a0+1a1+1a2+ to be periodic.

Update: I posted this on

No comments: