FRANZ HALTERKOCH
Abstract. We investigate the solutions of diophantine equations of the form
dx
2
d
y
2
= t for t {1, 2, 4} and their connections with ideal theory,
continued fractions and Jacobi symbols.
1. Introduction and History
The aim of this article is a thorough study of diophantine equations of the form
(1) dx
2
d
y
2
= 1 , where d, d
N and dd
is not a square.
For d = 1, this is Pells equation, while the general equation (1) is sometimes called
antipellian. Multiplication of (1) with d implies (with X = dx, Y = dy and
D = dd
=
_
2D if D 3 mod 4 ,
D if D , 3 mod 4 .
Then there is exactly one 1 < m[ D
y
2
= t, where
t 1, 2 if 12 mod 16, and t 1, 4 if 1 mod 4. Finally, section 5
contains several applications for small discriminants.
2. Quadratic orders
A nonsquare integer Z is called a discriminant if 0 or 1 mod 4, and
we set
=
_
0 if 0 mod 4 ,
1 if 1 mod 4 ,
2
and
O
= Z[
] =
_
a + b
a, b Z, a b mod 2
_
.
We call
), O
0
= O
K
is its maximal order, and f = (O
K
: O
).
We denote by (
[ X. For K, we call
Q its norm.
If is a quadratic discriminant, then the unit group O
of O
is given by
O
=
_
O
[^()[ = 1
_
=
_
a + b
a, b Z, [a
2
b
2
[ = 4
_
,
and O
= 1,
), where
= min(O
R
>1
) is the fundamental unit of
discriminant (see [5, 16.4]).
An algebraic number C of degree 2 is called a quadratic irrational . For an
integer D Z, we normalize its square root by
D 0 if D 0, and
D 0
if D < 0. Then every quadratic irrational C has a unique representation
=
b +
b
2
4ac
2a
, where a, b, c Z and (a, b, c) = 1 .
In this representation, the triple (a, b, c) Z
3
is called the type and = b
2
4ac
is called the discriminant of . If Z is any discriminant, then = 4D +
,
where D Z, and the basis number
, D)
and discriminant .
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 3
Two irrational numbers ,
1
C Q are called equivalent if
1
=
+
+
for some
_
_
GL
2
(Z) .
It is easily checked that equivalent quadratic irrationals have the same discriminant.
Let K be a quadratic number eld. For n N and
1
, . . . ,
n
K, we denote by
[
1
, . . . ,
n
] = Z
1
+. . . +Z
n
K the Zmodule generated by
1
, . . . ,
n
. A free
Zsubmodule a K of rank 2 is called a lattice in K, and (a) = K [ a a
is called its ring of multipliers . If (
1
,
2
) is a basis of a, then a = [
1
,
2
]. In
particular, for every discriminant we have
O
= [1,
] =
_
a + b
a, b Z, a b mod 2
_
.
In a dierent terminology, the following Propositions 2.1, 2.2 and 2.3 can be
found in [4, Propositions 1 and 3].
Proposition 2.1 (Structure of lattices). Let K be a quadratic number eld and
a K a lattice. Then a = m[1, ], where m = min(a Q
>0
) and K. If is
a quadratic irrational of type (a, b, c) and discriminant , then (a) = O
, and
aa
= m
2
a
1
O
.
Proof. Observe rst that aQ ,= 0. Indeed, a
and (a
1
+ c
2
2
, where c
1
, c
2
Z. Then (c
1
, c
2
) = 1 by the minimal choice
of m, and there exist u
1
, u
2
Z such that c
1
u
2
c
2
u
1
= 1. If
1
= u
1
1
+ u
2
2
,
then
_
m
1
_
=
_
c
1
c
2
u
1
u
2
__
2
_
and
_
a: [m,
1
]
_
= [c
1
u
2
c
2
u
1
[ = 1 .
Hence a = [m,
1
] = m[1, ], where = m
1
1
.
Assume now that if of type (a, b, c) and discriminant = b
2
4ac. We shall
prove that O
a a and m
2
aaa
= O
(a) = (a)O
= m
2
aaa
(a) m
2
aaa
= O
,
and therefore equality holds. Since
b
2
+ a
b +
2a
[1, ] and
= c +
+ b
2
b +
2a
[1, ] ,
we obtain O
a = m[1,
] [1, ] = m[1, ,
mod 2,
m
2
aaa
= [a, a] [1,
] =
_
a, b, c,
b +
2
_
=
_
1,
b +
2
_
= [1,
] = O
.
Proposition 2.2 (Equivalence of lattices). Let K be a quadratic number eld and
,
1
K Q.
1. Let K
_
=
_
__
1
_
for some
_
_
GL
2
(Z) ,
and consequently
= + and
1
=
1
=
+
+
.
2. By assumption, we have
[1,
1
] =
1
+
[ + , + ] =
1
+
[1, ] .
Next we investigate ideals. Let be a discriminant and K = Q(
). Every
nonzero fractional ideal a of O
. An ideal a O
is called O
primitive if
e
1
a , O
for all e N
2
, and it is called O
regular if it is O
primitive and
(a) = O
. Consequently, every O
if and only if c = m
1
a for some O
regular ideal a O
.
Two O
regular ideals a, a
1
are called equivalent if a
1
= a for some K
.
For an O
regular ideal a O
(a) = (O
regular ideals a O
. Up to isomorphisms, (
= Pic(O
) is the factor
group of invertible fractional ideals modulo fractional principal ideals of O
.
Next we describe the fundamental connection between quadratic irrationals and
ideals. For a quadratic irrational C of type (a, b, c) and discriminant , we
dene the lattice
I() =
_
a,
b +
2
_
= [a[ [1, ] O
.
Clearly, I() = I(), I(
) = I()
, and O
= I(
). If ,
1
are quadratic
irrationals, then it is easily checked that I() = I(
1
) if and only if
1
= + n for
some 1 and n Z.
Proposition 2.3 (Structure of regular ideals). Let be a discriminant.
1. A subset a Q(
) is an O
(a) = [a[.
2. Let ,
1
be quadratic irrationals of discriminant . Then and
1
are
equivalent if and only if [I()] = [I(
1
)] (
.
Proof. 1. By denition, I() O
is a lattice, e
1
I() , O
for all e N
2
, and
(I()) = O
regular ideal.
Let now a O
be an O
= b
2
4ac. Since O
= (a) = O
, it follows that =
, and
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 5
as a Q
>0
N, we obtain m N. Now m a O
implies a [ m, say m = ae
for some e Z. Hence
a = m
_
1,
b +
2a
_
= e
_
a,
b +
2
_
= [e[
_
[a[,
b +
2
_
,
and [e[
1
a O
2
_
=
_
[a[ 0
b
2
1
__
1
_
,
it follows that N
(a) = [a[.
2. By Proposition 2.2.
From now on we consider positive discriminants and real quadratic irrationals.
Denition 2.4.
1. Let R be a quadratic irrational. Then the quadratic irrational
+
=
1

.
is called the successor of . is called
reduced if > 1 and 1 <
< 0 ;
ambiguous if +
Z.
2. Let > 0 be a discriminant. An O
regular ideal a O
is called
reduced if a = I() for some reduced quadratic irrational ;
ambiguous if a
= a .
Proposition 2.5. Let R be a quadratic irrational of type (a, b, c) and discrim
inant .
1. is reduced if and only if 0 <
b < 2a <
+ b. In particular, if
is reduced, then 0 < a <
, 0 < b <
, 0 < c <
, and
+
is also
reduced.
2. is ambiguous if and only if a[ b, and I() is ambiguous if and only if is
ambiguous.
3. If
+
=
1
, then is ambiguous, and if is reduced and ambiguous,
then
+
=
1
.
4. If and
1
R are reduced quadratic irrationals and I() = I(
1
), then
=
1
.
Proof. All assertions are easily checked (and in fact well known).
It is easily checked that is ambiguous if and only if I()
+
=
1
, then
=  , and therefore +
Z. Conversely, if is
reduced and ambiguous, then 1 < +
< , hence  = +
and
+
= ( )
1
=
1
.
If > 0 is a discriminant, then an O
regular ideal a O
is called reduced
if a = I() for some reduced quadratic irrational R. If R is any quadratic
irrational, then I() is reduced if and only if +
= I(
) is reduced.
6 FRANZ HALTERKOCH
3. Continued fractions and reduction
Our main reference for the classical theory of continued fractions is Perrons
book [16]. It is well known that every R Q has a unique (simple) continued
fraction
= [u
0
, u
1
, . . .] = lim
n
[u
0
, u
1
, . . . , u
n
] ,
where u
0
Z, u
i
N for all i 1, and
[u
0
, u
1
, . . . , u
n
] = u
0
+
1
u
1
+
1
u
2
+
1
.
.
.
+
1
u
n1
+
1
u
n
=
p
n
q
n
,
such that p
n
Z, q
n
N and (p
n
, q
n
) = 1. The sequences (p
n
)
n2
of partial
numerators of and (q
n
)
n2
of partial denominators of satisfy the recursion
p
2
= 0 , p
1
= 1 , and p
i
= u
i
p
i1
+ p
i2
for all i 0 ,
q
2
= 1 , q
1
= 0 , and q
i
= u
i
q
i1
+ q
i2
for all i 0 .
The numbers
n
= [u
n
, u
n+1
, . . .] are called the complete quotients of . They are
equivalent to and satisfy the recursion formulas
0
= and
n+1
=
+
n
for all
n 0.
A sequence (x
n
)
n0
is called ultimately periodic with period length l 1 and
preperiod length k 0 if x
n+l
= x
n
for all n k, and k and l are minimal with
this property. In this case, we write
(x
n
)
n0
= (x
0
, x
1
, . . .) = (x
0
, x
1
, . . . , x
k1
, x
k
, x
k+1
, . . . , x
k+l1
) .
If k = 0, then the sequence is called purely periodic .
Proposition 3.1 (Periodicity Theorem). Let R Q, = [u
0
, u
1
, . . .] its
continued fraction and (
n
)
n0
its sequence of complete quotients.
1. For k 0 and l 1 the following assertions are equivalent :
(a) The sequence (u
n
)
n0
is ultimately periodic with preperiod length k
and period length l.
(b) The sequence (
n
)
n0
is ultimately periodic with preperiod length k
and period length l.
(c) The numbers =
0
,
1
, . . . ,
k+l1
are distinct, and
k+l
=
k
.
2. The sequence (u
n
)
n0
is ultimately periodic if and only if is a quadratic
irrational, and it is purely periodic if and only if is a reduced quadratic
irrational.
3. Let be a quadratic irrational, and suppose that (
n
)
n0
has preperiod length
k and period length l. Then
k
,
k+1
, . . . ,
k+l1
is the set of all reduced
quadratic irrationals which are equivalent to .
We call l = l() the period length and (
k
,
k+1
, . . . ,
k+l1
) the period
of .
Proof. [16, 17 and Ch. III]
Corollary 3.2. Let > 0 be a discriminant, R a quadratic irrational of
discriminant , l = l() and (
1
, . . . ,
l
) the period of . Then I(
1
), . . . , I(
l
) are
distinct, and I(
1
), . . . , I(
l
) is the set of all reduced ideals in the ideal class
[I()] (
.
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 7
Proof. A subset a K is an O
> 0 be a discriminant,
= [u
0
, u
1
, . . .] the
continued fraction of its basis number and l = l(
). Then u
n
= u
n+l
for all
n 1, u
l
= 2u
0
, u
li
= u
i
for all i [1, l 1], and therefore
=
+
2
= [u
0
, u
1
, u
2
, . . . , u
2
, u
1
, 2u
0
] .
Let (p
n
)
n2
be the sequence of partial numerators, (q
n
)
n2
the sequence of
partial denominators and (
n
)
n0
the sequence of complete quotients of
. For
n 0,
n
is of type (a
n
, b
n
, c
n
), where a
n
1 and b
n
= 2B
n
for some B
n
Z.
(
1
, . . . ,
l
) is the period of
, and I(
1
), . . . , I(
l
) is the set of all reduced
principal ideals of O
. In particular,
l
= [ 2u
0
, u
1
, u
2
, . . . , u
2
, u
1
] =
+ u
0
, and I(
l
) = I(
) = O
.
If
) = (1)
l
, and
= (p
l1
q
l1
)
m
= p
ml1
q
ml1
for all m N
0
.
If has a prime divisor q 3 mod 4, then l is even and ^(
) = 1.
1. For all n 0, the following relations hold :
(a) B
n
+ B
n+1
= a
n
u
n
+
.
(b) p
n1
= B
n
q
n1
+ a
n
q
n2
.
(c) Dq
n1
= (B
n
)p
n1
+ a
n
p
n2
.
(d) 4(1)
n
a
n
= (2p
n1
q
n1
)
2
q
2
n1
= 4 ^(p
n1
q
n1
).
(e) (1)
n
a
n
= p
2
n1
p
n1
q
n1
Dq
2
n1
.
2. If i 1 and n 0, then p
i+nl
q
i+nl
= (p
i
q
i
)(p
l1
q
l1
)
n
.
3. If l is odd, then
l
is the only ambiguous number in the period of
, and
O
.
4. Let l = 2k be even. Then
k
and
l
are the only ambiguous numbers in
the period of
, (p
k1
q
k1
)
2
= a
k
, 2B
k
= a
k
u
k
+
,
a
k
[ (2p
k1
q
k1
, ) if
= 1 , and a
k
[ 2(p
k1
, D) if
= 0 .
In particular, O
and I(
k
) are the only reduced ambiguous principal ideals
of O
.
Proof. We prove 3. and 4. The other assertions can be either found in [16, 20, 27
and 30] or easily derived from the investigations there. The assertion concerning
reduced principal ideals follows by Corollary 3.2.
If i [1, l], then
i
= [ u
i
, u
i+1
, . . . , u
l
, u
1
, . . . , u
i1
] = [ u
li+1
, . . . , u
l
, u
1
, . . . , u
li
] =
li+1
(see [16, 23]), and by Proposition 2.5.3 it follows that
i
is ambiguous if and only
if
i+1
=
+
i
=
1
i
=
li+1
. In particular,
l
is ambiguous. If i [1, l 1], then
i
is ambiguous if and only if i + 1 = l i + 1, that is, if and only if l = 2i. This
proves 3. and the rst assertion of 4.
Assume now that l = 2k. Then
k+1
=
1
i
, and therefore
1 =
k+1
k
=
b
k+1
+
a
k+1
b
k
a
k
=
b
k
b
k+1
+ (b
k
b
k+1
)
4a
k
a
k+1
,
8 FRANZ HALTERKOCH
which implies that b
k
= b
k+1
, hence B
k
= B
k+1
and 2B
k
= a
k
u
k
+
. By 1.(b) we
obtain 2p
k1
q
k1
= 2B
k
q
k1
+2a
k
q
k2
q
k1
= (2B
k
)q
k1
+2a
k
q
k2
,
and as a
k
[ 2B
k
, it follows that a
k
[ 2p
k1
q
k1
and therefore a
k
[ q
2
k1
by 1.(d). By 1.(e), (a
k
, q
k1
)[ p
k1
, hence (a
k
, q
k1
) = 1 and a
k
[ . Consequently,
a
k
[ (2p
k1
q
k1
, ) if
= 1. If
= 0, then a
k
[ 2p
k1
, hence a
k
[ 2D by 1.(e),
and therefore a
k
[ 2(p
k1
, D).
It remains to prove that (p
k1
q
k1
)
2
= a
k
= a
k
(p
l1
q
l1
). Since
= D +
and (1,
q
k1
) .
From the matrix equation
_
p
l1
p
l2
q
ll
q
l2
_
=
l1
=0
_
u
1
1 0
_
=
_
p
k1
p
k2
q
k1
q
k2
_
l1
=k
_
u
1
1 0
_
=
_
p
k1
p
k2
q
k1
q
k2
_
l1
=k
_
u
l
1
1 0
_
=
_
p
k1
p
k2
q
k1
q
k2
__
k
=0
_
u
1
1 0
__
t
_
0 1
1 u
0
_
=
_
p
k1
p
k2
q
k1
q
k2
__
p
k
q
k
p
k1
q
k1
__
0 1
1 u
0
_
=
_
p
k1
p
k2
q
k1
q
k2
__
q
k
p
k
u
0
q
k
q
k1
p
k1
u
0
q
k1
_
it follows that p
l1
= p
k1
q
k
+ p
k2
q
k1
and q
l1
= q
k1
(q
k
+ q
k2
). By 1.(c),
a
k
p
l1
= a
k
p
k1
q
k
+ a
k
p
k2
q
k1
= a
k
p
k1
q
k
+ Dq
2
k1
(B
k
)p
k1
q
k1
= p
k1
[ a
k
u
k
q
k1
+ a
k
q
k2
(B
k
)q
k1
] + Dq
2
k1
= p
k1
(B
k
q
k1
+ a
k
q
k2
) + Dq
2
k1
= p
2
k1
+ Dq
2
k1
.
By 1.(b),
2p
k1
q
k1
= 2B
k
q
k1
+ 2a
k
q
k2
q
k1
= (B
k
+ B
k+1
)q
k1
+ 2a
k
q
k2
= a
k
(u
k
q
k1
+ 2q
k2
) = a
k
(q
k
+ q
k2
) ,
and therefore q
k1
(2p
k1
q
k1
) = a
k
q
k1
(a
k
+ q
k2
) = a
k
q
l1
.
4. Main Results
Theorem 4.1. Let N be a discriminant.
1. Suppose that = 4D,
c 1, 2 if 8[ D, and c = 1 if 8 D;
t 1, 2 if D 3 mod 4, and t = 1 if D , 3 mod 4;
D = c
2
dd
, where d, d
N and (d, d
) = 1,
and set
j =
_
_
[ d,
D] if ct = 1 ,
[ 2d, d +
D] if t = 2 ,
[ 4d, 2d +
D] if c = 2 .
(a) j is an O
satisfying N
(j) = c
2
dt,
and every O
is of this form.
j is reduced if and only if d < d
if
and only if there exist x, y Z such that
[dx
2
d
y
2
[ = t and (c, xy) = 1 .
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 9
(b) Let x, y Z be such that [dx
2
d
y
2
[ = t and (c, xy) = 1. Then
j = (cdx + y
D) O
.
2. Suppose that 1 mod 4 and = dd
, where d, d
N and (d, d
) = 1,
and set
j =
_
d,
d +
2
_
.
(a) j is an O
satisfying N
(j) = d, and
every O
is of this form.
j is reduced if and only if d < d
if
and only if there exist x, y Z such that [dx
2
d
y
2
[ = 4.
(b) Let x, y Z such that [dx
2
d
y
2
[ = 4. Then
j =
dx + y
2
O
.
Proof. 1.(a) By [4, Proposition 1] it follows that j O
is an O
regular ambigu
ous ideal, every O
. By Proposition 2.3.1, N
(j) = c
2
dt.
Let now j be principal, say j = (u + y
D) O
, and u + y
D [ d,
(j) = [^(dx + y
D)[ = [d
2
x
2
dd
y
2
[, it follows that
[dx
2
d
y
2
[ = 1.
If t = 2, then u + y
D [ 2d, d +
D] implies u + y
D = 2dv + (d +
D)w
for some v, w Z, and if x = 2v + w, then u = dx and y = w. Since D = dd
,
it follows that 2d = N
(j) = [^(dx + y
D)[ = [d
2
x
2
dd
y
2
[, which implies
[dx
2
d
y
2
[ = 2.
If c = 2, then u + y
D [ 4d, 2d +
D = 4dv+(2d+
, it follows that 4d = N
(j) = [^(2dx+y
D)[ = [4d
2
x
2
4dd
y
2
[,
which implies [dx
2
d
y
2
[ = 1.
The converse follows by (b).
(b) If ct = 1, then obviously dx + y
D j, hence (dx + y
D)O
j, and
equality holds, since
N
_
(dx + y
D)O
_
= [^(dx + y
D)[ = [d
2
x
2
dd
y
2
[ = d = N
(j) .
If t = 2, then D = dd
D = 2du + (d +
D) O
j,
and equality holds, since
N
_
(dx + y
D)O
_
= [^(dx + y
D)[ = [d
2
x
2
dd
y
2
[ = 2d = N
(j) .
If c = 2 and 2 xy, then D = 4dd
D = 4du + (2d +
D) O
j, and
equality holds, since
N
_
(2dx + y
D)O
_
= [^(2dx + y
D)[ = [4d
2
x
2
4dd
y
2
[ = 4d = N
4D
(j) .
2.(a) By [4, Proposition 1] it follows that j O
is an O
regular ambiguous
ideal, every O
. By Proposition 2.3.1, N
(j) = d.
Let now j be principal, say j =
u+y
2
O
2
j implies
u+y
2
= dv+
d+
2
w for some v, w Z. Hence it follows
10 FRANZ HALTERKOCH
that u = dx, where x = 2v + w, w = y, j =
dx+y
2
, d = N
(j) =
d
2
x
2
dd
y
2

4
,
and therefore [d
2
x
2
dd
y
2
[ = 4.
(b) If [dx
2
d
y
2
[ = 4, then x y mod 2,
dx+y
2
= d
xy
2
+
d+
2
y j,
hence
dx+y
2
O
_
dx+y
2
O
_
=
^
_
dx+y
2
_
=
[d
2
x
2
dd
y
2
[
4
= d = N
(j) .
The following remark addresses the diophantine equation [dx
2
d
y
2
[ = 1 if
c = 2 and 2[ xy.
Remark 4.2. Let D N be not a square, 8 [ D and D = 4dd
, where d, d
N
and (d, d
y
2
[ = 1.
1. If 2[ x, then (2dx + y
D)O
4D
= [ 4d,
D].
Indeed, if x = 2x
1
, where x
1
Z, then [4dx
2
1
d
y
2
[ = 1 and D = (4d)d
.
Hence the assertion follows by Theorem 4.1.2(a).
2. If 2 [ y and y = 2y
1
, then (dx + y
1
D)O
4D
= [ d,
y
2
1
[ = 1 and D = d(4d
, t,
), where
d, d
N and (d, d
) = 1;
D = c
2
dd
, where c 1, 2 if 8[ D, and c = 1 if 8 D;
t 1, 2 if D 3 mod 4, and t = 1 if D , 3 mod 4;
1 ;
there exist x, y Z such that dx
2
d
y
2
= t and (c, xy) = 1.
Then [L(D)[ = 4, and the structure of L(D) is as follows.
1. If l is odd, then L(D) = (1, D, 1, 1), (D, 1, 1, 1) .
2. If l = 2k is even, then
L(D) = (1, D, 1, 1), (D, 1, 1, 1), (d, d
, t, ), (d
, d, t, ) ,
where 1 d < d
and cdt ,= 1.
3. Let l = 2k be even and (d, d
and
cdt ,= 1. Then = (1)
k
. If (p
n
)
n2
denotes the sequence of partial
numerators and (q
n
)
n2
the sequence of partial denominators of
D, then
p
2
k1
Dq
2
k1
= (1)
k
c
2
dt , c
2
dt
4D
= (p
k1
+ q
k1
D)
2
,
c
2
dt [ 2p
k1
and
4D
= (1)
k
+
2d
t
q
2
k1
+
2p
k1
q
k1
c
2
dt
D.
Proof. Note that (d, d
, d, t, ) L(D).
1. If l is odd, then Theorem 3.3 implies that ^(
4D
) = 1, and O
4D
is the
only reduced ambiguous principal ideal in O
4D
. Hence we obtain ^(O
4D
) = 1,
(1, D, 1, 1), (D, 1, 1, 1) L(D), D , 3 mod 4 and t = 1. Assume now that
there exists some (d, d
) = 1 and therefore
^(O
4D
) = 1. We prove rst :
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 11
A. If (d, d
, t, ) / L(D).
Proof of A. Assume to the contrary that there is some (d, d
, t, ) L(D) such
that (d, d
y
2
= t,
dx
2
1
d
y
2
1
= t and (c, xy) = (c, x
1
y
1
) = 1. By Theorem 4.1.1(b) it follows
that (cdx + y
D) O
4D
= (cdx
1
+ y
1
D) O
4D
, and therefore cdx
1
+ y
1
D =
(cdx + y
D) for some O
4D
. Taking norms, we obtain
c
2
dt = ^(cdx
1
+ y
1
D) = ^()^(cdx + y
D) = ^() c
2
dt ,
and therefore ^() = 1, a contradiction. [A]
By Theorem 3.3.4, O
4D
contains precisely one reduced ambiguous principal
ideal j distinct from the unit ideal, and by Theorem 4.1.1 this ideal gives rise to an
equation [dx
2
d
y
2
[ = t, where d, d
,
(d, d
) = 1, D = c
2
dd
1
, t
1
,
1
), (d
2
, d
2
, t
2
,
2
) L(D), 1 d
1
< d
1
, c
1
t
1
d
1
> 1, and
1 d
2
< d
2
, c
2
t
2
d
2
> 1, then (d
1
, d
1
, t
1
,
1
) = (d
2
, d
2
, t
2
,
2
).
Proof of B. For i 1, 2, suppose that (d
i
, d
i
, t
i
,
i
) L(D), 1 d
i
< d
i
and
c
i
t
i
d
i
> 1, where c
i
1, 2 are such that D = c
2
i
d
i
d
i
. By Theorem 4.1 there
exist x
i
, y
i
Z such that (c
i
, x
i
y
i
) = 1, and
j
i
= (c
i
d
i
x
i
+ y
i
D) O
4D
=
_
_
[ d
i
,
D] if c
i
t
i
= 1 ,
[ 2d
i
, d
i
+
D] if t
i
= 2 ,
[ 4d
i
, 2d
i
+
D] if c
i
= 2
is a reduced ambiguous ideal distinct from the unit ideal in the principal class of
O
4D
. Hence it follows that j
1
= j
2
, and in particular N
4D
(j
1
) = N
4D
(j
2
), which
implies c
2
1
t
1
d
1
= c
2
2
t
2
d
2
.
If t
1
= 2, then D 3 mod 4, hence c
1
= c
2
= 1. Since 2d
1
= t
2
d
2
and d
2
is odd,
it follows that t
2
= 2, d
1
= d
2
, d
1
= d
2
, and A implies
1
=
2
. By symmetry,
we may now assume that t
1
= t
2
= 1.
Assume now that c
1
,= c
2
, say c
1
= 2 and c
2
= 1. Then we obtain 4d
1
= d
2
and
[ 4d
1
, 2d
1
+
D] = [ d
2
,
D] = [ 4d
1
,
1
= d
2
, and A implies
1
=
2
. [B].
3. Let again l = 2k be even and (d, d
and
ctd > 1. Let x, y Z be such that dx
2
d
y
2
= t. Then j = (cdx +y
D)O
4D
is
a reduced principal ideal of O
4D
such that N
4D
(j) = c
2
dt by Theorem 4.1.1.
Let (
n
)
n0
be the sequence of complete quotients of
D =
4D
, and for n 0
let (a
n
, b
n
, c
n
) be the type of
n
. By Theorem 3.3, I(
l
) = O
4D
and I(
k
) are the
only reduced ambiguous principal ideals of O
4D
. Hence it follows that j = I(
k
),
and N
4D
(j) = [^(
k
)[ = c
2
dt = a
k
. By Theorem 3.3 we obtain
^(
k
) = p
2
k1
c
2
dd
q
2
k1
= (1)
k
c
2
dt , c
2
dt
4D
= (p
k1
+ q
k1
D)
2
and
4D
=
p
2
k1
+ q
2
k1
D + 2p
k1
q
k1
D
c
2
dt
= (1)
k
+
2d
t
q
2
k1
+
2p
k1
q
k1
c
2
dt
D
( note that c
2
dt [ 2p
k1
by Theorem 3.3 ). It remains to prove that = (1)
k
.
CASE 1 : c = 2. Then 8[ D, t = 1, a
k
= 4d[ 2p
k1
, and therefore p
k1
= 2dx
1
,
where x
1
Z. If y
1
= q
k1
, then (p
k1
, q
k1
) = 1 implies 2 y
1
, and it follows that
dx
2
1
d
y
2
1
= (1)
k
. If 2 x
1
, then (d, d
, 1, (1)
k
) L(D), hence = (1)
k
, and
we are done.
12 FRANZ HALTERKOCH
We assert that the case 2[ x
1
cannot occur. Indeed, if 2[ x
1
, then x
1
= 2x
2
, where
x
2
Z, and 4dx
2
2
d
y
2
1
= (1)
k
. But this implies that (4d, d
, 1, (1)
k
) L(D),
hence either (4d, d
, 1, (1)
k
) = (d, d
, 1, ) or (4d, d
, 1, (1)
k
) = (d
, 4d, 1, ),
and both relations are impossible.
CASE 2 : c = 1 and 2 d ( in particular, this occurs if D 3 mod 4 ). As
a
k
= td[ 2p
k1
, it follows that d[ p
k1
, say p
k1
= dx
1
, where x
1
Z. If y
1
= q
k1
,
then dx
2
1
d
y
2
1
= (1)
k
t, hence (d, d
, t, (1)
k
) L(D) and therefore = (1)
k
.
CASE 3 : ct = 1 and d = 2d
0
, where d
0
N and 2 d
0
. Since a
k
= 2d
0
[ 2p
k1
,
we obtain p
k1
= d
0
x
1
, where x
1
Z. If y
1
= q
k1
, then d
0
x
2
1
2d
y
2
1
= 2(1)
k
,
which implies that 2 [ x
1
. If x
1
= 2x
2
, where x
2
Z, then dx
2
2
d
y
2
1
= (1)
k
,
hence (d, d
, 1, (1)
k
) L(D) and therefore = (1)
k
.
CASE 4 : ct = 1 and d = 4
e
d
0
, where e, d
0
N and 4 d
0
. If D
0
= d
0
d
,
then = dx
2
d
y
2
= d
0
(2
e
x)
2
d
y
2
implies that (d
0
, d
, 1, ) L(D
0
). Since
a
k
= 4
e
d
0
[ 2p
k1
, it follows that 2
e
d
0
[ 2
2e1
d
0
[ p
k1
, and we set p
k1
= 2
e
d
0
x
1
,
where x
1
Z. If y
1
= q
k1
, then (p
k1
, q
k1
) = 1 implies 2 y
1
. It follows
that d
0
x
2
1
d
y
2
1
= (1)
k
, and therefore (d
0
, d
, 1, (1)
k
) L(D
0
). If d
0
> 1,
then l(
D
0
) is even, and B (applied with D
0
instead of D) yields = (1)
k
.
If d
0
= 1, then d
mod 4. Since 2 d
y
2
1
, it follows that 2 [ x
1
, hence
(1)
k
d
) the period
length of
and l
= l(
, ) such that
d, d
N, (d, d
) = 1, = dd
y
2
= 4.
Then [L
0
()[ = 4, and the structure of L
0
() is as follows.
1. If l is odd, then L
0
() = (1, , 1), (, 1, 1) .
2. If l = 2k is even, then
L
0
() = (1, , 1), (, 1, 1), (d, d
, ), (d
, d, ) ,
where (d, d
, ) / (1, , 1), (, 1, 1) .
3. Let l = 2k be even and (d, d
, ) L
0
() such that 1 < d < d
. Then
= (1)
k
. Let (p
n
)
n2
be the sequence of partial numerators and (q
n
)
n2
the sequence of partial denominators of
. Then d [ 2p
k1
q
k1
, and if
2p
k1
q
k1
= ds
k
, then
ds
2
k
d
q
2
k1
= 4(1)
k
, d
=
_
ds
k
+ q
k1
2
_
2
,
and
= (1)
k
+
d
q
2
k1
+ q
k1
s
k
2
.
Moreover,
y
2
[ = 4 and (x, y) = 1.
4. If (d, d
, ) L
0
(), then there exist x
1
, y
1
Z such that dx
2
1
d
y
2
1
= .
In particular, if l is even, then l l
mod 4.
Proof. Note that (d, d
, ) L
0
() holds if and only if (d
, d, ) L
0
().
1. If l is odd, then Theorem 3.3 implies that ^(
) = 1, and O
is the only
reduced ambiguous principal ideal in O
. Hence ^(O
) = 1, and therefore
(1, , 1), (, 1, 1) L
0
(). Assume that there is some (d, d
, ) L
0
()
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 13
such that 1 < d < d
) = 1. We prove
rst :
A. If (d, d
, ) L
0
(), then (d, d
, ) / L
0
().
Proof of A. Assume to the contrary that there is some (d, d
, ) L
0
() such
that (d, d
, ) L
0
(), and let x, y, x
1
, y
1
Z be such that dx
2
d
y
2
= 4
and dx
2
1
d
y
2
1
= 4. By Theorem 4.1.2 it follows that
_
d,
d +
2
_
=
dx + y
2
O
=
dx
1
+ y
1
2
O
and therefore dx
1
+ y
1
= (dx + y
) for some O
. Taking norms, we
obtain 4d = ^(dx
1
+y
1
) = ^()^(dx +y
y
2
[ = 4, where d, d
N, 1 < d < d
, (d, d
) = 1, = dd
, ) L
0
(D). To
prove uniqueness, we must show:
B. If (d
1
, d
1
,
1
), (d
2
, d
2
,
2
) L
0
(), 1 < d
1
< d
1
and 1 < d
2
< d
2
, then
(d
1
, d
1
,
1
) = (d
2
, d
2
,
2
).
Proof of B. For i 1, 2, suppose that (d
i
, d
i
,
i
) L
0
(). By Theorem 4.1.2
there exist x
i
, y
i
Z such that
j
i
=
d
i
x
i
+ y
i
2
O
=
_
d
i
,
d
i
+
2
_
is a reduced ambiguous principal ideal distinct from the unit ideal of O
. Therefore
it follows that j
1
= j
2
, in particular d
1
= d
2
, hence d
1
= d
2
, and A implies
1
=
2
. [B].
3. Let again l = 2k be even and (d, d
, ) L
0
(), where 1 < d < d
. Let
x, y Z be such that dx
2
d
y
2
= 4. Then
j =
_
dx + y
2
_
O
=
_
d,
d +
2
_
is a reduced principal ideal of O
and I(
k
) are the only
reduced ambiguous principal ideals of O
4D
. Hence it follows that j = I(
k
) and
N
(j) = [^(
k
)[ = d = a
k
. Since a
k
[ (2p
k1
q
k1
, ) by Theorem 3.3, there exists
some s
k
Z such that 2p
k1
q
k1
= ds
k
, and then 4(1)
k
d = d
2
s
2
k
dd
q
2
k1
,
which implies ds
2
k
d
q
2
k1
= 4(1)
k
. Moreover,
d
=
_
ds
k
+ q
k1
2
_
2
and
= (1)
k
+
d
q
2
k1
+ q
k1
s
k
2
.
In particular, (d, d
, (1)
k
) L
0
(), and by A it follows that (d, d
, ) L
0
()
if and only if = (1)
k
.
The above formulas show that
y
2
[ = 4 has a solution
14 FRANZ HALTERKOCH
(x, y) Z
2
such that (x, y) = 1, namely (x, y) = (s
k
, q
k1
). Assume now that
there exist x, y Z such that (x, y) = 1 and dx
2
d
y
2
= 1. Then
=
2 + d
y
2
+ xy
2
O
4
. Since O
,= O
4
if and only if
has halfintegral
coordinates.
4. Suppose that (d, d
, ) L
0
(), and let x, y Z be such that dx
2
d
y
2
= 4.
If x y 0 mod 2, we set x = 2x
1
, y = 2y
1
, and we obtain dx
2
1
d
y
2
1
= . Thus
assume now that x y 1 mod 2. Then we set
x
1
=
(dx
2
3)x
2
and y
1
=
(dx
2
)y
2
,
and we assert that dx
2
1
d
y
2
1
= . For the proof, we start with the identity
64d
3
= (d
2
x
2
y
2
)
3
= [dx(d
2
x
2
+ 3y
2
)]
2
[y(3d
2
x
2
+ y
2
)]
2
.
Now we nd
dx(d
2
x
2
+ 3y
2
) = dx[4d
2
x
2
3(d
2
x
2
y
2
)] = dx(4d
2
x
2
12d)
= 4d
2
x(dx
2
3) = 8d
2
x
1
and
y(3d
2
x
2
+ y
2
) = y[4d
2
x
2
(d
2
x
2
y
2
)] = y(4d
2
x
2
4d)
= 4dy(dx
2
) = 8dy
1
.
Hence it follows that 64d
3
= 64d
4
x
2
1
64d
2
y
2
1
, and therefore = dx
2
1
d
y
2
1
.
Suppose now that l is even. Then there exists some (d, d
, ) L
0
() such that
1 < d < d
, 1, ) L(). By
Theorem 4.3 it follows that l
is even, and if l
= 2k
, then = (1)
k
= (1)
k
,
which implies l l
mod 4.
Remark 4.5. The Theorems 4.3 and 4.4 are closely connected with the results
of R. A. Mollin in [13], in particular with his Theorems 3 and 9. There he derives
a close connection between the fundamental solutions of pellian and antipellian
equations in terms of continued fractions.
5. Applications
Theorem 5.1. ( compare [13, Theorem 5 and Corollaries] ) Let q 3 mod 4 be a
prime and = 4q
r
for some odd r N.
1. Then l(
q ) = 2k is even, l(
q
r
) l(
= u + v
q
r
, where u, v N, then 2[ u and ^(
) = 1.
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 15
Proof. 1. By Theorem 3.3, ^(
) = 1 and l(
q
r
) = 2k is even. By Theorem 4.3,
applied with D = q
r
, there exists a unique 1 such that the diophantine
equation x
2
q
r
y
2
= 2 has a solution (x, y) Z
2
, namely = (1)
k
. Hence
1 =
_
2(1)
k
q
_
= (1)
k
_
2
q
_
, and = (1)
k
=
_
1 if q 7 mod 8 ,
1 if q 3 mod 8 .
Therefore the parity of k does not depend on r.
2. Let (p
n
)
n2
the sequence of partial numerators and (q
n
)
n2
the sequence
of partial denominators of
q
r
. Since (1, q
r
, 2, (1)
k
) L(q
r
), it follows that
p
2
k1
q
r
q
2
k1
= 2(1)
k
, hence 2 q
k1
, and
= (1)
k
+q
r
q
2
k1
+p
k1
q
k1
D,
which implies u = (1)
k
+ q
r
q
2
k1
0 mod 2.
Theorem 5.2. Let q 3 mod 4 be a prime and r N. Then l(
2q ) = 2k is
even, l(
2q
r
) l(
2q
r
) = 2k is even by Theorem 3.3. By Theorem 4.3, applied
with D = 2q
r
, there exists a unique 1 such that the diophantine equation
2x
2
q
r
y
2
= has a solution (x, y) Z
2
, namely = (1)
k
. Hence
1 =
_
2(1)
k
q
_
= (1)
k
_
2
q
_
, and = (1)
k
=
_
1 if q 7 mod 8 ,
1 if q 3 mod 8 .
In particular, the parity of k does not depend on r.
Theorem 5.3. ( compare [13, Theorem 10] ) Let q and q be odd primes and =
4p
r
q
s
for some odd r, s N such that p
r
< q
s
.
1. If ^(
) = 1 and l(
p
r
q
s
) = 2k. Then there exists precisely
one 1 such that the diophantine equation p
r
x
2
q
s
y
2
= is
solvable, namely = (1)
k
. In particular,
_
(1)
k
p
q
_
=
_
(1)
k+1
q
p
_
= 1 .
Proof. By Theorem 4.3, applied with D = p
r
q
s
.
Theorem 5.4. Let p and q be primes and = 8p
r
q
s
for some odd r, s N. If
^(
) = 1, we set l(
2p
r
q
s
) = 2k.
1. Let p 1 mod 8 and q 5 mod 8.
(a) The diophantine equations [2x
2
p
r
q
s
y
2
[ = 1 and [2p
r
x
2
q
s
y
2
[ = 1
are unsolvable.
(b) If ^(
) = 1 ).
(a) The diophantine equation [2x
2
p
r
q
s
y
2
[ = 1 is unsolvable.
(b) Exactly one of the two diophantine equations
2p
r
x
2
q
s
y
2
=
_
p
q
_
and p
r
x
2
2q
s
y
2
=
_
p
q
_
is solvable, while the two diophantine equations
2p
r
x
2
q
s
y
2
=
_
p
q
_
and p
r
x
2
2q
s
y
2
=
_
p
q
_
are both unsolvable.
3. Let p 3 mod 8 and q 7 mod 8 ( then ^(
) = 1 ).
(a) The diophantine equations [2x
2
p
r
q
s
y
2
[ = 1 and [p
r
x
2
2q
s
y
2
[ = 1
are both unsolvable.
(b) There exists precisely one 1 such that the diophantine equation
2p
r
x
2
q
s
y
2
= is solvable, namely
=
_
(1)
k
if 2p
r
< q
s
,
(1)
k+1
if 2p
r
> q
s
,
and (1)
k
_
p
q
_
(q
s
2p
r
) > 0 .
(c) ( compare [13, Corollary 10] ) If
= u + v
2p
r
q
s
, then v is even,
and
_
p
q
_
= (1)
v/2
.
Proof. We apply Theorem 4.3 with D = 2p
r
q
s
. If ^(
q
_
=
_
2
q
_
,
a contradiction.
If x, y Z are such that 2p
r
x
2
q
s
y
2
= 1 , then the congruences
2p
r
x
2
mod q and q
s
y
2
mod p imply that
1 =
_
q
_
=
_
2p
q
_
=
_
p
q
_
and 1 =
_
p
_
=
_
q
p
_
,
which contradicts the quadratic reciprocity law.
(b) By (a) and Theorem 4.3, there exists exactly one 1 such that the
diophantine equation p
r
x
2
2q
s
y
2
= is solvable, and = (1)
k
if and only if
p
r
< 2q
s
. In particular, it follows that
1 =
_
q
_
=
_
p
q
_
.
(c) By the preliminary remark.
2. (a) As in 1.(a), since 2 is a quadratic nonresidue modulo q.
DIOPHANTINE EQUATIONS OF PELLIAN TYPE 17
(b) By the preliminary remark, exactly one of the four diophantine equations
2p
r
x
2
q
s
y
2
= 1 and p
r
x
2
2q
s
y
2
= 1 is solvable. Let x, y Z and 1.
If 2p
r
x
2
q
s
y
2
= , then q
s
y
2
mod p and therefore
=
_
p
_
=
_
q
p
_
=
_
p
q
_
.
If p
r
x
2
2q
s
y
2
= , then 2q
s
y
2
mod p and therefore
=
_
p
_
=
_
2q
p
_
=
_
q
p
_
=
_
p
q
_
.
3. (a) If x, y Z are such that 2x
2
p
r
q
s
y
2
= 1, then 2x
2
mod p
and 2x
2
mod q, which implies
1 =
_
2
p
_
=
_
p
_
=
_
q
_
=
_
2
q
_
= 1 , a contradiction.
If x, y Z are such that p
r
x
2
2q
s
y
2
= 1, then p
r
x
2
mod q and
2q
s
y
2
mod p, which implies
=
_
p
_
=
_
2q
p
_
=
_
q
p
_
=
_
p
q
_
=
_
q
_
= , a contradiction.
(b) By (a) and the preliminary remark, there is exactly one 1 for which
the diophantine equation 2p
r
x
2
q
s
y
2
= is solvable, and by Theorem 4.3 we
obtain = (1)
k
if and only if 2p
r
< q
s
. If x, y Z are such that 2p
r
x
2
q
s
y
2
= ,
then 2p
r
x
2
mod q, and therefore
=
_
q
_
=
_
2p
q
_
=
_
p
q
_
, which implies (1)
k
_
p
q
_
(q
s
2p
r
) > 0 .
(c) Let (p
n
)
n2
the sequence of partial numerators and (q
n
)
n2
the sequence
of partial denominators of
2p
r
q
s
. For g Z, we denote by v
2
(g) the 2adic
exponent of g.
Assume rst that 2p
r
< q
s
. Then (2p
r
, q
s
, 1, (1)
k
) L(2p
r
q
s
), and it follows
that p
2
k1
2p
r
q
s
q
2
k1
= (1)
k
2p
r
, 2[ p
k1
, 2 q
k1
, and
= (1)
k
+ 2q
s
q
2
k1
+
p
k1
q
k1
p
r
_
2p
r
q
s
, which implies v =
p
k1
q
k1
p
r
and v
2
(v) = v
2
(p
k1
) 1. Since
p
2
k1
= 2p
r
[(1)
k
+ q
s
q
2
k1
] 2 [1 (1)
k
] mod 8 ,
it follows that 4[ p
k1
( and thus 4[ v ) if and only if 2[ k, and therefore
_
p
q
_
= (1)
k
= (1)
v/2
.
Assume now that q
s
< 2p
r
. Then (q
s
, 2p
r
, 1, (1)
k
) L(2p
r
q
s
), and it follows
that p
2
k1
2p
r
q
s
q
2
k1
= (1)
k
q
s
, hence 2 p
k1
, and
= (1)
k
+ 4p
r
q
2
k1
+
2p
k1
q
k1
q
s
_
2p
r
q
s
, which implies v =
2p
k1
q
k1
q
s
and v
2
(v) = v
2
(q
k1
) + 1 1. Since
p
2
k1
= q
s
[ 2p
r
q
2
k1
+ (1)
k
] 2q
2
k1
(1)
k
mod 8 ,
it follows that 2q
2
k1
1 + (1)
k
mod 8. Hence 2 [ q
k1
( and thus 4 [ v ) if and
only if 2 k, and therefore
_
p
q
_
= (1)
k1
= (1)
v/2
.
18 FRANZ HALTERKOCH
References
[1] C. Friesen, Legendre symbols and coninued fractions, Acta Arith. 59 (1991), 365 379.
[2] C. F. Gauss, Disquisitiones Arithmeticae, Springer, 1966.
[3] F. HalterKoch,
Uber Pellsche Gleichungen und Kettenbr uche, Arch. Math. 49 (1987), 29
37.
[4] F. HalterKoch, P. Kaplan, K. S. Williams, and Y. Yamamoto, Infrastructure des classes
ambiges dideaux des ordres des corps quadratiques reels, LEns. Math. 37 (1991), 263 292.
[5] H. Hasse, Vorlesungen uber Zahlentheorie, Springer, 1950.
[6] , Number Theory, Springer, 1980.
[7] B. Goddard K. Cheng and R. A. Mollin, The Diophantine equation ax
2
by
2
= c.
[8] P. Kaplan, A propos des equations antipelliennes, Enseign. Math. 29 (1983), 323 328.
[9] P. Kaplan and K. S. Williams, The distance between ideals in the orders of a real quadratic
eld, Enseign. Math. 36 (1990), no. 3, 321358.
[10] R. A. Mollin, All solutions of the Diophantine equation x
2
dy
2
= n, Far East J. Mth. Sci.,
Special Volume.
[11] , Quadratics, CRC Press, 1996.
[12] , Jacobi symbols, ambiguous ideals, and continued fractions, Acta Arith. 85 (1998),
331 349.
[13] , A continued fraction approach to the Diophantine equation ax
2
by
2
= 1, JP
Journal of Algebra, Number Theory and Apps. 4 (2004), 565 571.
[14] R. A. Mollin and A. J. van der Poorten, Continued fractions, Jacobi Symbols, and Quadratic
Diophantine Equations, Canadian Math. Bull. 43 (2000), 218 225.
[15] G. Pall, Discriminantal Divisors of Binary Quadratic Forms, J. Number Theory 1 (1969),
525 533.
[16] O. Perron, Die Lehre von den Kettenbr uchen, B. G. Teubner, 1989.
[17] H. F. Trotter, On the norms of units in quadratic elds, Proc. Amer. Mat. Soc. 22 (1969),
198 201.
[18] A. J. van der Poorten and P. G. Walsh, A Note on Jacobi Symbols and Continued Fractions,
Amer. Math. Monthly 106 (1999), 52 56.
Institut f ur Mathematik und Wissenschaftliches Rechnen
der KarlFranzenzsUniversit at Graz, A8010 Graz, Heinrichstrae 36
Email address: franz.halterkoch@aon.at