previous up next
Previous: 2 Confrac expansion of Up: Patterns Occurring During the Next: 4 Patterns

3 Confrac expansion of a quadratic integer

Definition 3.1   A number maths is said to be a quadratic surd when there exist maths-integers maths such that maths is not a perfect square and maths is a root of the polynomial maths. In such a case, we can additionally require that maths and maths are coprime. This unique polynomial is said to be "associated" to maths. When maths, we say that maths is a quadratic integer.

To any polynomial maths, defined as maths, we associate the matrix maths. With this convention, we have:

maths

Lemma 3.2   The action of the fractional-linear transform maths over the polynomial maths, defined by:

maths

can also be obtained as:

maths

In the special case maths, we have following formulae:

maths (3.1)

Both polynomials have the same discriminant and maths are coprime if and only if maths are coprime.

Proof. The last result comes from maths. maths

Lemma 3.3   Let maths be a quadratic surd and consider the "complete quotients" maths defined in 2.1. Then it exists a rank maths where maths, and this relation remains true for all maths. The corresponding polynomials are said to be reduced.

Proof. Since maths, the confrac expansion of these numbers must become different somewhere. If, for a given maths, we have maths then maths. On the contrary, maths implies maths so that maths. In any case, we have a maths such that maths.

Using formulae 3.1, we have maths, maths, maths and, since maths, maths. Thus maths is a reduced polynomial and, by induction, all the maths where maths. maths

Lemma 3.4   Let maths be a quadratic surd and maths a rank where maths. Define maths and maths. Then, for all maths,

maths

Proof. This result is obvious and nevertheless useful. maths

Theorem 3.5   The confrac expansion of a real number is (ultimately) periodic if and only if this number is a quadratic surd.

Proof. Let us suppose the periodicity, i.e. the existence of indices maths such that maths. We have maths and therefore, the number maths is a fixed point of the fractional-linear transform maths. Since

maths (3.2)

maths is a quadratic surd, and so is maths as a fractional linear function of maths.

The converse part follows from lemma 3.3 and proposition 3.6. maths

Proposition 3.6   The confrac expansion of a quadratic surd maths is purely periodic if and only if maths and the associated polynomial maths is reduced.

Proof. By lemma 3.3, all the maths are reduced when maths is reduced. These polynomials share the same discriminant maths and verify maths. Thus maths and maths are divisors of maths. The number of such polynomials is therefore finite, we must have maths for some maths and the (ultimate) periodicity is proven. If maths, we have maths. Thus maths can be obtained by a maths-translation acting over maths. These polynomials being reduced, this translation can only be the identity. By induction, we arrive to maths and therefore to maths as required.

On the contrary, if the confrac expansion is purely periodic, maths has to verify maths for some maths. Since maths, we must have maths. Describing maths as maths, the polynomial maths is proportional to maths. From theorem 2.6, we have maths, maths and maths. This implies that the other root lies in maths. maths

Proposition 3.7   Let maths be a quadratic surd, maths a matrix such that maths. If maths verifies conditions 2.7, the confrac expansion of maths is purely periodic and maths is a power of maths where maths is the (smallest) period of maths.

Proof. Verifying 2.7, the matrix maths is decomposable as a product maths. By the unique factorization theorem, the confrac expansion of maths is maths. But any period is obtained by repetition of the fundamental period and the property follows. maths

Proposition 3.8   When maths is a square-free natural integer and maths, the set of the quadratic integers that belong to maths is maths, i.e. the set of the maths where maths are maths-integers. When maths, this set enlarges to maths, i.e. the set of the maths where maths are maths-integers with the same parity.

Proof. Well known fact. maths

Definition 3.9   The maths will be referred as quadratic integers of the first kind, while the maths where maths are odd and maths will be referred as quadratic integers of the second kind. Defining maths as maths, the discriminant of the associated polynomial is maths in the first case, and maths in the second case.

Notation 3.10   The following notations will be used :

maths (3.3)

One has maths when maths (i.e. maths odd) and maths when maths (i.e. maths even).

Proposition 3.11   The length of the non periodical part of the confrac expansion of a quadratic integer is at most maths. Moreover, the expansions of maths and of maths (when maths) are purely periodic.

Proof. By definition of maths and maths, we have maths and maths. From proposition 3.6, the expansions of maths and maths are purely periodic. By maths-translations, this result can be propagated to all other quadratic integers. maths

Theorem 3.12   The confrac expansion of a quadratic integer is palindromic. More precisely: for each maths not being a perfect square, it exists an integer sequence maths and if maths another integer sequence maths such that
maths maths maths  
maths maths maths  

Additionally, maths (resp. maths) occurs only at a period boundary (maths, resp. maths).

For others quadratic integers, the period starts with the palindromic part. For example:

maths maths maths  
maths maths maths  

Proof. If we suppose that the expansion of maths is purely periodic, we have

maths

where maths and the matrix maths is a (may be empty) product of matrices maths. Thus maths is a root of the polynomial

maths

Since maths is a quadratic integer, the coefficients have to be maths-integers. Especially, maths. From theorem 2.6, we have maths and maths or we have maths and maths, so that maths. In any case, we have maths and maths is symmetrical. Since each matrix maths is symmetrical, we have maths. By theorem 2.6, such a factorization is unique, proving the palindromic property in the special case of maths or maths. By maths-translations, this result can be propagated to all other quadratic integers.

Let maths be a quotient occurring in the confrac expansion of maths. We have maths from 3.10 and maths from 3.4. Since all maths are even, we obtain that maths. Therefore maths implies maths and maths, i.e. maths.

Finally, let maths be a quotient occurring in the confrac expansion of maths. We have maths from 3.10 and maths from 3.4. Since all maths are odd, we obtain that maths. Therefore maths implies maths and maths, i.e. maths. maths

Definition 3.13   It is convenient to introduce the elementary matrices:

maths

The transformations corresponding to these matrices are maths and maths.

Theorem 3.14   Let maths as in theorem 3.12. Then

maths (3.4)

Moreover, this relation is characteristic, i.e. does not occur for any other maths. The same palindromic property holds for the polynomials related to maths.

Proof. Concerning maths, the property is obvious if maths, i.e. maths. Otherwise, define maths, maths for maths, maths for maths and go to infinity using maths. Construct maths, maths, maths and so on. For integer values of maths, the maths are the polynomials of proposition 3.6, while maths.

For any polynomial maths, we have maths and therefore the relation

maths (3.5)

holds when maths. Since maths and maths, relation 3.5 is extendable by induction to all maths, maths.

When maths is even, we have maths. Therefore

maths

the first relation by 3.5 and the second by the recurrence formula. This leads to maths and the property holds. When maths is odd, we have maths. Therefore

maths

This leads to maths as required.

Conversely, if maths holds when maths, an obvious recurrence shows that the sequence of quotients maths will conduct back to maths : maths and maths are periods of the confrac expansion of maths and we must have maths. The odd case is similar.

In the maths case, the parity of maths becomes odd and a slight change has to be done. If maths, we define maths, maths, and others maths as before. Then maths, while maths, and relation 3.5 starts to be true at maths instead of maths. Everything else remains unchanged. maths

Example 3.15   This proof is exemplified in FIG. 3.1 where maths.

FIG.  3.1: Action over polynomials : the case maths.
maths

Algorithm 3.16  

By theorem 3.14, we can stop the computation of the successive quotients associated to maths (or maths) when we encounter the palindromic property 3.4 and complete the period by symmetry. Using 3.4, we obtain LISTING 2, where maths is either maths (first kind) or maths itself when maths (second kind).


maths

Proposition 3.17   If the period length of maths is odd (even pattern, without middle element), then maths is explicitely obtained as a sum of two squares. Therefore the square-free part of maths cannot contain any prime maths.

Proof. This follows from theorem 3.14. Here maths is even and maths with maths. Thus maths. maths

Proposition 3.18   When maths is prime, maths is odd (and polynomial maths gives an explicit decomposition of maths as a sum of squares).

Proof. Here again, the idea is to embed the process acting over the maths into another process. Let us consider the set maths:

maths

and define maths by

maths

In other words, iterating maths is : iterate maths as much as you can, then do a (single) maths and repeat. It is clear that a polynomial having its both roots in maths could not be a maths. Conversely, a polynomial maths is a maths or a maths according to maths or not.

Let us start with maths (formerly designed as maths) and consider the sequence maths. It is obvious that polynomials obtained by a maths-move are the reduced polynomials maths occurring in the confrac expansion of maths. In theorem 3.14, the existence of a maths minimal such that maths has been proven. Thus

maths (3.6)

holds when maths and therefore for all maths, maths. At the center of the loop, it exists a maths such that either

maths

Assuming (i) leads to maths, but all maths are odd. Assuming maths leads to maths, so that maths. Since maths is prime, we should have maths, i.e. maths. But maths is minimal. The occurrence of (iii) is therefore proven and we have maths. Therefore, the reduced polynomial verifies the characteristic property of maths in 3.14 and the period of maths is odd. maths

Remark 3.19   The period length of the maths process relative to maths is: maths. When maths is prime, maths is even and maths. Since maths is ever odd, this period length is even, explaining the non-occurrence of case (i).

Remark 3.20  

The algorithm described by proposition 3.18 is not the most efficient to decompose a prime (maths) into a sum of squares. Euclidean algorithm is indeed fast... relative to the size of maths, but the pattern can be huge relative to maths. This problem is addressed by the Cornacchia algorithm.


previous up next
Previous: 2 Confrac expansion of Up: Patterns Occurring During the Next: 4 Patterns


douillet@ensait.fr
2004-02-06