Quadratic Irrational Integers\rlap{\smash{\,\qquad\ceNTRelogo}}\\ With Partly Prescribed \\Continued Fraction Expansion
Alfred J. van der Poorten
We generalise remarks of Euler and of Perron by explaining how to detail all quadratic integers for which the symmetric part of their \cf\ \ex\ commences with prescribed partial quotients.
math0411005.tex
%\begin{comment}
%%------!! AMS-LaTeX essential !!--------------  
%%----------------------------
\begin{filecontents}{alf-j-l.cls}

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{alf-j-l}
              [1996/10/25 v1.2b GEN-J Author Class]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{amsart}}
\ProcessOptions

\LoadClass{amsart}[1996/10/24]


%%--------------Old black box signalling end of proof-------------- 

\gdef\q@d{\ifhmode\unskip\nobreak\fi\ifmmode\ifinner\else\hskip5\p@\fi\fi 
\hbox{\hskip5\p@\vrule width4\p@ height6\p@ depth1.5\p@\hskip\p@}}

\gdef\qed{%
{\unskip\nobreak\hfil\penalty50\hskip2em\hbox{}\nobreak\hfil{\q@d}
\parfillskip=0pt\finalhyphendemerits-0\par}}

\font\headlinefont=cmti10 scaled 800
\endinput
 
\end{filecontents}
%-----------------

\begin{filecontents}{AlfPreambleL} 

%%-------------AlfPreambleL----------- 

%% LaTeX2e file `AlfPreambleL'
%% generated by the `filecontents' environment
%% from source `Periodic' on 1999/01/08.
%%

%%-------------AlfPreambleL-----------
\ifx\preambleloaded\relax
  \endinput\else\let\preambleloaded\relax\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %
% Alf van der Poorten
% ceNTRe for Number Theory Research
% Macquarie University
% NSW 2109 AUSTRALIA
% alf@mpce.mq.edu.au
%

% This file assumes the presence of AmS-LaTeX 2e
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\mathsurround=1pt


\def\C{{\mathbb C}} \def\N{{\mathbb N}} \def\L{{\mathbb L}} \def\K{{\mathbb K}}
\def\Z{{\mathbb Z}} \def\Q{{\mathbb Q}} \def\A{\overline{\mathbb Q}}
\def\R{{\mathbb R}}
\def\F{{\mathbb F}} %% means, with subscript, finite field to me
\def\Fb{{\mathbold F}}


%\def\({\bigl(} \def\){\bigr)} %%Bloody useful for second parentheses
\def\\{\cr} %This may be a bad thing; check that it does no harm
\def\lt{<}
\def\gt{>}
\def\conj{\overline}
\def\ov{\overline}


\def\id#1{\langle #1\rangle} %%% ideal, in other words

%--------------Overarrows in Continued Fraction expansions--------
\newbox\boxW\newdimen\dimW
\def\heighten#1{%
\setbox\boxW\hbox{$\displaystyle #1$}%%%
\dimW=1.04\ht\boxW\advance\dimW by 1.00pt
\vbox to \dimW{}}

\def\larr#1{\overleftarrow{{\heighten{#1}}#1}}
\def\rarr#1{\overrightarrow{{\heighten{#1}}#1}}


%------------Taken from George Gr�tzer's lattice.sty

\newcommand{\set}[1]{\{#1\}}% set 
\newcommand{\setm}[2]{\{\,#1\mid#2\,\}}% set with a middle


% Font commands
\newcommand{\tbf}{\textbf}% text bold
\newcommand{\tit}{\textit}% text italic
\newcommand{\tsl}{\textsl}% text slanted
\newcommand{\tsc}{\textsc}% text small cap
\newcommand{\ttt}{\texttt}% text typewriter
\newcommand{\trm}{\textrm}% text roman
\newcommand{\tsf}{\textsf}% text sans serif
\newcommand{\tup}{\textup}% text upright

\newcommand{\mbf}{\mathbf}% math bold
\providecommand{\mit}{\mathit}% math italic
\newcommand{\msf}{\mathsf}% math sans serif
\newcommand{\mrm}{\mathrm}% math roman
\newcommand{\mtt}{\mathtt}% math typewriter

\newcommand{\B}{\boldsymbol}
   % Bold math symbol, use as \B{a}
\DeclareMathAlphabet{\Bi}{OT1}{cmm}{b}{it}  %Bold Math Italic
\newcommand{\MC}[1]{\mathcal{#1}}
   % Euler Script - only caps, use as \MC{A}
\newcommand{\D}[1]{\mathbb{#1}}
   % Doubled - blackboard bold - only caps, use as \D{A}
\newcommand{\E}[1]{\mathcal{#1}}% same as \C
   % Euler Script - only caps, use as \E{A} 
\newcommand{\MF}[1]{\mathfrak{#1}}% Fraktur, use as \MF{a}
\newcommand{\Ms}[1]{\mathsf{#1}}% sans serif, use as \Ms{a}

% Miscellaneous
\newcommand{\nl}{\newline}
\newcommand{\ol}[1]{\overline{#1}}
\newcommand{\ul}[1]{\underline{#1}}
\providecommand{\bysame}{\makebox[3em]{\hrulefill}\thinspace}
\newcommand{\q}{\quad}% spacing
\newcommand{\qq}{\qquad}% more spacing
\newcommand{\iso}{\cong}% isomorphic
\def\con#1=#2(#3){#1\equiv#2\pod{#3}}
   %congruence, use it as \con a=b(\theta)%
\newenvironment{enumeratei}{\begin{enumerate}[\upshape (i)]}%
                            {\end{enumerate}}
   %produces (i), (ii), etc. Cross-reference with \eqref.
\newenvironment{enumeratea}{\begin{enumerate}[\upshape (a)]}%
                            {\end{enumerate}}
   %produces (a), (b), etc. Cross-reference with \eqref.
\begin{comment}
\theoremstyle{plain}
\newtheorem*{namedtheorem}{\theoremname}
\newcommand{\theoremname}{testing}
\newenvironment{named}[1]{\renewcommand{\theoremname}{#1}
   \begin{namedtheorem}}
   {\end{namedtheorem}}

\theoremstyle{definition}
\newtheorem*{namedremark}{\remarkname}
\newcommand{\remarkname}{testing}
\newenvironment{renamed}[1]{\renewcommand{\remarkname}{#1}
   \begin{namedremark}}
   {\end{namedremark}}
\end{comment}
%-------------------------------------------



%%-------------- Continued Fractions -----------------------------
\def\CF#1{{\def\\{\mathrel{,}}\def\;{\mathrel{;}}
\def\dots{\ldots}\def\dotss{\ldots\ldots}[\,#1\,]}}
\def\lCF#1{{\def\\{\mathrel{,}}\def\;{\mathrel{;}}
\def\dots{\ldots}\def\dotss{\ldots\ldots}[\,#1\,,}}
\def\rCF#1{{\def\\{\mathrel{,}}\def\;{\mathrel{;}}
\def\dots{\ldots}\def\dotss{\ldots\ldots}#1\,]}}
\def\cCF#1{{\def\\{\mathrel{,}}\def\;{\mathrel{;}}
\def\dots{\ldots}\def\dotss{\ldots\ldots}#1\,}}

%%------- David Cantor's suggestion ---------
%infinite continued fraction:
\def\cfraci#1#2{#1_0+{
\let\ds\displaystyle
\def\vl{\ds1\vrule width0pt depth.5ex height2ex\over}
\vl{\ds#1_1 + {\vl{\ds#1_2 +{\vl\hskip.5em\ddots}}}}}}
%---------------end continued fraction-----------------------------

%--------divides--------
\def\exactlydivides{{\mathchoice{\mathrel{\bigm\|}}%
{\mathrel{\bigm\|}}{\mathrel{\|}}%
{\mathrel{\|}}}}
\def\ediv{\exactlydivides}
\def\divides{{\mathchoice{\mathrel{\bigm|}}{\mathrel{\bigm|}}{\mathrel{|}}%
{\mathrel{|}}}}
\def\Div{\divides}
\def\notdivides{\mathrel{\kern-3pt\not\!\kern3.5pt\bigm|}}
\def\ndiv{\notdivides}
\def\nDiv{\notdivides}
%------------end divides-------

%----A damned useful definition of \house for the size of algebraic numbers
\newbox\boxA
\newbox\boxB
\newdimen\dimA
\newdimen\dimB
\newdimen\dimC

\def\house#1{%%% constructed by Ross Talent, by the way
%Sadly this fails in LaTex
\setbox\boxA\hbox{$\displaystyle #1$}%%%
\dimA=1.04\wd\boxA\advance\dimA by 2pt
\dimB=1.04\ht\boxA\advance\dimB by 2pt
\dimC=0.05\wd\boxA
\hskip\dimC\hskip1pt\hbox to \dimA
{\vrule\vbox to \dimB{\hsize=\dimA
%\hrule\vfill \line{\hfil \box\boxA\hfil}}\vrule} %Corrected
\hrule\vfill \centerline{\box\boxA}}\vrule}
\hskip 0.8pt\hskip1pt\hskip\dimC}
%-------------end \house---------------

%-------------Abbreviations
\def\poly {polynomial}
\def\ep {exponential polynomial}
\def\gps {generalised power sum}
\def\rs {recurrence sequence}
\def\cf {continued fraction}
\def\cfe {continued fraction expansion}
\def\pq {partial quotient}
\def\ap {approximation}
\def\ex{expansion}
\def\cv {convergent}

\DeclareMathOperator{\Norm}{Norm}
\DeclareMathOperator{\Trace}{Trace}
\DeclareMathOperator{\Jac}{Jac}

\def\fl#1{\left\lfloor#1\right\rfloor}
\def\cl#1{\left\lceil#1\right\rceil}


%------------Current time; this may be system dependent!
\newcount\hours
\newcount\minutes
\def \SetTime{\hours=\time
\global\divide\hours by 60
\minutes=\hours
\multiply\minutes by 60
\advance\minutes by-\time
\global\multiply\minutes by-1 }
\SetTime
\def \now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes}
\def \Now{\today\ $[$\now$]$}
%--------------------end time----------------------------------

%-----needed for the ceNTRe logo----------
%---to avoid this uncomment the logo below

%
% Handling PostScript Graphics
%
%

%---For use with Textures on a Macintosh ONLY!!--%
\newif\ifMacTextures
\MacTexturestrue

\ifMacTextures

\gdef\EPSF#1by#2(#3){%
\vbox to #2{\hrule width #1 height 0pt depth 0pt%
\vfill\special{illustration #3}}}%


\gdef\scaledEPSF#1by#2(#3 scaled #4){{%
\dimen0=#1 \dimen1=#2%
\divide\dimen0 by 1000 \multiply\dimen0 by #4%
\divide\dimen1 by 1000 \multiply\dimen1 by #4%
\EPSF \dimen0 by \dimen1 (#3 scaled #4)}}%
\else
%
%---For use with dvips by Tomas Rokicki, ONLY!!--%
\input epsf

\gdef\EPSF#1by#2(#3){%
\vbox to #2{\hrule width #1 height 0pt depth 0pt\vfill \epsfbox{#3}}}%

\gdef\EPSF#1by#2(#3){\epsfbox{#3}}%

\gdef\scaledEPSF#1by#2(#3 scaled #4){{%
\dimen0=#1 \dimen1=#2%
\divide\dimen0 by 1000 \multiply\dimen0 by #4%
\divide\dimen1 by 1000 \multiply\dimen1 by #4%
\epsfxsize=\dimen0\epsfbox{#3}}}%
\fi
\MacTexturesfalse


%This stuff is needed for the ceNTRe logo
%The availability of the ps file logo.art
%in the working directory is essential

\def\centrelogo{\scaledEPSF 2.5in by 1.4in (logo.art scaled 650)}
\def\expcentrelogo{\scaledEPSF 2.5in by 1.4in (logoexp.art scaled 650)}

\def\smallcentrelogo{\scaledEPSF 2.5in by 1.4in (logo.art scaled 325)}

\font \logofont=cmss8
\def\ceNTRelogo{\vtop{\baselineskip10truept
\hsize= 0.8125in \smallcentrelogo \logofont
\smallskip
\centerline{ceNTRe}
\centerline{Macquarie University}
\centerline{Sydney, Australia 2109}} }

%--uncomment the \def\ceNTRelogo to disappear the logo,
%--or comment it to reappear it
%\def\ceNTRelogo{\relax}

\endinput
%-------------end of file AlfPreamble.tex------------------


\end{filecontents} 


\begin{filecontents}{option_keys}
\ifx\optionkeymacros\undefined\else\endinput\fi
% This document is in the Public Domain.
% It was created by Doug Henderson, Blue Sky Research,
% with modifications suggested by Joseph C. V�rilly.
% Added single quotes on 6-4-93.
%
% option_keys - 6-4-93 (last modification)
%
% This macro set defines characters found in the Apple Macintosh
% Monaco font. They allow users to simply type the keystroke 
% equivalent of the character desired, such as �, and have Textures�
% typeset it correctly, substituting the TeX macro equivalent
% for the character.
%
% The reason for the creation of this macro set was to take 
% advantage of Knuth's new TeX 3.0 capabilities with 8-bit character
% sets. This functionality has been included in our Textures� as
% of version 1.3. By typing in nearly any character from the 
% Macintosh keyboard, you can typeset with the characters directly 
% rather than needing to define macros for these diacritic characters. 
% Remember: these just expand single characters. They may not be
% defined in every context or mode.
%
% There are two sections to the macros; the first contains
% characters which can be rendered by depressing the option key
% and another key or shift and option keys with another key, 
% and secondly, a combination of various keystrokes together 
% to obtain the desired character. For example,
% to create the � character, you depress the option and o character
% at the same time; to create the uppercase version of �, you 
% hold the shift, option key, and o key down, and to create the
% � character, you first depress the option and n characters, 
% then next the shift and n characters. The option and n create
% the tilde character, and the shift n produce the N character.
%
% Math symbols and math operators need special attention. 
% When typing in math symbols the same 
% rules apply for math mode as before, namely, you must place dollar
% signs or double-dollar signs around these symbols. When typing
% in math operators, such as the square root symbol, TeX expects
% you to supply an argument following it. For example, if you
% would like to take advantage of the definition here for the
% plus-minus sign, �, and would like to type it directly for use
% in your text, you need to make sure you are in math mode when
% you call for the character, or simply place dollar signs around
% it to print only the plus minus sign thusly, $�$. Similarly,
% you also need to be in math mode when asking for the square root
% symbol, �, and additionally supply an argument to it. 
% The following example shows how to use both the plus-minus sign
% and the square root sign in an equation that has been simplified
% for you via these macro definitions.
%      $$-b��{b^2-4ac}\over{2a}$$

% define the macintosh "option" generated characters

\catcode`\�=\active\def�{{\aa}}       % option a
\catcode`\�=\active\def�{\int}        % option b (math mode) 
\catcode`\�=\active\def�{\c c}        % option c
\catcode`\�=\active\def�{\partial}    % option d (math mode)
\catcode`\�=\active\def�{\oint}       % option f (math mode) ?
\catcode`\�=\active\def�{\triangle}   % option j (math mode)
\catcode`\�=\active\def�{\neg}        % option l (math mode)
\catcode`\�=\active\def�{\mu}         % option m (math mode)
\catcode`\�=\active\def�{{\o}}        % option o
\catcode`\�=\active\def�{\pi}         % option p (math mode w/ arg.)
\catcode`\�=\active\def�{{\oe}}       % option q 
\catcode`\�=\active\def�{{\ss}}       % option s 
\catcode`\�=\active\def�{\dagger}     % option t  (math mode)
\catcode`\�=\active\def�{\sqrt}       % option v (math mode w/ arg.)
\catcode`\�=\active\def�{\Sigma}      % option w (math mode)
\catcode`\�=\active\def�{\approx}     % option x (math mode)
\catcode`\�=\active\def�{\Omega}      % option z (math mode)
\catcode`\�=\active\def�{{\it\$}}     % option 3 ($ from italic font)
\catcode`\�=\active\def�{\infty}      % option 5 (math mode)
\catcode`\�=\active\def�{{\S}}        % option 6 
\catcode`\�=\active\def�{{\P}}        % option 7
\catcode`\�=\active\def�{\bullet}     % option 8 
\catcode`\�=\active\def�{\leavevmode\raise.585ex\hbox{\b a}}      % option 9
\catcode`\�=\active\def�{\leavevmode\raise.6ex\hbox{\b o}}        % option 0
\catcode`\�=\active\def�{\not=}       % option = (math mode)
\catcode`\�=\active\def�{\leq}        % option , (math mode)
\catcode`\�=\active\def�{\geq}        % option . (math mode)
\catcode`\�=\active\def�{\div}        % option / (math mode)
\catcode`\�=\active\def�{{\dots}}     % option ; 
\catcode`\�=\active\def�{{\ae}}       % option '
\catcode`\�=\active\def�{\ll}         % option \ (math mode)
\catcode`\�=\active\def�{``}          % option [
\catcode`\�=\active\def�{!`}          % option !
\catcode`\�=\active\def�{\rlap/c}     % option 4
\catcode`\�=\active\def�{`}           % option ] 
\catcode`\�=\active\def�{'}           % shift option ]

% macintosh "shift-option" generated characters

\catcode`\�=\active\def�{{\AA}}       % shift-option A
\catcode`\�=\active\def�{\c C}        % shift-option C
\catcode`\�=\active\def�{{\O}}        % shift-option O
\catcode`\�=\active\def�{\Pi}         % shift-option P (math mode)
\catcode`\�=\active\def�{{\OE}}       % shift-option Q
\catcode`\�=\active\def�{{\AE}}       % shift-option '
\catcode`\�=\active\def�{\diamond}    % shift-option V (math mode)
\catcode`\�=\active\def�{\accent'27}  % shift-option 8
\catcode`\�=\active\def�{''}          % shift-option [
\catcode`\�=\active\def�{\pm}         % shift-option = (math mode)
\catcode`\�=\active\def�{\gg}         % shift-option \ (math mode)
\catcode`\�=\active\def�{?`}          % shift-option / 
\catcode`\�=\active\def�{--}          % option - (en-dash)
\catcode`\�=\active\def�{---}         % shift-option - (em-dash)

% define the macintosh "composite" characters

\catcode`\�=\active\def�{\"a}        % option u, then  a
\catcode`\�=\active\def�{\"e}        % option u, then  e
\catcode`\�=\active\def�{\"{\i}}     % option u, then  i
\catcode`\�=\active\def�{\"o}        % option u, then  o
\catcode`\�=\active\def�{\"u}        % option u, then  u
\catcode`\�=\active\def�{\"y}        % option u, then  y
\catcode`\�=\active\def�{\"A}        % option u, then  A
\catcode`\�=\active\def�{\"O}        % option u, then  O
\catcode`\�=\active\def�{\"U}        % option u, then  U
\catcode`\�=\active\def�{\'a}        % option e, then  a
\catcode`\�=\active\def�{\'e}        % option e, then  e
\catcode`\�=\active\def�{\'{\i}}     % option e, then  i
\catcode`\�=\active\def�{\'o}        % option e, then  o
\catcode`\�=\active\def�{\'u}        % option e, then  u
\catcode`\�=\active\def�{\'E}        % option e, then  E
\catcode`\�=\active\def�{\`a}        % option `, then  a
\catcode`\�=\active\def�{\`e}        % option `, then  e
\catcode`\�=\active\def�{\`{\i}}     % option `, then  i
\catcode`\�=\active\def�{\`o}        % option `, then  o
\catcode`\�=\active\def�{\`u}        % option `, then  u
\catcode`\�=\active\def�{\`A}        % option `, then  A
\catcode`\�=\active\def�{\~a}        % option n, then  a
\catcode`\�=\active\def�{\~n}        % option n, then  n
\catcode`\�=\active\def�{\~o}        % option n, then  o
\catcode`\�=\active\def�{\~A}        % option n, then  A
\catcode`\�=\active\def�{\~N}        % option n, then  N
\catcode`\�=\active\def�{\~O}        % option n, then  O
\catcode`\�=\active\def�{\^a}        % option i, then  a
\catcode`\�=\active\def�{\^e}        % option i, then  e
\catcode`\�=\active\def�{\^{\i}}     % option i, then  i
\catcode`\�=\active\def�{\^o}        % option i, then  o
\catcode`\�=\active\def�{\^u}        % option i, then  u

\let\optionkeymacros\null

\end{filecontents}


%%-----------------This ends attached files.


\documentclass{alf-j-l}
\usepackage{verbatim} 
\usepackage{url}  \urlstyle{sffont}
%\usepackage{array}
%\usepackage{hyperref} 
%\usepackage{graphics} 
\input AlfPreambleL  
%\input option_keys
\renewcommand{\thefootnote}{\ensuremath{\fnsymbol{footnote}}}

\def\tors{E(\Q)_{\mathrm{tors}}}
\def\ds{\displaystyle}

%\theoremstyle{theorem}  
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition} 

\theoremstyle{definition}  
\newtheorem{definition}[theorem]{Definition}
\newtheorem{xca}[theorem]{Exercise}
\newtheorem{Remark}[theorem]{Remark}
\newtheorem{UsefulRemark}[theorem]{Useful Remark}
\newtheorem{Example}{Example} 
\newtheorem{example*}{Example} 


\newtheorem*{main}{Main Theorem}
\newtheorem*{corollary}{Example Application}
\newtheorem*{motivation}{Principal Motivation}


\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark} 
%\newtheorem{example}[theorem]{Example} 
%\newtheorem*{example*}{Example} 
\newtheorem*{remark*}{Remark} 


%\def\publname{ALF'S PREPRINTS}

\def\datename{Typeset}

\def\volinfo{Paper \currentvolume,  \currentissue \paperdate}

\PII{Centre for Number Theory Research, Macquarie University, Sydney}%

\copyrightinfo{\number\year}{Alfred J van der Poorten} 



%\numberwithin{equation}{section}
%\dump
%\end{comment}
\begin{document}

  
 

%\setcounter{page}{69}
\def\currentvolume{165}
\def\currentissue{Draft of\ }
\def\paperdate{\today}
\def\ISSN{}
\pagespan{69}{\pageref{page:lastpage}}   

\def\ceNTRelogo{\relax}
\title {Quadratic Irrational Integers\rlap{\smash{\,\qquad\ceNTRelogo}}\\
With Partly Prescribed \\Continued Fraction
Expansion} 



%    Information for first author
\author{Alfred J. van der Poorten}
%    Address of record for the research reported here
\address{ceNTRe
for Number Theory Research, 1 Bimbil Place, Sydney, NSW 2071, %\hfill\break 
\penalty10000 Australia}
%    Current address
%\curraddr{School of MPCE, Macquarie University, Sydney, NSW 2109, Australia}
\email{alf@math.mq.edu.au (Alf van der Poorten)}

\dedicatory{To the memory of Professor Dr. Bela Brindza}


\thanks{This paper was commenced while the author enjoyed the
hospitality and support of the Erwin Schr\"odinger Institute, Vienna and
substantially augmented during an immediately subsequent visit to the
Kossuth Lajos University, Debrecen. The author was supported in part by
a grant from the Australian Research Council.}

\subjclass{Primary 11J70, 11A65, 11J68}

\date{\Now.}


\keywords{periodic continued fraction, function field%, real quadratic irrational integer
}

\begin{abstract}  We generalise remarks of Euler and of
Perron by explaining how to detail all quadratic integers for which the
symmetric part of their \cf\
\ex\ commences with prescribed partial quotients.\end{abstract}

\maketitle
%\thispagestyle{myheadings}
\pagestyle{myheadings}\markboth{{\headlinefont 
Alf van der Poorten}}{{\headlinefont Partly presribed quadratic integers}}


\noindent I last saw Bela Brindza, my once postdoctoral student,  in
April, 2002. I was working on the paper below and attempted to enthuse
him with its results, particularly those concerning periodic \ex s in
function fields of characteristic~zero.

\section{Periodic Continued Fractions}

\noindent Suppose $\omega$ satisfies $\omega^2-t\omega+n=0$ and is an integer. That is, its
trace $t=\omega+\ov\omega$ and norm $n=\omega\ov\omega$ both are rational integers. Then
it is well known that the \cf\ \ex\ of $\omega$ is periodic and is of the shape
\begin{equation} \label{eq:symmetry}
\omega=\CF{a_0\\\ov{a_1\\\ldots\\a_{r-1}\\2a_0-(\omega+\ov\omega)}},
\end{equation}
where the word $\cCF{a_1\\\ldots\\a_{r-1}}$ is a palindrome.

\begin{Example} \label{ex:1}
For example, $\sqrt{61}=\CF{7\\\ov{1\\4\\3\\1\\2\\2\\1\\3\\4\\1\\14}}$. Just so,
$(1+\sqrt{61}\,)/2$, an integer of trace~$1$, has \ex\ $\CF{4\\\ov{2\\2\\7}}$.
\end{Example}


Although the question was already asked and is partially answered by Euler,
see the very interesting translation \cite{WW}, and is discussed by
Perron
\cite{Pe}, it is noticeably less well known that given an arbitrary palindrome
$\cCF{a_1\\\ldots\\a_{r-1}}$ in positive integers there are infinitely many positive
integers $A=a_0$ so that
\eqref{eq:symmetry} displays the \ex\ of a quadratic integer. 

We explain that argument and
rather more. Indeed, noting that for every $h$ we have the \ex\
$\omega=\CF{A\\a_1\\\ldots\\a_h\\(\omega+P_{h+1})/Q_{h+1}}$ with
integers $P=P_{h+1}$, and $Q=Q_{h+1}$ (that is, the complete quotients
$\omega_{h+1}$ of $\omega$ all are of the indicated shape), we find all
quadratic integers $\omega$ for which the symmetric part of its \cf\ \ex\ commences with
the integers $\cCF{a_1\\\ldots\\a_{h}}$. Specifically, we find the constraints on $A$,
$P$, and $Q$ so that $\omega$ is indeed integral with trace
$t$ and norm $n$. 


Our remarks are of particular interest in the function field case, where
such translations as `positive integer'$=$ `\poly\ of degree at least one',
`integer part' $=$ `\poly\ part', and `integer'
$=$ `\poly' are to be applied. There, however, the results in the the characteristic two
case demand a distinct summary.



\section{Continued Fractions% of Quadratic Irrationals
}
\noindent  Anyone attempting to compute the truncations
$\CF{a_0\\a_1\\\ldots\\a_h}=x_h/y_h$ of a \cf\ will be delighted to notice that
the definition
$$\CF{a_0\\a_1\\\ldots\\a_h}=a_0+ 1/\CF{a_1\\\ldots\\a_h}$$ immediately
implies by induction
on $h$ that there is a correspondence
$$\begin{pmatrix} a_0&1\\1&0\end{pmatrix}\begin{pmatrix}
a_1&1\\1&0\end{pmatrix}\cdots
\begin{pmatrix} a_h&1\\1&0\end{pmatrix}=\begin{pmatrix}
x_h&x_{h-1}\\y_h&y_{h-1}\end{pmatrix}
\longleftrightarrow \CF{a_0\\a_1\\\ldots\\a_h}=x_h/y_h
$$
between products of certain two by two matrices and the convergents of \cf s. 

If $\alpha=
\CF{a_0\\a_1\\a_2\\\ldots}$ then the sequence $(\alpha_h)$ of complete quotients
of $\alpha$ is defined by $\alpha=\CF{a_0\\a_1\\\ldots\\a_h\\\alpha_{h+1}}$.
It follows from the correspondence that
\begin{multline*}%\label{eq:correspondence}
\alpha\longleftrightarrow
\begin{pmatrix} a_0&1\\1&0\end{pmatrix} \begin{pmatrix} a_1&1\\1&0\end{pmatrix}
\cdots \begin{pmatrix} a_h&1\\1&0\end{pmatrix} \begin{pmatrix}
\alpha_{h+1}&1\\1&0\end{pmatrix} \\ =\begin{pmatrix}
x_h&x_{h-1}\\y_h&y_{h-1}\end{pmatrix} \begin{pmatrix}
\alpha_{h+1}&1\\1&0\end{pmatrix}
\longleftrightarrow \frac{x_h\alpha_{h+1}+x_{h-1}}{y_h\alpha_{h+1}+y_{h-1}}\,.
\end{multline*}
That is, we have
$$\alpha=\frac{x_h\alpha_{h+1}+x_{h-1}}{y_h\alpha_{h+1}+y_{h-1}}, \quad\text{and so}\quad 
\alpha_{h+1}=-\frac{y_{h-1}\alpha-x_{h-1}}{y_{h}\alpha-x_{h}}.
$$
Recalling that $x_{-1}=1$, $y_{-1}=0$ because an empty matrix
product is the identity matrix, we obtain
\begin{equation}(-1)^{h+1}\alpha_1\alpha_2\cdots \alpha_{h+1}=(y_{h}\alpha-x_{h})^{-1}.
\label{eq:identity}\end{equation}

\begin{comment}
Notice, incidentally, that if a product of matrices corresponds to $x_h/y_h$
then so does any nonzero multiple of that product of matrices.

\begin{Example} \label{ex:1}
For example, $\sqrt{61}=\CF{7\\1\\4\\3\\\ldots}$. Thus the computation
$$\begin{pmatrix}7&1\\1&0\end{pmatrix}\begin{pmatrix}1&1\\1&0\end{pmatrix}\begin{pmatrix}4&1\\1&0\end{pmatrix}
\begin{pmatrix}3&1\\1&0\end{pmatrix}=\begin{pmatrix}125&39\\16&5\end{pmatrix}
$$
reports that $39/5$ and $125/16$ are consecutive convergents to $\sqrt{61}$.\end{Example}
%\end{comment}
\begin{Example} \label{ex:2} 
Indeed, set $\delta=\sqrt{61}$ and let $\ov\delta$ denote its conjugate, $-\sqrt{61}$. 
The \cf\
\ex\ of $\delta$ commences
\begin{alignat*}{3}
&\delta \,&&=7 &&-(\,\ov\delta+7)/1\\
\delta_1=(&\delta+7)/12&&=1 &&-(\,\ov\delta+5)/12\\
\delta_2=(&\delta+5)/3&&=4 &&-(\,\ov\delta+7)/3\\
\delta_3=(&\delta+7)/4&&=3 &&-(\,\ov\delta+5)/4\,.
\end{alignat*}
\begin{comment}
\begin{alignat*}{3}
&\delta \,&&=7 &&-(\,\ov\delta+7)/1\\
\delta_1=(&\delta+7)/12&&=1 &&-(\,\ov\delta+5)/12\\
\delta_2=(&\delta+5)/3&&=4 &&-(\,\ov\delta+7)/3\\
\delta_3=(&\delta+7)/4&&=3 &&-(\,\ov\delta+5)/4\\
(&\delta+5)/9&&=1 &&-(\,\ov\delta+4)/9\\
(&\delta+4)/5&&=2 &&-(\,\ov\delta+6)/5\\
(&\delta+6)/5&&=2 &&-(\,\ov\delta+4)/5\\
(&\delta+4)/9&&=1 &&-(\,\ov\delta+5)/9\\
(&\delta+5)/4&&=3 &&-(\,\ov\delta+7)/4\\
(&\delta+7)/3&&=4 &&-(\,\ov\delta+5)/3\\
(&\delta+5)/12&&=1 &&-(\,\ov\delta+7)/12\\
(&\delta+7)/1 &&=14 &&-(\,\ov\delta+7)/1
\end{alignat*}
and plainly is periodic. 
%\end{comment}
Note, in part to set notation, that a
typical line in this tableau is
\begin{equation} \label{eq:expansion}
\delta_h=(\delta+P_h)/Q_h=a_h-(\ov\delta+P_{h+1})/Q_h\,,
\end{equation} 
where 
\begin{equation} \label{eq:recursion}
P_h+P_{h+1}+(\delta+\ov\delta\,)=a_hQ_h   \quad\text{and}\quad
-Q_hQ_{h+1}=\delta\ov\delta+(\delta+\ov\delta\,)P_h+P_h^2\,.\end{equation}
Thus, by \eqref{eq:identity} and \eqref{eq:recursion},
\begin{equation} \label{eq:norm}x_h^2-61y_h^2=\Norm(x_h-\delta
y_h)=\Norm(\delta_1\delta_2\cdots\delta_{h+1})=(-1)^{h+1}Q_{h+1}\,.
\end{equation}
\end{Example}
One can, by \eqref{eq:expansion} and \eqref{eq:recursion}, readily confirm
that the
\cf\
\ex\ of
$\delta$ \emph{is} eventually periodic.  Indeed, by induction one
notices that both  
\begin{equation}\label{eq:ineq}
0\lt 2P_{h+1}+(\delta+\ov\delta)<\delta-\ov\delta \quad\text{and}\quad
0\lt Q_h<\delta-\ov\delta\,.
\end{equation}
Thus the box principle guarantees
periodicity. 

Moreover, conjugation is an involution on the tableau (hence my
eccentric way of denoting the remainders), turning the tableau upside
down. At the cost of replacing $\delta_0$ by $\delta+7$ at line $h=0$
and continuing the expansion to see the additional symmetry at lines $h=5$
and $6$ (see Example~\ref{ex:3}) we could both again have proved
periodicity and have confirmed that the preperiod is just the line $h=0$. 

Suppose, more generally, that $\omega^2-t\omega+n=0$ and that $\omega$ is
the larger real zero. Then our remarks apply without essential change to
$\omega$ in place of $\sqrt{61}$. In the function field case, with $\omega$
replaced by $Y(X)$ and $\deg_X Y=g+1$, the cited inequalities \eqref{eq:ineq}
become
$\deg Q_h\le g$ and $\deg P_{h+1}=g+1$. Now, however, the box principle does
not apply (unless the base field is finite) and periodicity is at best
happenstance. Nonetheless, if periodicity happens to happen then the period
will indeed commence no later than at line $1$. 

The issue of periodicity is encapsulated by the following remark emphasising
that periodicity coincides with the existence of units.
\begin{proposition} Let $x$ and $y$ be positive integers so that
$x^2-txy+ny^2=\pm1$. \label{pr:1}
Then the decomposition
$$N=\begin{pmatrix} x&-ny\\y&x-ty\end{pmatrix}=\begin{pmatrix} b_0&1\\1&0\end{pmatrix}
\begin{pmatrix} b_1&1\\1&0\end{pmatrix}\cdots\begin{pmatrix} b_{r}&1\\1&0\end{pmatrix}
\begin{pmatrix} 0&1\\1&0\end{pmatrix}
$$
in positive integers $b_0$, $b_1$, $\ldots\,$, $b_{r}$ entails that 
$$\omega=\CF{\ov{b_0\\b_1\\\ldots\\b_{r-1}\\b_r\\0}}=
\CF{b_0\\\ov{b_1\\\ldots\\b_{r-1}\\b_r+b_0}}
$$
for some $\omega$ satisfying $\omega^2-t\omega+n=0$.
\end{proposition}
\begin{proof}
Consider the
periodic \cf\
$$\CF{\overline{b_0\\b_1\\\ldots\\b_r\\0}\,}=\gamma\,,\quad\text{say.}
$$
Thus $\gamma=\CF{{b_0\\b_1\\\ldots\\b_r\\0}\\\gamma\,}$. By the matrix
correspondence we have
$$\gamma\longleftrightarrow N\begin{pmatrix}\gamma&1\\1&0\end{pmatrix}=
\begin{pmatrix} x\gamma-ny&x\\y\gamma+x-ty&y\end{pmatrix} \quad\text{so}\quad
\gamma=\frac{x\gamma-ny}{y\gamma+x-ty}\,.
$$
But this is $y(\gamma^2-t\gamma+n)=0$. Hence $y\ne0$ 
confirms our claim.
\end{proof}
Note here that $x/y=\CF{b_0\\b_1\\\ldots\\b_{r-1}}$ provides the unit
$x-\omega y$. Moreover, the symmetry of the matrix
$$N\begin{pmatrix} t&1\\1&0\end{pmatrix}=
\begin{pmatrix} -ny+tx&x\\x&y\end{pmatrix}
$$
confirms that the word $\cCF{b_0\\b_1\\\ldots\\b_{r-1},b_r+t}$ is a
palindrome, again explaining the symmetry under conjugation to which we
alluded above. 

\begin{Example} \label{ex:3}
The expansion of $\delta=\sqrt{61}$ continues with the lines
\begin{alignat*}{3}
\delta_4=(&\delta+5)/9&&=1 &&-(\,\ov\delta+4)/9\\
\delta_5=(&\delta+4)/5&&=2 &&-(\,\ov\delta+6)/5\\
\delta_6=(&\delta+6)/5&&=2 &&-(\,\ov\delta+4)/5
\end{alignat*}
with $Q_5=Q_6$ signalling the symmetry. Notice that in this case the
period length $r=11$ is odd (equivalently, the fundamental unit of
$\Z[\sqrt{61}]$ has norm $-1$).

For a case $r=2s$, even, the symmetry is given by the line
$$\omega_s=(\omega+P_s)/Q_s=a_s-(\ov\omega+P_{s})/Q_s\,,
$$
that is, by $P_{s+1}=P_s$\,. We have $Q_s\Div
(2P_s+t)$. In this `ambiguous' case, that is equivalent to $Q_s$ also
dividing the discriminant $t^2-4n$ of the quadratic order
$\Z[\omega]$.
\end{Example}

\section{Quadratic Integers with Partly Prescribed Expansion}
\begin{theorem}\label{th:2} Suppose that $\omega^2-t\omega+n=0$ and its \cf\
\ex\ is
$$\omega=\CF{A\\a_1\\a_2\\\ldots\\a_h\\(\omega+P_{h+1})/Q_{h+1}}.
$$
Set $P=P_{h+1}$, $Q=Q_{h+1}$, and
$$\begin{pmatrix} a_1&1\\1&0\end{pmatrix}\begin{pmatrix} a_2&1\\1&0\end{pmatrix}
\cdots\begin{pmatrix} a_{h}&1\\1&0\end{pmatrix}=
\begin{pmatrix} p&p'\\q&q'\end{pmatrix}.
$$
Then both
\begin{align*}p(P^2+tP+n)+p'Q(A+P)&=-q'Q\,,\\
p(A^2-tA+n)+q(A+P)&=-q'Q\,.
\end{align*}

\end{theorem}
\begin{proof} The data is equivalent to
\begin{multline*}
\begin{pmatrix} A&1\\1&0\end{pmatrix}\begin{pmatrix} p&p'\\q&q'\end{pmatrix}\begin{pmatrix}
1&P\\0&Q\end{pmatrix} =\begin{pmatrix} x&-ny\\y&x-ty\end{pmatrix}\\ =\begin{pmatrix}
Ap+q&Ap'+q'\\p&p'\end{pmatrix}\begin{pmatrix} 1&P\\0&Q\end{pmatrix} =\begin{pmatrix}
Ap+q&P(Ap+q)+Q(Ap'+q')\\p& Pp+Qp'\end{pmatrix}
\end{multline*} Thus $x=Ap+q$ and $y=p$  and $Pp+Qp'=Ap+q-pt$. Hence
\begin{align} \label{eq:first} p(A-t-P)-p'Q&=-q\\ p(PA+n)+p'QA&=-qP-q'Q\notag
\end{align} Strategic additions of multiples of the first equation to the
second provides the allegation.\end{proof}

\subsection{The Classical Result}\label{ss:classical}
Specifically, if $h=r-1$ so that we are given the complete symmetric
part of the period of $\omega$, then $P=A-t$, $Q=1$ and the identities
become
$$Np-Tq=-q' \quad\text{with $N=\Norm(\omega-A)$ and
$T=\Trace(\omega-A)$.}
$$
Because $pq'-p'q=(-1)^{r-1}$, we know immediately that the general solution
for the integers $N$ and $T$ is
\begin{equation}\label{eq:classical}
N=(-1)^r({\smash{q'}}^2-Lq) \quad\text{and}\quad T=(-1)^r(p'q'-Lp),
\end{equation}
where $L$ is an arbitrary integer. The latter equation
congenially reports that
$$2A=t-(-1)^r(p'q'-Lp)\,.
$$
Thus if $p'$ and $q'$ both are odd while $Lp$ is even then $t$ must be
taken odd; say $t=1$ as in $\omega=\frac12(1+\sqrt D)$; here $D=T^2-4N$.
In all other cases one may take
$t=0$ and obtain
$\omega$ the square root $\sqrt D$ of an integer, not a square; then
$4D=T^2-4N$. In either case, of course, $D=D(L)$ is a \poly\ quadratic in
the integer parameter~$L$. Distinguishing the cases brings difficulties,
see for example \cite{McL}.



In the function field case this parity matter is no issue, unless the
characteristic is $2$ where we see that then $t=p'q'+Lp$, with $L$ an
arbitrary polynomial, gives us all possible discriminants
$t^2-4n=t^2$.



\begin{comment}It may not be totally obvious
that the theorem gives helpful constraints on those quadratic irrationals
$\delta$ which have a given word
$\cCF{a_1\\a_2\\\ldots\\a_h}$ at the start of the period of their \cf\ \ex.
\end{comment}

\subsection{The General Result} 
We recall $pq'-p'q=(-1)^h$ and 
$(P^2+tP+n)=-Q_{h}Q:=-Q'Q$. Thus  we
have the two general solutions
\begin{alignat*}{3} P^2+tP+n &=(-1)^{h+1}Q(q'{}^2-K_1p') &\qquad &  
-(A+P) &&=(-1)^{h+1}(qq'-K_1p)\,,\\ A^2-tA+n &=(-1)^{h+1}(q'{}^2Q-K_2q)
&\qquad&  -(A+P) &&=(-1)^{h+1}(p'q'Q-K_2p)\,,
\end{alignat*} where $K_1$ and $K_2$ denote arbitrary integers. Set
$kq'=K=:K_2-K_1$.
\label{ss:general}

The dexter
pair of equations is
$Kp=q'(p'Q-q)$. Indeed $q'$ does divide $K$ and
also $q+kp\equiv0\pmod {p'}$, showing that $K$ is fixed modulo~$p'q'$.
In fact, because $pq'=(-1)^h+p'q$, we have $k\equiv(-1)^{h+1}qq'\pmod{p'}$.
Thus, for integers~$L$,
\begin{equation}\label{eq:k}
(-1)^{h+1}k=qq'-Lp' \quad\text{and then}\quad (-1)^{h+1}Q=q^2-Lp\,;
\end{equation}
and $L=q'Q-kq$. Note that \eqref{eq:k} in any case is immediate from
\eqref{eq:first} at page~\pageref{eq:first} above. Hence, at very
first glance surprisingly, knowing
$Q_{h+1}$ as well as
$a_1$,
$\ldots\,$, $a_h$ restricts us to just one parameter families of solutions.


The
sinister equations and those for
$A+P$, very helpfully yield
$A-t-P=k$, and therefore, with $T=\Trace(\omega-A)$, $N=\Norm(\omega-A)$,
\begin{equation}\label{eq:trace}
T=(-1)^{h}(K_1p-Lp'),\quad N=(-1)^h (K_1q-Lq').
\end{equation}
Thus the discriminant
$t^2-4n=T^2-4N$ is a quadratic expression in $K_1$ and~$L$.  

Note, however,
that many choices of $K_1$ and $L$ lead to inadmissible cases. For
instance, we must have $t^2-4n$ a positive non-square; and $Q$ positive
obviously constrains $L$. 

Additional data, such as a relationship on the
quantities
$P$, $Q$, and $Q'$, leads to just a family of 
polynomials quadratic in one variable as in the classical case; in that
context see Halter-Koch and Pacher
\cite{HP}, which expands considerably on \cite{118} and
\cite{111}.

The special case $Q=Q'$ entails $(-1)^{h+1}Q=K_1p'-\smash{q'}^2$. The
special case $P=P':=P_h$ is $Q\Div (2P+t)$; note that
$2P+t=(-1)^h(2qq'-Lp'-K_1p)$. Again in these cases,
the families of discriminants are quadratic \poly s in the surviving
parameter. Conversely, of course, the quadratic \poly s $D(L)$, say,
have the property that the period length of $\sqrt{D(l)}$, $l$
an integer for which $D(l)$ is positive and not a square, is constant
for all but possibly several exceptional~$l$. This case is discussed by
Schinzel~\cite{Schi}; see also
\cite{121} and note the `sleepers' of \cite{171}.
%\begin{comment}
\begin{Example} \label{ex:4} Suppose we are given just $a_1=1$,
$a_2=4$; that is: $p=5$, $q=4$, $p'=1$, $q'=1$. Thus
\begin{alignat*}{3} P^2+tP+n &= Q(K_1-1) &\qquad &   A+P
&&= 4-5K_1\,,\\ A^2-tA+n &= 4K_2-Q &\qquad& 
A+P &&= Q-5K_2\,.
\end{alignat*} 
The equations on the right yield $Q-4=5(K_2-K_1)$. Subtracting
the first equation on the left from the second gives
$(A+P)(A-t-P)=4K_2-QK_1$. Substituting for $Q$ this is 
$(K_2-K_1)(4-5K_1)$, so indeed $A-t-P=K_2-K_1$. Thus if $Q=4$ then
$A-t=P$ and $2A-t=4-5K_1$. The smallest example then has $A-t=7$ with
$K_2=-2$ and so $t^2-4n=4\cdot61$.
\end{Example}
\begin{Example} \label{ex:5} Given $a_1=1$,
$a_2=4$, $a_3=3$, $a_4=1$, $a_5=2$, together with $Q_5=Q_6$ ---
so that we are half way in a period of odd length, we have
$p=58$, $q=47$, $p'=21$, $q'=17$. Thus 
\begin{alignat*}{3} -Q' &= 289-21K_1 &\qquad &   A+P
&&= 58K_1-799\,,\\ A^2-tA+n &= 289Q-47K_2 &\qquad& 
A+P &&= 58K_2-357Q\,.
\end{alignat*} 
On the right we see that $357Q-799\equiv9Q-45\equiv0\pmod{58}$
and only the smallest example, that with $Q=5$, is going to be
at all small. Moreover, if $Q=5$ then $K_2-K_1=q'K=17$, so $k=1$.
Recalling that
$Q'=Q$, the equation for
$-Q'$ gives $K_1=14$, and so $K_2=31$. All that amounts to $A+P=13$.
As above, we also have $(A+P)(A-t-P)$, so $2P+t=12$ and $2A-t=14$. We see
that  $t^2-4n=4\cdot61$. 

This example is just of the right size reliably to check our formulas just
above at the start of
\S\ref{ss:general}; we need only that the choice $Q=5$ is $L=38$, and then
$Q=Q'$ is $K_1=14$.

\end{Example}
\begin{Example} \label{ex:6}
Given $a_1=2$ and $P=P_2=P_3$, signalling halfway in a period
of even length, we have $p=2$, $q=1$, $p'=1$, $q'=0$. Hence $K_2=K_1$,
and
$(A+P)(A-t-P)=K_1(Q-1)$. Since $A+P=2K_1$ we see that $A-t-P=(Q-1)/2$ and $Q$
is odd. Thus the condition $Q\Div (2P+t)$ is $4K_1\equiv-1\pmod Q$. We obtain
a family of possible discriminants controlled by one near arbitrary
integer parameter and by $(2P+t)/Q$.
\end{Example}
%\end{comment}
\section{Function Fields} \label{s:4}
\noindent We will apply Theorem~\ref{th:2} in function fields (with base
field not of characteristic two) to determine \poly s of even degree whose
square root has a periodic
\cf\
\ex\ defined over the base field. We first look at quartic \poly s
$D(X)=A^2+4v(X+w)$ and, as example, first consider the case 
$$\sqrt D=\CF{A\\\overline{B\\C\\E\\C\\B\\2A}\,}$$
with $B$, $C$, and $E$ of degree~$1$, and $A$ of course of degree~$2$. Note
here that the
\emph{regulator}, namely the degree of the unit, or, equivalently, the sum of
the degrees of the
\pq s comprising the period, is $m=7$.



In order to apply the classical result we must first compute
\begin{multline*}
\begin{pmatrix} B&1\\1&0\end{pmatrix}\begin{pmatrix}
C&1\\1&0\end{pmatrix}
\begin{pmatrix} E&1\\1&0\end{pmatrix}
\begin{pmatrix} C&1\\1&0\end{pmatrix}\begin{pmatrix} B&1\\1&0\end{pmatrix}
\\=\begin{pmatrix} BCECB+ECB+2BCB+BCE+2B+E&BCEC+EC+2BC+1
\\CECB+2CB+CE+1&CEC+2C\end{pmatrix}.
\end{multline*}
Next we write say $B=b(X+\beta)$, $C=c(X+\gamma)$, and $E=e(X+\varepsilon)$,
allowing us explicitly to detail the \poly s $p$, $q=p'$, and $q'$ appearing in
the proof of Theorem~\ref{th:2}. In particular, we notice that $\deg p=5$,
$\deg q=4$, and $\deg q'=3$. We then endeavour to find $A$.

Indeed, by  Theorem~\ref{th:2} we know that $2A=Kp-qq'$ (noting that here
$t=0$ and $h=5$); in principle $K$ denotes an arbitrary \poly.

However, we require $\deg D=4$, and therefore that $\deg A=2$. Because 
$\deg qq'=7$ and $\deg p=5$ it follows that $K$ must be of degree $2$.
Thus we detail $Kp-qq'$, say with $K=kX^2+k'X+k''$, and set the 
leading coefficients of $2A$, those of $X^7$, $X^6$, $\ldots\,$, and $X^3$, equal
to zero.

Note that there are a total of $9$ unknowns $k$, $\ldots\,$, $b$, $\beta$,
$\ldots\,$, thus far controlled by
the $5$ conditions ensuring that $A$ is of degree just~$2$.

But we can tame $D(X)$, and hence $A(X)$, considerably further. First, it
loses no generality to divide by the leading coefficient of $D$
(this must be a square because $A$ is defined over the base field) and, thus,
to suppose
$D$ is monic. Second, we may translate
$X$ by a constant, thus fixing the coefficient of $X^3$ of $D$ (and hence the
coefficient of $X$ of
$A$), say to $0$. That leaves two degrees of freedom. Third, we may dilate
$X$, replacing it by a nonzero multiple, and then divide by the new leading
coefficient; one finds that for quartics such a dilation reduces the number
of free variables by one in all but the cases $m=2$ and $m=3$. From
related work \cite{158} it happens I know that a congenial dilation
is that yielding
$c=2$.

All that reduces the degrees of freedom to just one. We therefore should find
at most a one parameter family of possibilities for $A(X)=X^2+u$, say, thus for
$D$, and hence for each of the already mentioned `unknowns'.
    
\subsection{The Classical Result in Action}It would be neat to apply
the classical result to the example but, frankly, the hard yakka\footnote{
\textsf{yakka}: work [Australian Aboriginal].} involved seems inappropriate
here, so we'll retreat to the case $m=5$ and leave it to the reader to check
that there
$p=BCB+2B$, $q=p'=CB+1$, and $q'=B$, and that \emph{mutatis mutandis} we will
there too find a one parameter family of \cf s; in the case $m=5$ we will need
$\deg K=0$ and will set $K=k$.

For $m=5$, when we review the coefficients of $2A(X)=2(X^2+u)=Kp-qq'$ we find
that
$$\displaylines{X^3:kb^2c-bc^2 \quad\text{which vanishes, so
$kb=c$;}\quad\hfill\\
X^2:kb^2c(2\beta+\gamma)-b^2c(\beta+2\gamma)=bc^2(\beta-\gamma)\hfill\\
X^{\phantom{2}}:
kb^2c(2\beta\gamma+\beta^2)+2kb-bc^2(2\beta\gamma+\gamma^2)-c
=bc^2(\beta-\gamma)(\beta+\gamma)+c\hfill\\
\rlap{1}\hphantom{X^0}:
kb^2c\beta^2\gamma+2kb\beta-bc^2\beta\gamma^2-c\gamma
=bc^2(\beta-\gamma)\beta\gamma+c(2\beta-\gamma)
\hfill
}$$
Just so, it will be convenient to check the consistency of our solution by noting that the
coefficients of $Kq-{q^{\smash{\prime}}}^2=D-A^2=R$, say, are given by
$$\displaylines{X^2:kbc-c^2 \quad\text{which must vanish, so $kb=c$};\quad\hfill\\
X^{\phantom{2}}:kbc(\beta+\gamma)-2c^2\gamma=c^2(\beta-\gamma)\hfill\\
\rlap{1}\hphantom{X^0}:kbc\beta\gamma+k-c^2\gamma^2=c^2(\beta-\gamma)\gamma+k\hfill
}$$
Our normalisation $A=X^2+u$ gives $bc^2(\beta-\gamma)=2$, and then $2(\beta+\gamma)+c=0$.
Dilating
$X$ by the ratio $-(\beta+\gamma)$ is equivalent to taking $\beta+\gamma=-1$. If, further, we
choose to write $\beta-\gamma=s$, then $\beta=(s-1)/2$, $\gamma=-(s+1)/2$, and we obtain
$2u=(1-s^2)/2+(3s-1)$, or $u=-(s^2-6s+1)/4$. Because $bc^2(\beta-\gamma)=4bs=2$  we have
$b=1/2s$, $c=2$, and $k=4s$.

Further, we find that $R(X)=4sX-2s(s+1)+4s=4sX-2s(s-1)$. Thus
\begin{equation}\label{eq:fam5}
Y^2=D(X)=\bigl(X^2-\tfrac14(s^2-6s+1)\bigr)^2+4s\bigl(X-\tfrac12(s-1)\bigr)
\end{equation}
is the family of monic quartic \poly s defined over $\K=\Q(s)$ and with zero
trace so that the function field $\K(X,Y)$ has a unit of regulator~$5$.






One should promptly check such an allegation. Indeed, we find that 
\begin{multline*}
Y=\lCF{X^2-\tfrac14(s^2-6s+1)\\\ol{\bigl(X+\tfrac12(s-1)\bigr)/2s}}\\
\rCF{\ol{2\bigl(X-\tfrac12(s+1)\bigr)\\\bigl(X+\tfrac12(s-1)\bigr)/2s
\\2\bigl(X^2-\tfrac14(s^2-6s+1)\bigr)}}.
\end{multline*}
This computation provides the reminder that of course $s=0$ is not admissible because, if $s=0$,
then
$D$ is a square. 





\subsection{The Generalised Result in Action} \label{ss:PlanA'}
Notwithstanding this success of the classical result, the case
$m=7$ already seems too painful for any other than a willing and 
energetic student. Our generalisation should however at least halve the
pain and, it is to be hoped, more than double the willingness. 

Recall we suppose $Y^2=D(X)=(X^2+u)^2+4v(X+w)=A^2+R$. In applying the new
result we first compute just
$$\begin{pmatrix} B&1\\1&0\end{pmatrix}\begin{pmatrix} C&1\\1&0\end{pmatrix}
=\begin{pmatrix} BC+1&B\\C&1\end{pmatrix}=\begin{pmatrix} p&p'\\q&q'\end{pmatrix}
$$
so $p=BC+1$, $p'=B$, $q=C$, $q'=1$ and note that $Q\Div(2P+t)$. 
Checking degrees in the equations at \S\S\ref{ss:general} we see the $K_i$
are constants
$k_i$, and as remarked, we obtain
$A-t-P=k_2-k_1=k$, say, $(BC+1)k=(BQ-C)$, $A+P=C-k_1(BC+1)$. 

Comparing coefficients in that last equation yields
$$\displaylines{
X^2: 2=-k_1bc\hfill\\
X\phantom{^2}: 0=
c-k_1bc(\beta+\gamma)=c+2(\beta+\gamma),\hfill }$$
the latter by normalisation whereby $A$, and so also $P$, has zero trace. By
dilation we may choose $c=2$ obtaining $k_1b=-1$ and $\beta+\gamma=-1$.

We note that $E$ is the integer part of $(Y+P)/Q$. Hence, because $D(X)$
is monic and has  zero trace, necessarily $Q=2(X-\varepsilon)/e$.
Thus
$(BC+1)k=(BQ-C)$ alleges that
$$\displaylines{
X^2: kbc=2b/e, \quad\text{so}\quad 2=kce;\hfill\\
X\phantom{^2}: kbc(\beta+\gamma)=2b(\beta-\varepsilon)/e-c
\quad\text{or}\quad kb(\gamma+\varepsilon)=-1;\hfill\\
\rlap{1}\hphantom{X^0}: kbc\beta\gamma+k=-2b\beta\varepsilon/e-c\gamma
\quad\text{or}\quad kbc\beta(\gamma+\varepsilon)=-k-c\gamma=-c\beta\,,\hfill
\\\hfill\quad\text{and so}\quad c(\beta-\gamma)=k
.\quad}$$
The equation $-Q'=(-1)^{h+1}(q'{}^2-K_1p')$ contains no new information
other than for the reminder that in fact $C=c(X+\gamma)$ entails
$Q'=2(X-\gamma)/c$. Just so the equation for $A^2-tA+n$ simply gives 
$-R$.

However, the condition that $Q=2(X-\varepsilon)/e$ divides
$2P+t=-k+C-k_1BC-k_1$ says that
$-k+c(X+\gamma)-k_1bc(X^2+(\beta+\gamma)X+\beta\gamma)-k_1$
has $\varepsilon$ as a zero.
That is
$$-k_1bc\varepsilon^2=k-c\gamma+k_1bc\beta\gamma+k_1 \quad\text{so}\quad
2\varepsilon^2=k-(2\gamma+2\beta\gamma-k_1).$$
Subtracting $2\gamma^2$ from each side of this equation we get
$$2(\varepsilon^2-\gamma^2)=2(\varepsilon-\gamma)(\varepsilon+\gamma)
=k-2\gamma-2\gamma(\beta+\gamma)+k_1
=k+k_1\,.$$
Set $\varepsilon+\gamma=-s$. Notice that $kbs=1$ and $k_1b=-1$ gives
$k_1=-ks$. We have
$$
\begin{aligned}
\beta+\gamma&=-1\qquad\text{or}\qquad&&2(\beta+\gamma)s=-2s\\
\varepsilon+\gamma&=-s\qquad&&2(\varepsilon+\gamma)s=-2s^2\\
2(\beta-\gamma)&=k\qquad&&2(\beta-\gamma)s=ks\\
2(\varepsilon-\gamma)s&=k(s-1)\qquad&&2(\varepsilon-\gamma)s=k(s-1)\,.\\
\end{aligned} 
$$
It is now straightforward to solve the various equations and to obtain
\begin{align}
B&=\bigl(X+\tfrac12(s^2-s-1)\bigr)/2s^2(s-1)\notag\\\label{eq:solution}
C&=2\bigl(X-\tfrac12(s^2-s+1)\bigr)\\
E&=\bigl(X+\tfrac12(s^2-3s+1)\bigr)/2s(s-1)\notag\,,
\end{align}
as well as $k=2s(s-1)$.   As remarked, we obtain $A$ from
$2A-t=k+C-k_1BC-k_1$ and $v(X+w)$ as $Q-(k+k_1)C$. Thus
$Y^2=(X^2+u)^2+4v(X+w)=A^2+R$ with
$$A=X^2-\tfrac14(s^4-6s^3+3s^2+2s+1) \quad\text{and}\quad
R=4s^2(s-1)\bigl(X-\tfrac12(s^2-s-1)\bigr).
$$
On our checking, a direct computation of the \cfe\ of $Y$ so given indeed
yields the 
\pq s predicted at \eqref{eq:solution} above.

\section{Comments}

\subsection{Schinzel's theorem} Andrzej Schinzel~\cite{Schi} shows that
if a \poly\ $D(X)$ taking integer values at integers $l$ has the
property that the length of the period of the \cfe\ of $\sqrt{D(l)}$ is
bounded as $l\to\infty$ then (a) the function field $\Q(X,Y)$ ---
where $Y=\sqrt{D(X)}$ --- contains non-trivial units; equivalently, the
function field \cfe\ of $Y$ is periodic, and (b) some nontrivial units
$a(X)+b(X)Y$ in $\Q(X,Y)$ have both $a$ and $b$ in $\Z[X]$. If $\deg
D=2$, say $D(X)=A^2X^2+BX+C$, then the function field condition (a) is
trivial, but the arithmetic condition (b) entails that the
discriminant $(B^2-4A^2C)$ divides
$4 (2A^2,B)^2$.

Section~\ref{s:4} above provides examples of classes of \poly s of
degree~$4$ satisfying the function field condition (a). Roger Patterson,
see~\cite{Pa}, has carried through the interesting exercise of finding
which values of the parameters lead to (b) also being satisfied; see also
comments in~\cite{171}.

\subsection{Explicit continued fraction expansion} I have learned how
explicitly to expand the general quartic (and sextic)  \poly, that is,
I found nontrivial recursion relations on the complete
quotients; see~\cite{163}. In principle, at any rate, those
techniques generalise to higher genus cases. Thus, fortunately perhaps,
the ideas of
\S\ref{s:4} are mostly an amusing diversion rather than a necessary
method.

\subsection{Short periods and long periods} In principle one is
interested in relatively long periods, in the hope of obtaining insight
into Gauss's conjecture to the effect that the majority of real quadratic
number fields with prime discriminant have class number one. In that
context, short periods, as discussed here only give one a view of the
enemy. Nonetheless, as wonderfully exemplified by recent work of
Andr\'as Bir\'o, \cite{Bi1, Bi2}, the short case raises
fascinating issues. The \poly s
$X^2+4$ and
$4X^2+1$ satisfy Schinzel's conditions so we can write the corresponding
numerical periods explicitly. That gives, as Bir\'o ingeniously shows,
sufficient handle on the matter after all to determine all cases $X=l$
that yield class number one. But, for example, the corresponding class
number two problems appear yet less accessible because as $l$ varies one
seems not to have a bound on the period length of expansions of 
reduced elements not from the principal class.

It's not so much the length of the period as the size of the
regulator (the logarithm of the absolute value of the fundamental
unit) that matters. Discriminants $D$ belonging to families alluded
to in this paper have regulator $O(\log D)$ only. In fact, see
\cite{Pa, 171}, it seems that if one has a formula for the units of a
parametrised family then the regulators are never more than 
$O\bigl((\log D)^2\bigr)$.


%\newpage


\bibliographystyle{amsalpha}
\begin{thebibliography}{ABC}

 




\bibitem{Bi1} Andr\'as Bir\'o, `Yokoi's conjecture',  \emph{Acta
Arith.}  {\bf 106\/}.1  (2003), 85--104.

\bibitem{Bi2} \bysame,  `Chowla's conjecture',  \emph{Acta Arith.} 
{\bf 107\/}.2  (2003),179--194.



\bibitem{WW} Leonhard Euler, `An essay on continued fractions',
translated by Myra F. Wyman and Botswick F. Wyman, {\it Math. Systems
Theory\/} {\bf 18\/} (1985), 295--328; see also: Christopher Byrnes,
`Editor's introduction', {\it ibid.\/} 293--294.


\bibitem{HP} Franz Halter-Koch and Maximilian Pacher, `The diophantine
equation $x^2-Dy^2=N$ and continued fractions', \emph{JP J. Algebra Number
Theory Appl.} {\bf 3\/}.1 (2003),
85--120.


\bibitem{McL} James Mc~Laughlin,
`Multivariable polynomial solutions to Pell's equation in
real quadratic number fields', \emph{Pacific J. Math.} {\bf 210\/}.2
(2003), 335--349.



\bibitem{111} R. A. Mollin, A. J. van der Poorten, and H. C. Williams, \lq Halfway to a
solution of $X^2-DY^2=-3$,   {\it J. Th\'eorie de Nombres de
Bordeaux\/}, {\bf 6} (1994), 421--459. 



\bibitem{Pa} Roger Patterson,  \emph{Creepers: Real quadratic fields
with large class number}, PhD thesis, Macquarie
University, Sydney, 2004.


\bibitem{171} Roger D. Patterson and Alfred J. van der Poorten, `Jeepers,
Creepers,
\dots', in {\it High Primes and Misdemeanours\/}: lectures in
honour of the 60th birthday of Hugh Cowie Williams, Alf van der Poorten
and Andreas Stein eds.,  Fields Institute Communications {\bf 42\/},
American Mathematical Society, 2004, 305--316. 


\bibitem{Pe} Oskar Perron,  {\it Die
Lehre von den Kettenbr\"uchen\/}, 2nd edition, 1929 (Chelsea
Publishing Company, New York, N Y).



\bibitem{118} Alfred J. van der Poorten, `Explicit quadratic
reciprocity', in {\it Number Theoretic and Algebraic Methods in Computer
Science, Moscow 1993\/},  Alf van der Poorten, Igor Shparlinski and
Horst G. Zimmer eds., World Scientific 1995, 175--180.


\bibitem{163} \bysame, `Periodic continued fractions
and elliptic curves',  in {\it High Primes and Misdemeanours\/}:
lectures in honour of the 60th birthday of Hugh Cowie Williams, Alf van
der Poorten and Andreas Stein eds., Fields Institute Communications {\bf
42\/}, American Mathematical Society, 2004, 353--365; see also
`Elliptic curves and
continued fractions', \url{http://www.arxiv.org/math.NT/0403225}, 11pp.


\bibitem{158}  Alfred J. van der Poorten and Xuan Chuong Tran, 
`Periodic continued fractions in elliptic function fields', in  Claus
Fieker and David R. Kohel eds, {\it Algorithmic Number Theory\/}  (Proc.
Fifth International Symposium, ANTS-V, Sydney, NSW, Australia July
2002), Springer Lecture Notes in Computer Science 2369 (2002), 390--404.


\bibitem{121} A. J. van der Poorten and H. C. Williams, \lq On certain
continued fraction expansions of fixed period length\rq,  {\it Acta Arith.\/}
{\bf 89\/}.1 (1999), 23--35. %(MR2000m:11010).


\bibitem{Schi}{A. Schinzel,  `On some problems of the arithmetical theory
of continued fractions', {\it Acta Arith.\/} {\bf 6\/} (1961), 393--413;
and {\it ibid.\/} {\bf 7\/} (1962), 287--298.}





\end{thebibliography}


\label{page:lastpage}
\end{document} 


math0411005.extracted_bib
\begin{thebibliography}{ABC}

 




\bibitem{Bi1} Andr\'as Bir\'o, `Yokoi's conjecture',  \emph{Acta
Arith.}  {\bf 106\/}.1  (2003), 85--104.

\bibitem{Bi2} \bysame,  `Chowla's conjecture',  \emph{Acta Arith.} 
{\bf 107\/}.2  (2003),179--194.



\bibitem{WW} Leonhard Euler, `An essay on continued fractions',
translated by Myra F. Wyman and Botswick F. Wyman, {\it Math. Systems
Theory\/} {\bf 18\/} (1985), 295--328; see also: Christopher Byrnes,
`Editor's introduction', {\it ibid.\/} 293--294.


\bibitem{HP} Franz Halter-Koch and Maximilian Pacher, `The diophantine
equation $x^2-Dy^2=N$ and continued fractions', \emph{JP J. Algebra Number
Theory Appl.} {\bf 3\/}.1 (2003),
85--120.


\bibitem{McL} James Mc~Laughlin,
`Multivariable polynomial solutions to Pell's equation in
real quadratic number fields', \emph{Pacific J. Math.} {\bf 210\/}.2
(2003), 335--349.



\bibitem{111} R. A. Mollin, A. J. van der Poorten, and H. C. Williams, \lq Halfway to a
solution of $X^2-DY^2=-3$,   {\it J. Th\'eorie de Nombres de
Bordeaux\/}, {\bf 6} (1994), 421--459. 



\bibitem{Pa} Roger Patterson,  \emph{Creepers: Real quadratic fields
with large class number}, PhD thesis, Macquarie
University, Sydney, 2004.


\bibitem{171} Roger D. Patterson and Alfred J. van der Poorten, `Jeepers,
Creepers,
\dots', in {\it High Primes and Misdemeanours\/}: lectures in
honour of the 60th birthday of Hugh Cowie Williams, Alf van der Poorten
and Andreas Stein eds.,  Fields Institute Communications {\bf 42\/},
American Mathematical Society, 2004, 305--316. 


\bibitem{Pe} Oskar Perron,  {\it Die
Lehre von den Kettenbr\"uchen\/}, 2nd edition, 1929 (Chelsea
Publishing Company, New York, N Y).



\bibitem{118} Alfred J. van der Poorten, `Explicit quadratic
reciprocity', in {\it Number Theoretic and Algebraic Methods in Computer
Science, Moscow 1993\/},  Alf van der Poorten, Igor Shparlinski and
Horst G. Zimmer eds., World Scientific 1995, 175--180.


\bibitem{163} \bysame, `Periodic continued fractions
and elliptic curves',  in {\it High Primes and Misdemeanours\/}:
lectures in honour of the 60th birthday of Hugh Cowie Williams, Alf van
der Poorten and Andreas Stein eds., Fields Institute Communications {\bf
42\/}, American Mathematical Society, 2004, 353--365; see also
`Elliptic curves and
continued fractions', \url{http://www.arxiv.org/math.NT/0403225}, 11pp.


\bibitem{158}  Alfred J. van der Poorten and Xuan Chuong Tran, 
`Periodic continued fractions in elliptic function fields', in  Claus
Fieker and David R. Kohel eds, {\it Algorithmic Number Theory\/}  (Proc.
Fifth International Symposium, ANTS-V, Sydney, NSW, Australia July
2002), Springer Lecture Notes in Computer Science 2369 (2002), 390--404.


\bibitem{121} A. J. van der Poorten and H. C. Williams, \lq On certain
continued fraction expansions of fixed period length\rq,  {\it Acta Arith.\/}
{\bf 89\/}.1 (1999), 23--35. %(MR2000m:11010).


\bibitem{Schi}{A. Schinzel,  `On some problems of the arithmetical theory
of continued fractions', {\it Acta Arith.\/} {\bf 6\/} (1961), 393--413;
and {\it ibid.\/} {\bf 7\/} (1962), 287--298.}





\end{thebibliography}