Previous: 4 Patterns
Up: Patterns Occurring During the
Next: 6 Other Sections
The idea to examine the relations between the lengths of
and
is not new. For example, the special case
has been studied in [11].
Lemma 5.1
For all

having
the same parity and

, we have
Proof.
When

are even, there is nothing to prove. Otherwise, we
have

and

.
And the conclusion follows from

.
Theorem 5.2
For all

, not a perfect
square,

is

-conjugated to

. For all

,

is

-conjugated to either

or

.
Using notations
3.10, we have:
 |
(5.1) |
Proof.
Put

and

. Then, by proposition
4.4, we have:
proving that

.
But

can be written as

, where

and, using again
4.4, the matrix

belongs to

. This matrix verifies
also the other prerequisites of proposition
3.7,
so that

for some

.
Similarly, we have
proving that

.
If

is even,

can be written as

, where

. Thus

and, as above,

for some

. This leads to

.
Applying theorem
2.6, we obtain

and therefore

.
In the remaining case (
odd), lemma 5.1
shows that
.
From proposition 3.7,
for some
. Applying again theorem 2.6,
we obtain
. Since
is not possible,
we have
i.e.
.
Corollary 5.3
For a given

, not a square,

.
Proof.
We have

by
5.1 and

.
Definition 5.4
Let us call

(letters) the set

where
 |
(5.2) |
When computing products like

where

,
we will call

and

(respectively) "

"
and "

".
Lemma 5.5
Given

and the parity of

,
it exists one and only one suffix

such that

.
Moreover, the following formulae hold for the remaining six possibilities:
 |
(5.3) |
Proof.
Direct inspection.
Lemma 5.6
Let

be a pattern,

be a permutation of

and

an odd integer such that all
three matrices

belong to

. Then

and

don't occur while
the remaining possibilities are characterized by
Proof.
Direct inspection.
Algorithm 5.7 (Transcode)
. The automaton
described L
ISTING 3 can be summarized
as:
It takes for input a list of positive integers and gives for output
three lists of natural integers. The way each element of the
initial list is translated depends on both the parity of the element
and the current state of the automaton. After each elementary translation,
the internal state is updated to another of the 6 permutations of
the set

according to the rules:
| actual state |
ABC |
ACB |
BAC |
BCA |
CAB |
CBA |
next state when is even |
CBA |
CAB |
BCA |
BAC |
ACB |
ABC |
next state when is odd |
BCA |
BAC |
CBA |
CAB |
ABC |
ACB |
When the input list is the period of a quadratic integer
and
the initial state chosen as
, we will shorten
the notations to
.
Algorithm 5.8
The "combine" procedure, also described
in L
ISTING 3, is designed to deal
with zeroes appearing in the output lists of the transcode algorithm.
When an ending zero occurs, the list will rotated two places to the
right. When an internal zero occurs, it is removed according to

.
Proof.
Assertion (i) follows from
4.13 and
the fact that signatures involved by final state

are only occurring
with quadratic integers of first kind. The remaining three possibilities
are the even permutations of

.
Assertion (ii) follows from the way the transition table has been
built. Equations 5.3 have all the form
and the algorithm consists into finding prefixes and suffixes such
that any
is an integer (or a sequence of integers),
the internal prefixes and suffixes canceling according to
.
And we have:
The former identity holds in any cases, but its interpretation must
be carefully done. The easiest case is

(so that

by lemma
4.13) and

, leading
to

so that

by theorem
5.2. But, by
5.3,

starts by

and ends by

(when

is even) or by

when

is odd. The zeroes occurring in

(if any) are
only internal and can be removed by using

.
Thus

is a list of positive integers
and the unique factorization theorem
2.6 applies
to

, proving that

is (in this case) the period of the confrac expansion of

.
In the case
and, for example,
, we cannot have
. By theorem
5.2, we have:
and here again

don't start or end by a zero, leading to
the same conclusion as above.
When
, list
ever ends by
and we
have (whatever the ending state can be):
where

is either

or

,

and

. The conclusion follows since

is the identity matrix.
Remark 5.10
The specificity of

can be interpreted as follows. When
building

, automaton translates

into

so that a two places rotation of

gives a sequence beginning
by

that leads, after reduction,
to a sequence starting by

as it should be (lemma
4.13).
Algorithm 5.11
Another automaton can
be build using the same

but

instead
of

. The rules for state transitions remain the same,
and the output rules are now:
 |
(5.4) |
Proposition 5.12
When applying algorithm
5.11
to a quadratic integer of first kind

such that

,
the final state (say

) of can only be

,

or

.
And we have
.
Proof.
Follows the same guidelines as the proof of proposition
5.9.
Remark 5.13
Algorithm
5.11
can be shortened into :
From proposition
5.12, we start and stop in
state

and use

when

is odd, while we start
and stop in state

and use

when

is even.
Theorem 5.14
Let

be

or

and

be positive integers
such that
 |
(5.5) |
Then it exists

such that
Conversely, when

we have

and, for all
other

, the period length of

and

obey to relations
5.5.
FIG. 5.1:
Eventual values for the pair
.
|
|
Proof.
This theorem will be proven by the following lemma.
Lemma 5.15
Inequalities (2) and (4) hold and equality occur
iff

.
Lemma 5.16
We have

and equality occur
iff

or

is an "any, one, one" pattern.
Proof.
From algorithm
5.11, we have

.
Since the first

quotient is ever even, it follows from
5.4
that

. Again from
5.4,
assuming that

,

can only be
achieved when all the

are even and at least

, leading
to an "any, one, one" pattern for

(and therefore

). The special case

appears from the fact that

collapses into

(and therefore

).
Lemma 5.17
When

, we have

.
Apart from

, inequality (1) i.e.

ever holds.
When, additionally

, (1) can be refined into

.
Proof.
Let

and obtain

by substituting all

by

and all

by

, other quotients remaining the same. Choosing

,
we have

from

and lemma
5.15. Thus

. Going
back to

from

introduces two zeroes in

and a

-decrease of

, while going back to

from

introduces one zero in

and a

-decrease
of

. From the palindromic property and the fact that middle
element is odd or none, the

occur by pairs, proving the
first affirmation.
In order to obtain
, the maximal length
should decrease by
. This can only happens if all quotients,
including
, were
. But
implies
. Otherwise
, i.e. (1) holds and equality implies that
is a "nothing
but ones" pattern. From proposition 4.15,
such a pattern leads to
when
: in this case
is forbidden and we must have
.
Lemma 5.18
When k=1,

. When, additionally

then (4) can be refined into

.
Proof.
Let

, obtain

by substituting all

by

and all

by

(other quotients remaining the same) and choose

.
It follows from
5.13 that at each stage
input+output is

or

so that

.
Therefore

. The eventual difference
between

and

is caused by occurrence
of zeroes in

. But

is palindromic, and it's middle
element cannot be 0 from corollary
4.11 : the
zeroes occur by pairs and

is proven.
From the proof of lemma 5.15, equality occurs in (4) when
is odd, and the other
are even. But the middle
element of
can only be odd or none. Therefore
is forbidden when
is even.
Lemma 5.19
All possibilities not excluded by
5.5 are actually
reached.
Proof.
When

, the following table describe how to construct an

such that

and

have the requested length. Column

gives a pattern such that

. When substituting a palindromic
pair of non-middle

by a pair of

,

decrease by

. When substituting a middle

by

or a pair of

by
a pair of

,

decrease by

. When

,
this

-decrease can be achieved by a substitution

acting over a well chosen pair.
In the

case, the descent from

down to

is easier to describe when split into two overlapping processes, the
first one descending from

down to

:
and the other one from

down to

.
A direct examination of what happens when

and

completes
the proof.
Fact 5.20
When

, and

has a middle element

then

and

(in the general case,

is even or none). .
Proof.
***********From parity,

has also a
middle element,

. From

,

is
"any, one, one" and

.
Previous: 4 Patterns
Up: Patterns Occurring During the
Next: 6 Other Sections
douillet@ensait.fr
2004-02-06