\documentclass[12pt,a4paper]{amsart} \usepackage[T1]{fontenc} \usepackage{lmodern,amssymb,mathtools,microtype} \usepackage[margin=25mm]{geometry} \usepackage{enumitem,needspace,xurl} \usepackage[hidelinks,unicode]{hyperref} \urlstyle{same} \setlist[enumerate]{label=\textup{(\arabic*)},leftmargin=2em,itemsep=2pt,topsep=4pt} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \numberwithin{equation}{section} \newcommand{\R}{\mathbb R} \newcommand{\Z}{\mathbb Z} \newcommand{\Q}{\mathbb Q} \newcommand{\Qp}{\mathbb Q_p} \newcommand{\Zp}{\mathbb Z_p} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\Tr}{Tr} \DeclareMathOperator{\dist}{dist} \newcommand{\doi}[1]{\href{https://doi.org/#1}{\nolinkurl{#1}}} \allowdisplaybreaks[2] \title[Conjectures on $p$-adic continued fractions]{On several conjectures concerning $p$-adic continued fractions} \author{} \thanks{Tomislav Pejkovi\'c proposed the topic and guided the research presented in this paper. Department of Mathematics, Faculty of Science, University of Zagreb, Bijeni\v{c}ka cesta~30, 10000 Zagreb, Croatia (\texttt{pejkovic@math.hr}).} \subjclass[2020]{Primary 11J70, Secondary 11B39, 11J61, 11K50, 11R11} \keywords{$p$-adic continued fractions, quadratic irrationals, periodicity, real convergence, Jacobi--Perron algorithm} \date{} \hypersetup{pdftitle={On several conjectures concerning p-adic continued fractions}, pdfauthor={}, pdfsubject={Number Theory (math.NT)}, pdfkeywords={p-adic continued fractions, quadratic irrationals, periodicity, real convergence, Jacobi--Perron algorithm}} \begin{document} \begin{abstract} Let $p$ be an odd prime and let $h\ge2$ be even. If $(p,h)\ne(3,2)$, infinitely many real and infinitely many imaginary quadratic fields have the form $\mathbb Q(\sqrt D)$, where $D$ is an integer whose $p$-adic square roots have least period $h$ under Browkin's second algorithm. For $(p,h)=(3,2)$, we give two radicands and bound all such radicands in terms of their preperiods. We prove eventual periodicity for quadratic inputs to the fourth algorithm of Wang and Deng at $p=5$ and to Yasutomi's simultaneous algorithm for real quadratic fields at $p=3$. The real approximation error after $n$ digits is $O(n^{-3})$ for Ruban's expansion of a quadratic irrational and for Schneider's expansion of a quadratic $p$-adic unit. For both Browkin algorithms and the alternating algorithm of Murru and Romeo, we determine the real and $p$-adic approximation exponents in terms of the reduced denominator for Haar-almost every input. The real limit is transcendental and has finite irrationality exponent. In each cubic field embedded in $\mathbb Q_p$, a suitable generator gives eventual periodicity for every basis $1,x,y$ in a variant of the algorithm of Saito, Tamura and Yasutomi that computes the translation after inversion and row reduction. Computing the translation from the input gives nonperiodic expansions on a dense set of bases in every degree at least two. For the $p$-adic Jacobi--Perron algorithm we construct pairs of Liouville numbers on a rational line with infinite expansions that are not eventually periodic. We also prove an irreducibility conjecture for a sequence of polynomials arising from a Pell equation. \end{abstract} \maketitle \noindent\textbf{Use of artificial intelligence.} The research was carried out under human direction from the choice of topic and research questions to the selection of results for the paper. OpenAI's ChatGPT 6 and Anthropic's Claude Opus 5.5 assisted in developing arguments, checking examples and drafting the manuscript. OpenAI's ChatGPT 6.2 Astra developed further constructions and proofs, checked the computations and references, and revised the manuscript. Anthropic's Claude subsequently reviewed the full manuscript and suggested improvements to the proofs and exposition. The human review did not include an independent check of every proof. \section{Introduction} Several continued fraction algorithms expand quadratic irrationals in $\mathbb Q_p$. The choice of partial quotients affects periodicity and the behavior of the rational convergents in $\mathbb R$. Romeo surveys these algorithms and their history~\cite{RomeoSurvey}. Section~\ref{sec:bii} concerns Browkin's second algorithm. Murru, Romeo and Santilli~\cite[Conjecture~20]{MRS} ask whether, for every odd prime $p$ and every positive even integer $h$, infinitely many nonsquare integers have a square root with least period $h$. Theorems~\ref{thm:periods} and~\ref{thm:signed-fields} give infinitely many distinct real quadratic fields and infinitely many distinct imaginary quadratic fields for every pair except $(3,2)$. Browkin~\cite[Lemma~2]{Br2} had constructed examples of period two for $p\ge5$. The period-four construction of Murru, Romeo and Santilli~\cite[Theorem~18 and Corollary~19]{MRS} works for $p\ge5$. At $p=3$ the odd-step correction changes their word. Proposition~\ref{prop:h4} gives a family valid at every odd prime. Our construction adapts the palindromes of Capuano, Murru and Terracini~\cite{CMT} to Browkin's correction at the odd steps. At $p=3$ the square roots of $171$ and $13851$ have period two, with least preperiods $10$ and $40$. A bound for the radicand in terms of the preperiod restricts any further examples. Infinitude in this case remains open. Section~\ref{sec:periodicity} treats periodicity for quadratic inputs. Wang and Deng use the half-trace of each complete quotient to choose its partial quotient. Yasutomi uses a chosen real embedding in his simultaneous algorithm. For the fourth algorithm of Wang and Deng the complete quotients of every quadratic irrational are eventually periodic at $p=5$. We determine the sharp eventual bound on their denominators and give sufficient conditions for periodicity of the fifth algorithm. For Yasutomi's simultaneous algorithm we prove periodicity at $p=3$ and show that the real convergents tend to the image of the input under the chosen embedding. For each $p\ge5$, inputs of period two in every admissible real quadratic field can converge to the other real conjugate. For Yasutomi's separate algorithm with a choice of sign we describe periodic orbits and the accuracy of their convergents. Capuano, Veneziano and Zannier~\cite[Proposition~4.5]{CVZ} proved real convergence for every quadratic Ruban expansion. In Section~\ref{sec:ruban} we bound the error after $n$ digits by $O(n^{-3})$. Corollary~\ref{cor:schneider-cubic} gives the same bound for Schneider's expansions of quadratic $p$-adic units, improving the exponent in \cite[Theorem~2.3]{PejSchReal}. Section~\ref{sec:romeo-det} treats Browkin's two algorithms and the alternating algorithm of Murru and Romeo~\cite{MR24}. For these algorithms, convergence to a real conjugate at a rate faster than every inverse power, even along a subsequence, forces eventual periodicity. Romeo asks whether convergence to a real conjugate alone forces eventual periodicity~\cite[Conjectures~2 and~17]{RomeoReal}. Section~\ref{sec:romeo-metric} treats the same three algorithms with respect to additive Haar measure on $\mathbb Q_p$. For almost every input the real limit is transcendental with finite irrationality exponent. Theorem~\ref{thm:romeo-haar} gives the exponential rate of convergence, and Corollary~\ref{cor:ordinary-denominator-rates} gives the real and $p$-adic exponents in terms of the reduced denominator. In dimension two, Section~\ref{sec:sty-cubic} studies a version of the algorithm of Saito, Tamura and Yasutomi in which the rational constants are reduced after inversion and row reduction. We prove periodicity for all cubic bases in the stated domain. For the translation evaluated on the input in formula~(4) of the arXiv version of \cite{STY}, Corollary~\ref{cor:sty-dense-higher} gives, in every degree at least two, a dense set of bases whose expansions are not eventually periodic. The same bases reach the fixed power basis in one step when the constants are reduced after inversion. Section~\ref{sec:jp} constructs pairs of Liouville numbers on a rational line with infinite, nonperiodic $p$-adic Jacobi--Perron expansions, answering a question of Murru and Terracini~\cite[Conjecture~1]{MT20}. In Section~\ref{sec:poly}, Theorem~\ref{thm:irreducible} proves an irreducibility conjecture of Capuano, Mula, Terracini and Veneziano~\cite[Conjecture~4.29]{CMTV}. We also relate their prime-value conjecture to two classical sequences and bound the common divisors of terms at a fixed distance. \section{Preliminaries}\label{sec:prelim} Unless otherwise stated, $p$ is an odd prime. We write $v_p$ for the valuation normalized by $v_p(p)=1$, put $v_p(0)=+\infty$, and write $|x|_p=p^{-v_p(x)}$. An absolute value without a subscript is the usual real or complex absolute value, and $x'$ denotes the other conjugate of a quadratic irrational $x$. The sign of a nonzero rational number refers to its real sign. The prime-to-$p$ part of $\pm p^k m\in\Z[1/p]\setminus\{0\}$, where $m>0$ and $p\nmid m$, is $m$. Put $\Sigma_p=\{-(p-1)/2,\ldots,(p-1)/2\}$. Browkin's balanced truncations~\cite{Br1,Br2} are the unique representatives satisfying \begin{align} &s(x)\in\Z[1/p]\cap(-p/2,p/2), &&x-s(x)\in p\Zp,\label{eq:s}\\ &t(x)\in\Z[1/p]\cap(-1/2,1/2), &&x-t(x)\in\Zp.\label{eq:t} \end{align} For a $p$-adic unit, $s(x)$ is the nonzero element of $\Sigma_p$ congruent to $x$ modulo $p$. In the one-dimensional algorithms with partial numerators equal to one, the complete quotients $\alpha_n$ and partial quotients $a_n$ satisfy \begin{equation}\label{eq:step} \alpha_{n+1}=\frac1{\alpha_n-a_n}. \end{equation} We write $[a_0;a_1,a_2,\ldots]$ for the expansion and use an overline for a repeated word. Period length always means minimal eventual period. The minimal preperiod is the least index at which a periodic tail begins. For a parity-dependent algorithm, complete quotients are compared only at indices of the same parity. Put $M(a)=\left(\begin{smallmatrix}a&1\\1&0\end{smallmatrix}\right)$. Matrices act by M\"obius transformations, so \[ [a_0;a_1,\ldots,a_m,z]=M(a_0)\cdots M(a_m)\cdot z. \] Finite words are interpreted projectively by these products. We use continuants $K()=1$, $K(a_1)=a_1$ and \[ K(a_1,\ldots,a_m)=a_mK(a_1,\ldots,a_{m-1})+K(a_1,\ldots,a_{m-2}). \] For $m\ge2$ these continuants give \[ M(a_1)\cdots M(a_m)= \begin{pmatrix} K(a_1,\ldots,a_m)&K(a_1,\ldots,a_{m-1})\\ K(a_2,\ldots,a_m)&K(a_2,\ldots,a_{m-1}) \end{pmatrix}. \] The determinant is $(-1)^m$, and reversing a word leaves its continuant unchanged. \section{Prescribed period lengths for Browkin's second algorithm}\label{sec:bii} Murru, Romeo and Santilli asked whether every even period occurs for infinitely many square roots of integers under Browkin's second algorithm \cite[Conjecture~20]{MRS}. We adapt the palindromic construction of Capuano, Murru and Terracini for Browkin's first algorithm \cite[Theorem~5.6]{CMT} to the alternating truncations and the sign correction in Browkin~II. \begin{theorem}\label{thm:periods} Let $p$ be an odd prime and let $h\ge2$ be even. There is a nonsquare integer $D$ such that a square root of $D$ in $\Qp$ has a Browkin~II expansion of minimal period $h$. If $(p,h)\ne(3,2)$, there are infinitely many such integers $D$. \end{theorem} \subsection{Admissible expansions} Browkin's second algorithm \cite{Br2,MRS} starts at $\alpha_0=\alpha$ and uses \eqref{eq:step} with \begin{equation}\label{eq:bii} a_n=\begin{cases} s(\alpha_n),&n\text{ even},\\ t(\alpha_n),&n\text{ odd and }|\alpha_n-t(\alpha_n)|_p=1,\\ t(\alpha_n)-\sgn t(\alpha_n),&n\text{ odd and }|\alpha_n-t(\alpha_n)|_p<1. \end{cases} \end{equation} For $n\ge1$, odd complete quotients have norm greater than $1$ and even complete quotients have norm $1$. Indeed, an even remainder belongs to $p\Zp$, while the correction at an odd step makes the remainder a unit. Thus even partial quotients from index $2$ on are nonzero elements of $\Sigma_p$, and odd partial quotients are nonintegral. Every eventual period is consequently even. Negating the input negates all partial quotients, so the period length of a square root does not depend on its sign. \begin{definition} A finite or infinite sequence $(b_n)$ with consecutive indices is \emph{admissible} if $b_n\in\Sigma_p\setminus\{0\}$ for even $n$, and $b_n\in\Z[1/p]$ with $|b_n|_p>1$ for odd $n$, subject to the following condition. An odd entry is either \emph{uncorrected}, with $|b_n|<1/2$, or \emph{corrected}, with $1/2<|b_n|<1$. In the latter case its next entry, when present, must be $-\sgn b_n$. \end{definition} \Needspace{6\baselineskip} \begin{lemma}\label{lem:real} Let $(b_n)_{n_0\le n\le N}$ be admissible. \begin{enumerate} \item If $N<\infty$, let $Z\in\Qp$ satisfy $|Z|_p=1$ when $N+1$ is even and $|Z|_p>1$ when $N+1$ is odd. If $b_N$ is corrected, assume also $Z\equiv-\sgn b_N\pmod p$. Then $[b_{n_0};\ldots,b_N,Z]$ is defined and the algorithm, started at index $n_0$, produces the displayed partial quotients and the complete quotient $Z$. \item If $N=\infty$, the continued fraction converges in $\Qp$ and is the expansion of its limit under the algorithm started at index $n_0$. \end{enumerate} In both cases the complete quotients satisfy $|\xi_n|_p=1$ and $\xi_n\equiv b_n\pmod p$ at even indices, and $|\xi_n|_p=|b_n|_p$ at odd indices. \end{lemma} \begin{proof} For a finite word, backwards evaluation by $\xi_n=b_n+1/\xi_{n+1}$ gives the stated norms and congruences, so no complete quotient vanishes. At even indices these identify $s(\xi_n)=b_n$. At an uncorrected odd entry, $t(\xi_n)=b_n$ and $\xi_n-b_n=1/\xi_{n+1}$ is a unit. At a corrected entry put $\tau=b_n-\sgn b_n$. Then $|\tau|<1/2$, $\sgn\tau=-\sgn b_n$ and \[ \xi_n-\tau=\sgn b_n+1/\xi_{n+1}\in p\Zp, \] because $\xi_{n+1}\equiv-\sgn b_n\pmod p$. Thus $t(\xi_n)=\tau$ and its correction is $b_n$. For a tail beginning at index $i$, its continuant denominators satisfy $|B_j|_p=\prod_{n=i+1}^j|b_n|_p$ for $j\ge i$, with $B_i=1$. Indeed, $B_{i+1}=b_{i+1}$, and $|b_jb_{j-1}|_p>1$ gives $|b_jB_{j-1}|_p>|B_{j-2}|_p$ in each subsequent recurrence. Hence $|B_j|_p\to\infty$. The determinant identity gives convergence of this tail, as in \cite[Lemma~1]{Br2}. Apply the finite case to truncations ending at an even index, taking the final even digit as the terminal complete quotient $Z$. Their complete quotients have the stated norms and congruences, which pass to the limits since the corresponding spheres and residue classes are closed. The limits are nonzero, and the preceding verification of the algorithm applies to each tail. \end{proof} We shall repeatedly use the following observation. If a periodic word contains an entry whose $p$-adic norm is strictly greater than that of every other entry, its length is the minimal period. Indeed, a shorter minimal period would divide the displayed length and repeat that entry within the word. \subsection{A palindromic construction} \begin{lemma}\label{lem:pal} Let $c_0,\ldots,c_j,\mu\in\Q$, put $\Gamma=M(c_0)\cdots M(c_j)=(g_{ik})$ and $\delta=\det\Gamma=(-1)^{j+1}$, and define \[ \Phi(\mu)=\frac{g_{11}(g_{11}\mu+2g_{12})}{g_{21}(g_{21}\mu+2g_{22})} \] when the denominator is nonzero. If $\Phi(\mu)$ is defined and $\xi\ne0$ satisfies \begin{equation}\label{eq:pal} \xi=[c_0;c_1,\ldots,c_j,\mu,c_j,\ldots,c_1,\xi+c_0], \end{equation} then $\xi^2=\Phi(\mu)$. If $g_{11}g_{21}\ne0$, put $A=g_{11}/g_{21}$ and $B=g_{21}/g_{11}$. Then \begin{align} \Phi(\mu)&=A^2-\frac{2\delta A}{g_{21}(g_{21}\mu+2g_{22})},\label{eq:mob-E}\\ \frac1{\Phi(\mu)}&=B^2+\frac{2\delta B}{g_{11}(g_{11}\mu+2g_{12})},\label{eq:mob-O} \end{align} wherever the expressions are defined. \end{lemma} \begin{proof} The matrices $M(a)$ are symmetric and the translation $z\mapsto z+c_0$ is $M(c_0)M(0)$. Hence the right side of \eqref{eq:pal} is $S\cdot(1/\xi)$, where \[ S=\Gamma M(\mu)\Gamma^T= \begin{pmatrix}s_1&s_2\\s_2&s_3\end{pmatrix},\qquad s_1=g_{11}(g_{11}\mu+2g_{12}),\quad s_3=g_{21}(g_{21}\mu+2g_{22}). \] Thus $\xi=(s_1+s_2\xi)/(s_2+s_3\xi)$ implies $s_3\xi^2=s_1$. The other two identities follow from $g_{11}g_{22}-g_{12}g_{21}=\delta$. \end{proof} We use two settings for the prefix $(c_0,\ldots,c_j)$, with every odd-position entry uncorrected. \begin{enumerate}[label=\textup{(\Alph*)}] \item[(E)] The integer $j\ge0$ is even and the prefix is admissible from index $0$. Put \[ A=\frac{g_{11}}{g_{21}},\qquad \mu_\infty=-\frac{2g_{22}}{g_{21}}. \] Here $A$ is a $p$-adic unit congruent to $c_0$ modulo $p$. For $j\ge2$ we have $\mu_\infty=-2/[c_j;c_{j-1},\ldots,c_1]$, and for $j=0$ we have $\mu_\infty=0$. \item[(O)] The integer $j\ge1$ is odd and the prefix is admissible from index $1$, so $c_i$ stands at position $i+1$. Assume $|c_0|<1/4$ and put \[ B=\frac{g_{21}}{g_{11}},\qquad \mu_\infty=-\frac{2g_{12}}{g_{11}}=-\frac2{[c_j;c_{j-1},\ldots,c_0]}. \] Here $B\in p\Zp\setminus\{0\}$, since $[c_0;\ldots,c_j]$ has norm $|c_0|_p>1$. \end{enumerate} These valuation statements follow by backwards evaluation. In particular, $g_{11}g_{21}\ne0$ in both settings. The middle entry $\mu$ stands at an odd position in either case. \Needspace{8\baselineskip} \begin{proposition}\label{prop:palindrome-closure} Let $\mu$ be uncorrected. \begin{enumerate} \item In setting (E), assume $2c_0\in\Sigma_p$ and $D=\Phi(\mu)\in\Z$. Then the square root $\xi\equiv c_0\pmod p$ of $D$ has the expansion \[ \xi=[c_0;\overline{c_1,\ldots,c_j,\mu,c_j,\ldots,c_1,2c_0}\,]. \] \item In setting (O), assume $D=1/\Phi(\mu)\in\Z$, with $\Phi(\mu)$ defined and nonzero. Then a square root $\eta\in p\Zp$ of $D$ has the expansion \[ \eta=[0;c_0,\overline{c_1,\ldots,c_j,\mu,c_j,\ldots,c_1,2c_0}\,]. \] \end{enumerate} In either case, if $|\mu|_p>|c_i|_p$ for all $0\le i\le j$, the minimal period is $2j+2$. \end{proposition} \begin{proof} The word starting at $c_0$ is admissible at the prescribed starting index. Reversal preserves the parity of the entries, and the closing entry $2c_0$ is allowed by $2c_0\in\Sigma_p$ in (E) and $|2c_0|<1/2$ in (O). By Lemma~\ref{lem:real}, this word is the expansion of its limit $\gamma$. Let $\gamma_1$ be the complete quotient immediately following $c_0$. The complete quotient at the closing entry is $2c_0+1/\gamma_1=\gamma+c_0$. Thus \eqref{eq:pal} holds and $\gamma^2=\Phi(\mu)$. In (E) we take $\xi=\gamma$. In (O), $|\gamma|_p=|c_0|_p>1$, so $\eta=1/\gamma\in p\Zp$ has initial partial quotient $0$ and the asserted expansion. The unique entry of largest $p$-adic norm proves minimality. \end{proof} For $p=3$, the closing entry $2c_0$ in setting (E) is not a digit. We replace it using the identity \begin{equation}\label{eq:block} M(0)\begin{pmatrix}1&2\\0&1\end{pmatrix}M(1)M(\tfrac13)M(-1)M(-\tfrac13) =M(-\tfrac13)M(1)M(\tfrac23). \end{equation} \begin{proposition}\label{prop:close3} Let $p=3$ and assume setting (E), with $c_0=1$, $j\ge4$ and $(c_1,c_2,c_3,c_4)=(1/3,-1,-1/3,-1)$. Let $\mu$ be uncorrected and $D=\Phi(\mu)\in\Z$. Then the square root $\xi\equiv1\pmod3$ of $D$ has the expansion \[ \xi=\Bigl[1;\frac13,-1,-\frac13, \overline{-1,c_5,\ldots,c_j,\mu,c_j,\ldots,c_1,-1,-\frac13,1,\frac23}\,\Bigr]. \] If $|\mu|_3>|c_i|_3$ for all $0\le i\le j$, its minimal period is $2j+2$. \end{proposition} \begin{proof} The displayed word is admissible. In particular, the corrected entry $2/3$ is followed by $-1$. Let its limit be $\xi$, with complete quotients $\xi_n$. The periodic tail begins at index $4$, so $\xi_{2j+6}=\xi_4$. Since $\xi=[1;1/3,-1,-1/3,\xi_4]$, identity \eqref{eq:block} gives \[ \xi_{2j+3}=[-1/3;1,2/3,\xi_4]=\frac1{\xi+2}. \] Consequently $\xi_{2j+2}=-1+1/\xi_{2j+3}=\xi+1$, which proves \eqref{eq:pal}. Lemma~\ref{lem:pal} yields $\xi^2=D$. The periodic word has length $2j+2$ and contains $\mu$ once, proving minimality under the stated norm condition. \end{proof} The value $\mu_\infty$ is the pole of $\Phi$ in (E) and of $1/\Phi$ in (O). The following deformation preserves integrality while making the middle entry small in the real absolute value and large in the $p$-adic one. \Needspace{5\baselineskip} \begin{proposition}\label{prop:family} Assume setting (E) or (O), with $|\mu_\infty|<1/2$. Suppose that $\mu_0\in\Z[1/p]$ gives an integer $D_0=\Phi(\mu_0)$ in (E), or $D_0=1/\Phi(\mu_0)$ in (O), with $\Phi(\mu_0)$ defined and nonzero in the latter case. Write $n/d=A$ in (E) and $n/d=B$ in (O), in lowest terms with $d>0$. Let $o$ be the order of $p$ modulo $d^2$, with $o=1$ if $d=1$, and put \begin{equation}\label{eq:family} D_t=\frac{n^2+p^{to}(d^2D_0-n^2)}{d^2},\qquad \mu_t=\mu_\infty+p^{-to}(\mu_0-\mu_\infty),\qquad t\ge1. \end{equation} For all sufficiently large $t$, the $D_t$ are distinct nonsquare integers, $\mu_t$ is uncorrected, and $|\mu_t|_p\to\infty$. Moreover, $\Phi(\mu_t)=D_t$ in (E) and $\Phi(\mu_t)=1/D_t$ in (O). \end{proposition} \begin{proof} In (E), write $g_{21}=dw$ and $g_{11}=nw$, with $w\in\Z[1/p]$. Since \[ \delta=w(ng_{22}-dg_{12}), \] $w$ is a unit of $\Z[1/p]$, and $d\mu_\infty=-2g_{22}/w\in\Z[1/p]$. The same argument in (O), after exchanging the rows of $\Gamma$, gives $g_{11}=dw$ and $d\mu_\infty\in\Z[1/p]$. Also $p\nmid d$, because $A\in\Zp^\times$ and $B\in p\Zp$. The congruence $p^{to}\equiv1\pmod{d^2}$ makes $D_t$ integral and gives \[ p^{to}\mu_t=\mu_0+(p^{to}-1)\mu_\infty\in\Z[1/p]. \] Identities \eqref{eq:mob-E}--\eqref{eq:mob-O} prove the claimed relations between $D_t$ and $\mu_t$. They also show that $C=d^2D_0-n^2\ne0$ and $\mu_0\ne\mu_\infty$. Thus the $D_t$ are distinct, $\mu_t\to\mu_\infty$ in $\mathbb R$, and $|\mu_t|_p\to\infty$. A possible value $D_t=0$ in (O) is discarded. If $D_t=y^2$ for an integer $y$, then $(dy-n)(dy+n)=Cp^{to}$. The two factors differ by $2n\ne0$. Put $r=v_p(2n)$. Once $v_p(C)+to>2r$, their valuations differ and the smaller one is $r$. The corresponding factor is therefore $\pm p^r$ times a divisor of the fixed prime-to-$p$ part of $C$. There are only finitely many possibilities for that factor and hence for the other one. Since $|Cp^{to}|\to\infty$, only finitely many $D_t$ are squares. \end{proof} \subsection{Infinite families with prescribed period length} \subsubsection{The case \texorpdfstring{$p\ge5$ and $h\equiv2\pmod4$}{p>=5 and h=2 mod 4}} Fix $\varepsilon\in\{-1,1\}$ and choose $r\ge1$ with $p^r>8$. When $j=0$ and $c_0=1$, we have $\Phi(\mu)=1+2/\mu$. With $\lambda=2\varepsilon p^{-r}$, Proposition~\ref{prop:palindrome-closure}(1) gives \[ \sqrt{1+\varepsilon p^r}=[1;\overline{\lambda,2}\,] \] for the root congruent to $1$ modulo $p$. The period is two. For $\varepsilon=1$, an integral square root $z>0$ would be even, and the coprime positive odd factors $z-1,z+1$ of $p^r$ would force $z=2$ and $p^r=3$. For $\varepsilon=-1$ the radicand is negative. The positive family is a special case of \cite[Lemma~2]{Br2}, where Browkin attributes the sufficiency of the conditions to de Weger. The corresponding family of convergent periodic words also appears in \cite[Example~4.16(a)]{CMTV}. For fixed $k\ge1$, take the prefix $c_0=1$, $c_{2i-1}=\lambda$, $c_{2i}=2$ for $1\le i\le k$. The displayed expansion satisfies \eqref{eq:pal} for this prefix with $\mu_0=\lambda$. Its entries from positions $1$ to $4k+1$ form the required palindrome, and its complete quotient at position $4k+2$ is $\sqrt{1+\varepsilon p^r}+1$. Thus $D_0=1+\varepsilon p^r$ is an initial integer for Proposition~\ref{prop:family}. As $r\to\infty$, \[ \Gamma=M(1)\bigl(M(\lambda)M(2)\bigr)^k \longrightarrow\begin{pmatrix}2k+1&1\\1&0\end{pmatrix}. \] Hence $A\to2k+1$ and $\mu_\infty\to0$. Choose $r$ large enough that $|\mu_\infty|<1/2$ and $D_0-A^2$ has sign $\varepsilon$. Then $D_t=A^2+p^{to}(D_0-A^2)$ has the same sign for all large $t$. Propositions~\ref{prop:family} and~\ref{prop:palindrome-closure}(1) give infinitely many nonsquare integers of each sign with minimal period $4k+2$. \subsubsection{The case \texorpdfstring{$h\equiv0\pmod4$}{h=0 mod 4}} Let $p$ be any odd prime. Fix $e\ge1$ with $p^e>4$, put $x=p^{-e}$ and $d=p^e+1$, and let $o$ be the order of $p$ modulo $d^2$. \begin{proposition}\label{prop:h4} For all sufficiently large integers $u$, put \[ D_u=\frac{p^{2e}(1-p^{uo})}{(p^e+1)^2},\qquad \mu_u=-\frac{2(p^{uo}+p^e)}{(p^e+1)p^{uo}}. \] Then $D_u$ is a negative integer, $\mu_u$ is uncorrected, and a square root of $D_u$ has the expansion \[ [0;x,\overline{1,\mu_u,1,2x}\,] \] with minimal period four. \end{proposition} \begin{proof} The congruence $p^{uo}\equiv1\pmod{d^2}$ makes $D_u$ integral. Since $p^{uo}+p^e\equiv0\pmod d$, we also have $\mu_u\in\Z[1/p]$. As $u\to\infty$, \[ \mu_u\longrightarrow-\frac2{p^e+1},\qquad |\mu_u|_p=p^{uo-e}\longrightarrow\infty, \] so $\mu_u$ is uncorrected for large $u$. In setting (O), take $j=1$ and $(c_0,c_1)=(x,1)$. Then $\Gamma=\left(\begin{smallmatrix}1+x&x\\1&1\end{smallmatrix}\right)$, and direct substitution gives $1/\Phi(\mu_u)=D_u$. Proposition~\ref{prop:palindrome-closure}(2) gives the expansion and its minimal period. \end{proof} Murru, Romeo and Santilli gave a family of period four in \cite[Theorem~18 and Corollary~19]{MRS}. Their displayed word is admissible for $p\ge5$. At $p=3$ its odd entry $-1+3^{1-t}$, $t\ge2$, is corrected and must be followed by $1$. The next entry in their word is $-1$. Taking $p^e>4$ in Proposition~\ref{prop:h4} gives a family at this prime as well. \begin{proposition}\label{prop:period-four-multiples} For every $m,e\ge1$ with $p^e>4$, infinitely many negative integers $D$ with $v_p(D)=2e$ have a square root whose Browkin~II expansion has least preperiod two and least period $4m$. \end{proposition} \begin{proof} The case $m=1$ is Proposition~\ref{prop:h4}. Let $m\ge2$ and let $\gamma_u=1/\sqrt{D_u}$, with the root chosen there. Its expansion from index $1$ has entries $a_1=x$, $a_n=1$ for even $n$, $a_n=\mu_u$ for $n\equiv3\pmod4$, and $a_n=2x$ for $n\equiv1\pmod4$, $n\ge5$. Use $(a_1,\ldots,a_{2m})$ as the prefix in setting (O), so $j=2m-1$. For $1\le i\le2m-1$, the entries $a_{2m+1+i}$ and $a_{2m+1-i}$ coincide. If $i$ is odd both positions are even, and if $i$ is even they are congruent modulo four and exceed one. The complete quotient at position $4m+1$ equals $\gamma_u+x$. Thus \eqref{eq:pal} holds with middle entry $a_{2m+1}\in\{\mu_u,2x\}$, and $D_0=D_u$ is an initial integer for Proposition~\ref{prop:family}. Put $r_i=[a_i;a_{i-1},\ldots,a_1]$, so $\mu_\infty=-2/r_{2m}$. Replacing $\mu_u$ by its real limit $-2x/(1+x)$ gives a sequence of period four, \[ r_1^{\infty}=x,\quad r_2^{\infty}=\frac{1+x}{x},\quad r_3^{\infty}=-\frac{x}{1+x},\quad r_4^{\infty}=-\frac1x. \] None of these values is zero, and $|2/r_{2m}^{\infty}|\le2x<1/2$. Each $r_i$ depends continuously on $\mu_u$ near its limit, so $|\mu_\infty|<1/2$ for sufficiently large $u$. Fix such a $u$. Propositions~\ref{prop:family} and~\ref{prop:palindrome-closure}(2) give infinitely many expansions of minimal period $2j+2=4m$. In \eqref{eq:family} we have $D_t=B^2+p^{to}(D_u-B^2)<0$, since $D_u<0$. The first two digits $0,x$ give the root valuation $e$, and $x\ne2x$ gives least preperiod two. The same valuation and preperiod follow from the displayed expansion in Proposition~\ref{prop:h4} when $m=1$. \end{proof} \subsubsection{The case \texorpdfstring{$p=3$ and $h=6$}{p=3 and h=6}} \begin{proposition} Let $p=3$, $k\ge1$, $q=(-3)^k$ and $D_k=(1-9q)/4$. Then $D_k$ is a nonsquare integer, and its square root $\xi\equiv1\pmod3$ has the expansion \[ \xi=[1;\overline{1/3,-1,1/q,1,-1/3,-1}\,] \] with minimal period six. \end{proposition} \begin{proof} Since $q\equiv1\pmod4$, $D_k\in\Z$. It is negative for even $k$. For odd $k$, the equation $D_k=y^2$ would give $(2y-1)(2y+1)=3^{k+2}$ with coprime positive factors, which is impossible. The displayed word is admissible, so it is the expansion of its limit $\xi\equiv1\pmod3$. Its complete quotient at position $6$ is $\xi-2$, and direct substitution in \[ \xi=[1;1/3,-1,1/q,1,-1/3,\xi-2] \] gives $4\xi^2=1-9q$. For $k\ge2$, the entry $1/q$ has uniquely largest $3$-adic norm. For $k=1$, the minimal period is even, divides six, and is not two because $a_1=1/3\ne-1/3=a_3$. \end{proof} \subsubsection{The case \texorpdfstring{$p=3$, $h\equiv2\pmod4$ and $h\ge10$}{p=3, h=2 mod 4 and h>=10}} For a prefix $(1;c_1,\ldots,c_j)$ in setting (E), put $K_i=K(c_1,\ldots,c_i)$ and $R_i=K_i/K_{i-1}=[c_i;c_{i-1},\ldots,c_1]$. Thus $g_{21}=K_j$, $g_{22}=K_{j-1}$ and $\mu_\infty=-2/R_j$. By the determinant argument in Proposition~\ref{prop:family}, the denominator of $A$ in lowest terms is the prime-to-$3$ part of $K_j$. \begin{lemma}\label{lem:prefix3} For every even $j\ge4$, the prefix \[ (1;1/3,-1,-1/3,-1,c_5,\ldots,c_j) \] can be chosen in setting \textup{(E)} with all odd entries uncorrected, $K_j>0$, $R_j\ge5$, and the prime-to-$3$ part $d_j$ of $K_j$ a positive power of $5$ or $7$. \end{lemma} \begin{proof} For $j=4$ the continuants are $1/3,2/3,1/9,5/9$, so $d_4=R_4=5$. Suppose the prefix has been chosen through $j$. Let $q$ be the prime in $\{5,7\}$ that does not divide $d_j$. We seek positive integers $a,\sigma$ for which $H=q^a/3^\sigma$ satisfies \[ H\equiv K_{j-1}\pmod{d_j\Z[1/3]},\qquad K_j5$. Thus $d_{j+2}=q^a$, which completes the induction. \end{proof} Fix $\varepsilon\in\{-1,1\}$ and take a prefix from Lemma~\ref{lem:prefix3}, with $A=n/d$ in lowest terms. As $3$ generates the units modulo $d^2$, there are arbitrarily large $r$ with $3^r\equiv-\varepsilon n^2\pmod{d^2}$. Put \[ D_0=\frac{n^2+\varepsilon3^r}{d^2}. \] Write $g_{11}=nw$, $g_{21}=dw$, where $w$ is a unit of $\Z[1/3]$, as in Proposition~\ref{prop:family}. Solving $\Phi(\mu_0)=D_0$ gives \[ \mu_0=\frac{2(D_0 g_{21}g_{22}-g_{11}g_{12})} {g_{11}^2-D_0 g_{21}^2} =\frac{2(D_0d g_{22}-n g_{12})}{-\varepsilon w3^r} \in\Z[1/3]. \] Indeed $g_{21}\mu_0+2g_{22} =2\delta g_{11}/(g_{11}^2-D_0g_{21}^2)\ne0$. Now $|\mu_\infty|=2/R_j\le2/5$. By Propositions~\ref{prop:family} and~\ref{prop:close3}, the integers $D_t=(n^2+\varepsilon3^{r+to})/d^2$ are nonsquares of sign $\varepsilon$ and give minimal period $2j+2$ for all sufficiently large $t$, where $o$ is the order of $3$ modulo $d^2$. The displayed preperiods are minimal. In settings (E) and (O), extension one place to the left would identify $c_0$ with $2c_0$. In Proposition~\ref{prop:close3}, the entries at positions $3$ and $h+3$ are $-1/3$ and $2/3$, so the minimal preperiod is four. For period six, the initial entry $1$ differs from the last entry $-1$ of the period. \subsection{Period two at \texorpdfstring{$p=3$}{p=3}}\label{subsec:three-two} \begin{proposition}\label{prop:171} Let $\rho\in\mathbb Q_3$ satisfy $\rho^2=19$ and $\rho\equiv1\pmod3$. The Browkin~II expansion of $3\rho$ is \[ 3\rho=\left[0;-\frac23,1,\frac13,-1,\frac49,1, \frac23,-1,-\frac79,\overline{1,\frac29}\right] \] with minimal preperiod ten and minimal period two. \end{proposition} \begin{proof} The admissible periodic tail $z=[\overline{1,2/9}]$, started at an even index, satisfies \[ z=1+\frac1{2/9+1/z},\qquad 2z^2-2z-9=0,\qquad z\equiv1\pmod3. \] Thus $z=(1+\rho)/2$. The finite word at indices $1,\ldots,9$ in the displayed expansion is admissible. Its corrected entries $-2/3$, $2/3$ and $-7/9$ are followed respectively by $1$, $-1$ and $z\equiv1\pmod3$. Lemma~\ref{lem:real}(1) therefore realizes this prefix followed by $z$. Its value has norm greater than one, so taking its reciprocal supplies the initial partial quotient zero. Multiplication of the ten prefix matrices gives \[ [0;-2/3,1,1/3,-1,4/9,1,2/3,-1,-7/9,z] =\frac{3(1789z-657)}{25z+882}=6z-3=3\rho, \] where the second equality uses $2z^2-2z-9=0$. The period has length two, and $a_9=-7/9\ne2/9=a_{11}$ proves minimality of the preperiod. \end{proof} This completes the proof of Theorem~\ref{thm:periods}. The following results give restrictions for $(p,h)=(3,2)$ and distinguish the fields in the other cases. \subsubsection{Restrictions on the exceptional period} Let $L$ denote the minimal preperiod and let $F_0=0$, $F_1=1$, $F_{i+2}=F_{i+1}+F_i$. \begin{proposition}\label{prop:period-two-height} Suppose that a square root of a nonsquare integer $D$ has period two for Browkin~II at $p=3$. Then $D>0$, $L$ is even, and, after changing the sign of the root if necessary, its period is $(1,x)$, where \[ x=\frac{2u}{3^k},\qquad D=3^{2e}D_\ast,\qquad D_\ast=u(u+2\cdot3^k),\qquad e\ge0,\quad 3\nmid u,\quad 00$, then $a_0=0$ and $z_1'=-z_1$, so $v_3(z_1'-a_1)=v_3(-2a_1-(z_1-a_1))=v_3(a_1)<0$. Thus the first regular state occurs at index $1$ for a unit square root and at index $2$ otherwise. Every later state is regular, including both states on the cycle. Negate the input if required to make the even periodic digit $1$. Write $\alpha=1+1/\beta$ and $\beta=x+1/\alpha$ for the even and odd cycle states. The only regular predecessor of $\beta$ is $\alpha$, because its even digit $b=\pm1$ must satisfy $b\equiv-1/\beta'\equiv1\pmod3$. A regular odd predecessor of $\alpha$ has the form $y=a+1/\alpha$. Then $a-x=y'-\beta'\in\mathbb Z[1/3]\cap\mathbb Z_3=\mathbb Z$, and $|a|,|x|<1$. Since $\beta'\equiv-1\pmod3$, regularity excludes $a-x=1$. The only possible external digit is therefore $a=x-1$, which requires $x>0$. As a corrected positive digit must be followed by $-1$, this $x$ is uncorrected and $03T>4$. This argument applies to both signs of $x$. Thus first entry is at the even state $\alpha$ from the external regular predecessor, so $L$ is even and $x>0$. The even cycle state satisfies $\alpha^2-\alpha-1/x=0$. Its discriminant $1+4/x$ is positive. As the prefix matrix is invertible over $\Q$, we have $\Q(\sqrt D)=\Q(\alpha)$ and hence $D>0$. Put $R=\mathbb Z[1/3]$. The form $Q(X,Y)=mX^2-mXY-TY^2$ is primitive over $R$. For $\Gamma=M(a_0)\cdots M(a_{L-1})$, the form $Q\circ\Gamma^{-1}$ vanishes at $(\sqrt D,1)$ and is therefore $c(X^2-DY^2)$. Unimodularity over $R$ preserves the ideal generated by the coefficients, giving $c\in R^\times$. The discriminants give $4c^2D=m(m+4T)$, a $3$-adic unit, whence $c=\pm3^{-e}$ and $e=v_3(D)/2\ge0$. Thus $4D=3^{2e}m(m+4T)$, which gives $m\equiv0\pmod2$. Writing $m=2u$ yields the asserted formula for $D$. Every initial digit has real absolute value at most one, including the corrected odd digits. Each inverse step $(v,w)\mapsto(w,v-a_iw)$ has its two absolute coordinates bounded componentwise by applying $\left(\begin{smallmatrix}0&1\\1&1\end{smallmatrix}\right)$ to $(|v|,|w|)$. Hence the sum of the absolute coordinates of the second column of $\Gamma^{-1}$ is at most $F_{L+2}$. The matrix of $Q$ has coefficients bounded by $T$. Evaluating on that column gives $3^e D_\ast=|cD|\le T F_{L+2}^2$. \end{proof} \begin{proposition}\label{prop:period-two-range} With the notation of Proposition~\ref{prop:period-two-height}, $x>1/9$. If $k\ge5$, then also $x<5/18$. \end{proposition} \begin{proof} Represent a regular state by its integral form $AZ^2-2BZ+C$ with $B^2-AC=D_\ast$. At the even and odd cycle states these triples are $(2u,u,-T)$ and $(T,u,-2u)$, respectively. They may be multiplied by $-1$. Under a backward step with digit $a$ the new triple is \begin{equation}\label{eq:b2-triple} (C,B+Ca,A+2Ba+Ca^2). \end{equation} Since $A^2(z-z')^2=4d$ is a $3$-adic unit, the valuations of $z,z'$ determine those of $A$ and $C=Azz'$. At an odd target, $3\mid A$ and both $B$ and $C$ are units. Its sole regular predecessor has even digit $b=\pm1$ congruent to $B/C\pmod3$, since the new constant coefficient must vanish modulo $3$. At an even target, $A,B$ are units, $C=3^v c$ with $v>0$ and $3\nmid c$, and $z\equiv q\pmod3$, where $q\in\{-1,1\}$ represents $2B/A$. Any regular predecessor requires $a\equiv-2B/C\pmod{\mathbb Z_3}$ by $1/z+1/z'=2B/C$ and $a+1/z'\in\mathbb Z_3$. Thus $a=r/3^v$, where $r\equiv-2B/c\pmod{3^v}$. Keep the candidates with $0<|a|<1/2$ or $1/2<|a|<1$ and $\operatorname{sgn}a=-q$, and require the last entry in \eqref{eq:b2-triple} to be a $3$-adic unit. They also suffice because $z$ has digit $q$, its inverse is a unit, and the odd correction rule is exactly the sign test above. The new coefficients are integers, since $Ca$ and $a(2B+Ca)$ are integral. For an odd predecessor $y=a+1/z$ we have $v_3(y)=-v$ and the new constant coefficient is $Cyy'$. It is a unit precisely when $y'$ is a unit. For an even predecessor the new even root is a unit and the congruence for $b$ gives positive valuation for its conjugate. There are two possible initial boundaries. At an odd state reached as $z_1$ from a unit square root, trace zero forces $a_0=-B/C=\pm1$. The coefficient of $Z^2$ in the resulting form is $C$, so the discriminant calculation in Proposition~\ref{prop:period-two-height} gives $|B|=|C|=1$. At an even state reached as $z_2$ from a square root with $e>0$, trace zero similarly forces $a_1=-B/C$. Taking a reciprocal interchanges the two diagonal coefficients of $(C,0,-D_\ast/C)$. Comparing them gives $|C|=3^e D_\ast$. In particular the prime-to-$3$ part of $|C|$ is $D_\ast$. We give the complete lists needed in the stated ranges. Set $t=T/9$, $w=9x=2u/t$. If $x<1/9$, then $k\ge3$. For the upper range we assume $k\ge5$. Besides the two cycle states, the backward path begins by the four digits $x-1,-1,-1/3,1$. The following rows are consecutive triples after these digits. \[ \begin{array}{c|rrr} i&A&B&C\\\hline 1&-9t&9t-u&-9t+4u\\ 2&-9t+4u&18t-5u&-6(6t-u)\\ 3&-6(6t-u)&30t-7u&-25t+8u\\ 4&-25t+8u&5t+u&-t \end{array} \] At row $2$ the alternative $2/3$ gives new constant coefficient $-t$ and is excluded. At row $4$ one has $q=1$ and $-2B/C=w+10$. The candidates are $a=w-j$, $j\in\mathbb Z$, with $-11$. At even rows $2,4,6$ the prime-to-$3$ parts of $|C|$ are respectively $2(6t-u),1,2(6t-5u)$, all strictly less than $D_\ast\ge2T$. The even cycle state likewise has prime-to-$3$ part one. Thus there is no initial boundary. The endpoints $x=1/18$ and $x=1/9$ are excluded by the reduced even numerator of $x$. For $5/25T^2/18>42T+1$ for $T\ge243$. This excludes the boundary $|C|=3^e D_\ast$. It also excludes the unit boundary $|C|=|B|=1$, which would give $|A|=D_\ast-1$. The endpoint $5/18$ has even reduced denominator. This proves the claim. \end{proof} \begin{corollary}\label{cor:preperiod-growth} At $p=3$ only finitely many nonsquare integer radicands with period two have preperiod bounded by any prescribed integer. More precisely, every such radicand satisfies \[ 3^{e+k}<9F_{L+2}^2,\qquad D<9F_{L+2}^4 . \] \end{corollary} \begin{proof} Write $T=3^k$. The lower bound for $x$ gives $u>T/18$ and $D_\ast>2Tu>T^2/9$. Apply Proposition~\ref{prop:period-two-height}. This bounds $e$ and $k$ in terms of $L$. Multiplying the height bound by $3^e$ gives $D\le 3^e T F_{L+2}^2<9F_{L+2}^4$. \end{proof} \begin{proposition}\label{prop:browkin-two-small} For $k\le6$ in Proposition~\ref{prop:period-two-height}, the only radicands are $171$ and $13851$, both with $x=2/9$. Their minimal preperiods are $10$ and $40$, respectively. In particular, $1/90$. For fixed $D_\ast$, two proportional triples have proportionality factor $\pm1$, and the parity distinguishes the root by its valuation. For odd $m$ write $\langle v\rangle_m$ for the integer in $(-m/2,m/2)$ representing $v$ modulo $m$. At each vertex $(A,B,C)$ form the following list of predecessor digits $r/m$. \begin{enumerate} \item At an odd vertex take $m=1$ and $r=\langle BC\rangle_3$. \item At an even vertex put $m=3^{v_3(C)}$, $c=C/m$ and $q=\langle2BA\rangle_3$. Take $r_0=\langle-2Bc^{-1}\rangle_m$. Use $r=r_0$ and also $r=r_0-m\sgn r_0$ if this second numerator satisfies $rq<0$. \end{enumerate} For each candidate compute \[ B_1=B+(C/m)r,\qquad C_1=(B_1^2-D_\ast)/C . \] These integers give the triple $(C,B_1,C_1)$ in \eqref{eq:b2-triple}. At an even vertex discard the candidate if $3\mid C_1$. Normalize the remaining triples and add each unseen vertex of the opposite parity to the queue at distance one greater than the current distance. Continue until the queue is empty. Test each vertex for an initial square root. At an odd vertex the condition $|B|=|C|=1$ is sufficient as well as necessary, since $a_0=-B/C=\pm1$ gives a square root of $D_\ast$. At an even vertex use $m,c,q$ as above. When $|c|=D_\ast$ and $c\mid B$, put $r=-B/c$. A boundary occurs precisely when $0<|r|3^k/18$, whence $u\ge122$ and $D\ge122(122+2\cdot2187)=548512$. \end{proof} The necessary conditions for period two do not by themselves guarantee that period. For instance, the root $\rho$ of Proposition~\ref{prop:171} has the expansion \[ \rho=[1;1/9,-1,1/3,-1,-1/3,\overline{-1,-1/3,1,2/3}]. \] The word satisfies the truncation rules in Lemma~\ref{lem:real}, and multiplication of its prefix and period matrices gives a square root of $19$ congruent to $1$ modulo $3$. Its least preperiod is six and its least period is four. \subsection{Real and imaginary quadratic fields} \begin{theorem}\label{thm:signed-fields} Let $p$ be an odd prime and $h$ a positive even integer, with $(p,h)\ne(3,2)$. For each prescribed sign there are infinitely many nonsquare integers $D$ of that sign whose square roots in $\mathbb Q_p$ have minimal Browkin~II period $h$. For either sign the quadratic fields $\mathbb Q(\sqrt D)$ can be chosen pairwise distinct. \end{theorem} \begin{proof} Fix $\varepsilon\in\{1,-1\}$. First suppose $4\mid h$. Choose $r\ge1$ with $y=p^r\ge5$, and put \[ P=y^2,\qquad d=y^2-y+1,\qquad x=d/P-1=-(y-1)/y^2. \] Then $0<|x|<1/5$, $|x|_p=P$ and $|2x|<1/2$. As $d$ is odd and $p^{3r}=(y+1)d-1$, the binomial theorem gives $p^{3rd}\equiv-1\pmod{d^2}$. Thus there are arbitrarily large $N$ with $p^N\equiv-\varepsilon\pmod{d^2}$. Put \[ D_N=\frac{P^2(1+\varepsilon p^N)}{d^2},\qquad \mu_N=-2+\frac{2P}{d}(1+\varepsilon p^{-N}). \] Then $D_N\in\mathbb Z$ and $\mu_N\in\mathbb Z[1/p]$, since $d\mid p^N+\varepsilon$. For $N>2r$ we have $|\mu_N|_p=p^{N-2r}$, while $\mu_N\to-2x/(1+x)$ in $\mathbb R$. The limit has absolute value less than $1/2$, so $\mu_N$ is uncorrected for large $N$. For the prefix $(x,1)$ in setting~\textup{(O)}, put $B=1/(1+x)=P/d$. Identity~\eqref{eq:mob-O} gives \[ \frac1{\Phi(\mu)}=B^2+\frac{2B^3}{\mu+2x/(1+x)}. \] In particular $1/\Phi(\mu_N)=D_N$, with $\Phi(\mu_N)$ finite and nonzero for large $N$. Proposition~\ref{prop:palindrome-closure} gives a square root $[0;x,\overline{1,\mu_N,1,2x}]$ of $D_N$ with minimal period four. A negative $D_N$ is nonsquare. For $\varepsilon=1$, if $1+p^N$ were a square, its square root $z$ would be an even integer and the coprime positive factors $(z-1)(z+1)=p^N$ would give $p^N=3$. Thus $D_N$ is also nonsquare in this case. For $h=4m$, $m\ge2$, take the first $2m$ digits after the initial zero as in the proof of Proposition~\ref{prop:period-four-multiples}. The same reflection gives the palindrome with seed $D_N$, and the reversed continuant ratios have the same four nonzero limits $x,(1+x)/x,-x/(1+x),-1/x$. Here $|x|<1/5$ also gives $|x/(1+x)|<1/4$, so $|\mu_\infty|<1/2$ for large $N$. Moreover, $g_{11}=\prod_{i=1}^{2m}r_i$ has nonzero limit and $g_{21}$ is a continuant in digits with finite limits. Thus $B'=g_{21}/g_{11}$ stays bounded. Fix $N$ sufficiently large that $D_N-(B')^2$ has sign $\varepsilon$. Equation~\eqref{eq:family} and Proposition~\ref{prop:palindrome-closure}(2) now give infinitely many radicands of this sign with minimal period $4m$. For $h\equiv2\pmod4$ the preceding constructions already give both signs. At $p=3$, $h=6$, they correspond to the two parities of $k$ in $(1-9(-3)^k)/4$. Finally, every constructed family has the form $D=(n^2+Cp^s)/d^2$ for fixed nonzero integers $n,C,d$ and infinitely many distinct positive exponents $s$. Fix a squarefree integer $f$ of the chosen sign. If $D=fz^2$, choose $j\in\{0,1,2\}$ with $s\equiv j\pmod3$ and put $X=p^{(s-j)/3}$, $A=Cp^j$, $H=fd^2$. Here $z\in\Z$, since $D$ is an integer and $f$ is its squarefree part. Thus $Hz^2=AX^3+n^2$, and the integers $(U,V)=(HAX,H^2Az)$ satisfy \[ V^2=U^3+H^3A^2n^2. \] For fixed $f$ and $j$ the constant term is a nonzero integer, so the cubic is nonsingular. By Siegel's theorem \cite[Corollary~IX.3.2.1]{SilvermanEC} the curve has only finitely many integral points. Distinct $s$ in the same residue class give distinct $U=HAp^{(s-j)/3}$. Thus only finitely many radicands in the family have squarefree part $f$. \end{proof} \section{Periodicity and approximation for quadratic irrationals}\label{sec:periodicity} \subsection{Wang and Deng's fourth algorithm at \texorpdfstring{$p=5$}{p=5}} Wang and Deng proved eventual periodicity for their fourth and fifth algorithms at $p=2,3$ and conjectured it at $p=5$ \cite[Section~3.3]{WD}. We prove their conjecture for the fourth algorithm and give a sharp bound for the denominators of its complete quotients. A quadratic irrational in $\Q_5$ can be written as \[ \alpha=\frac{P+\sqrt D}{Q},\qquad P,Q,D\in\Z,\quad Q\ne0,\quad Q\mid D-P^2, \] with $D$ nonsquare and $\sqrt D\in\mathbb Z_5$. Indeed, after clearing denominators and scaling the radical, the substitution $(P,Q,\sqrt D)\mapsto(PQ,Q^2,Q\sqrt D)$ ensures the divisibility. If $a\in\Z[1/5]$ and $\alpha-a\in\mathbb Z_5$, then the next complete quotient has integral coordinates \begin{equation}\label{eq:integral-step} P_1=aQ-P,\qquad Q_1=\frac{D-P_1^2}{Q},\qquad \frac1{\alpha-a}=\frac{P_1+\sqrt D}{Q_1}. \end{equation} To see this, $aQ=P+\sqrt D-Q(\alpha-a)$ lies in both $\Z[1/5]$ and $\mathbb Z_5$, and hence is integral. Expanding $Q_1$ gives membership in $\Z[1/5]$, while $Q_1=(\alpha-a)(\sqrt D+P_1)$ gives membership in $\mathbb Z_5$. Nonsquareness excludes $Q_1=0$, and $Q_1\mid D-P_1^2$ follows from $D-P_1^2=QQ_1$. For a quadratic irrational $\alpha=(P+\sqrt D)/Q\in\mathbb Q_5$, Wang and Deng \cite[Section~3]{WD} choose $\bar s(\alpha)$ from $s(\alpha)+5\mathbb Z$ and $\bar t(\alpha)$ from $t(\alpha)+\mathbb Z$, in each case closest to the half-trace $P/Q$. Fix a deterministic rule in case of a tie. Thus \begin{align} &\alpha-\bar s(\alpha)\in5\mathbb Z_5,& &|P/Q-\bar s(\alpha)|\le5/2,\notag\\ &\alpha-\bar t(\alpha)\in\mathbb Z_5,& &|P/Q-\bar t(\alpha)|\le1/2.\label{eq:wd-bounds} \end{align} Algorithm~4 starts with $b_0=\bar s(\alpha_0)$ and then uses \[ b_n=\begin{cases} \bar s(\alpha_n),&|\alpha_n|_5=1,\\ \bar t(\alpha_n),&|\alpha_n|_5>1, \end{cases}\quad(n\ge1),\qquad \alpha_{n+1}=\frac1{\alpha_n-b_n}\quad(n\ge0). \] After the first step $|\alpha_n|_5\ge1$. Every $\bar s$-step is followed by a $\bar t$-step. \begin{theorem}\label{thm:wd} Every quadratic irrational in $\mathbb Q_5$ has an eventually periodic expansion under Wang and Deng's Algorithm~4. In the integral normalization \eqref{eq:integral-step}, put $d=|D|$ and $H=\max\{|Q_0|,|Q_1|,4d+1\}$. Then \[ |Q_n|\le H\quad(n\ge0),\qquad |P_n|\le\sqrt{d+H^2}\quad(n\ge1). \] For all sufficiently large $n$, we have $|Q_n|\le4d+1$. Equality in this last bound occurs on a periodic orbit for infinitely many $d$. \end{theorem} \begin{proof} At a $\bar t$-index $n\ge1$, write $M=|Q_n|$, $A=|P_{n+1}|$ and $N=|Q_{n+1}|$. Since $|\alpha_n|_5>1$ and $P_n,\sqrt D$ are $5$-adically integral, $5\mid Q_n$. In particular $M\ge5$. From the recurrence and the nearest-integer rule, \[ 2A\le M,\qquad MN=|A^2-D|,\qquad N\le M/4+d/M. \] If the next index is a $\bar t$-index, the next return has denominator of absolute value $N$. Otherwise $\alpha_{n+1}$ is a unit. Its $\bar s$-coset is a nonzero integer class modulo five. Put $B=|P_{n+2}|$ and $R=|Q_{n+2}|$. We have $NR=|B^2-D|$ and $B\le5N/2$. Suppose first that $M>2d$. Then $N\le M/4+d/Md$ and $D-A^2\le d$, we have $A^2-D=MN$. It follows that \[ M(2N-A)=-A(M-2A)-2D\le2d2$. The choice of the nearest representative gives $B\le A$, strictly if $2Nd$, it follows that $|B^2-D|\le A^2-D$, with strict inequality when $B4d+1$. Suppose now that $5\le M\le2d$. Then $d\ge4$, since neither $3$ nor $-3$ is a square modulo five. By convexity on $[2,2d]$, $N\le M/4+d/M\le(d+1)/2$. If $N=1$, the half-trace at the intermediate step is an integer, so $B\le2$ and $R\le d+4\le4d+1$. If $N\ge2$, then \[ R\le\frac{25N}{4}+\frac dN \le\frac{29d+25}{8}<4d+2. \] Thus $R\le4d+1$ by integrality. All estimates for $B,R$ apply whenever that intermediate $\bar s$-step occurs. Index one is a $\bar t$-index, and at most one $\bar s$-step lies between consecutive $\bar t$-indices. The preceding bounds show that the absolute values of the denominators at these indices eventually enter $[1,4d+1]$ and stay there. They also bound every intermediate denominator. The claimed estimate for $P_n$ follows from $P_n^2=D-Q_{n-1}Q_n$. The bounded integral pairs form a finite set, so the deterministic orbit is eventually periodic. For sharpness let $k\ge1$, $M=5^k$ and $d=(M-1)/4$. Choose $\rho\in\mathbb Z_5$ with $\rho^2=-d$ and $\rho\equiv2\pmod5$. Such a root exists since $d\equiv1\pmod5$. For $\alpha=(2d+\rho)/d$ the first digit is $4$, since $\alpha\equiv4\pmod5$ and its half-trace is $2$. Equation \eqref{eq:integral-step} gives $\alpha_1=(2d+\rho)/(-M)$. The factorization $(2d-\rho)(2d+\rho)=dM$ gives $v_5(2d-\rho)=k$, as $2d+\rho$ is a unit. Thus $b=-4d/M=-1+5^{-k}$ is in the $\bar t$-coset of $\alpha_1$, its distance to the half-trace is $2d/M<1/2$, and $1/(\alpha_1-b)=\alpha$. The expansion is purely periodic of minimal period two, with digits $4,b$ and denominators $d,-M$. It is also an Algorithm~5 expansion. The primitive polynomial $dX^2-4dX+M$ has discriminant $-4d$, so these examples use the stated normalization without a common scaling factor. \end{proof} \subsection{Two sufficient conditions for the fifth algorithm} Wang and Deng's Algorithm~5 takes $\bar s$ at even indices and $\bar t$ at odd indices, regardless of the valuation of the input to a step. Its full periodicity assertion at $p=5$ remains open. \begin{corollary}\label{cor:wd5-unit} If the odd remainders $\alpha_{2j+1}-\bar t(\alpha_{2j+1})$ are $5$-adic units for all sufficiently large $j$, the Algorithm~5 expansion of a quadratic irrational in $\mathbb Q_5$ is eventually periodic. \end{corollary} \begin{proof} Every following even complete quotient is a unit. Starting at one of these even indices, Algorithms~4 and~5 therefore make the same choices when given the same deterministic tie rule. Apply Theorem~\ref{thm:wd}. \end{proof} For a different criterion, write $e_n=|b_n-P_n/Q_n|$ for the real distance of the selected digit from the half-trace. For a set $S$ of nonnegative integers write $\overline d(S)=\limsup_{m\to\infty}|S\cap[0,m)|/m$. \begin{proposition}\label{prop:wd5-density} Let $p\ge5$ be an odd prime and consider a quadratic Algorithm~5 expansion in $\mathbb Q_p$. If the expansion is not eventually periodic, then for every $0\left(1+\frac{a(2+a)}p\right)^2|Q_n| \qquad (0\le n\le2L-1). \] For $p\ge7$ the same conclusions hold for Algorithm~4. \end{proposition} \begin{proof} Choose $\rho^2=D$ in $\mathbb Z_p$ with $\rho\equiv-1\pmod p$. For $p=5$, $22^2<501<23^2$. For $p\ge7$, $D=(2t+1)^2$ with $t\ge0$ would give $p=t(t+1)$. Thus $D$ is nonsquare. Set $w=(\rho-1)/(2p^h)$ and $z=w/p$. The relation $w(w+a)=p$ gives $1/(w+a)=z$ and $1/(z+a/p)=w$. The two residual valuations are $h+1$ and $h$, respectively. Put $\mu=\rho+1/(w-2)$. We have $v_p(w-2)=-h$. When $h=0$ this follows from $w\equiv-1\pmod p$ and $p\ge7$. Choose arbitrarily large positive integers $m$ with $v_p(m-\mu)=(4h+2)L+2h+1$ and put \[ x=2+\frac1{m-\rho}=\frac{2q+m+\rho}{q},\qquad q=m^2-D. \] Since $w=2+1/(\mu-\rho)$ and both $m-\rho$ and $\mu-\rho$ have valuation $h$, we get $v_p(x-w)=(4h+2)L+1$. The primitive polynomial $qX^2-2(2q+m)X+4q+4m+1$ has discriminant $4D$. It is primitive because a common divisor of its coefficients divides both $2m$ and $4m+1$. Both real conjugates of $x$ lie in $I=(2,p/2-a)$ for large $m$. The two-step map $F(y)=(y+a)/(1+a(y+a)/p)$ is increasing and preserves $I$. Indeed $F(2)>2$ and $F(p/2-a)=p/(2+a)

4+2a$. For $y\in I$ one has \[ y+a

h$. Inversion after $-a/p$ therefore lowers it by $2h$, the two residuals having valuation $h$. This proves the digit congruences and the induction. For $h=0$ the even states are units and the odd ones have valuation $-1$, so Algorithm~4 makes the same choices. At index $2L$ the discrepancy from $w$ has valuation one and the next digit is still $-a$. At the ensuing odd index the discrepancy from $z$ has valuation $1-v_p(x_{2L}+a)-(h+1)<0$. Hence $-a/p$ is outside its $\bar t$-coset, and the run ends. A determinant-one map $(Ay+B)/(Cy+E)$ multiplies a fixed-radical denominator by $(Cy+E)(Cy'+E)$, by the identity for the difference of its two real conjugates. The bottom row of $F$ is $(a/p,1+a^2/p)$, and its even arguments exceed $2$. The odd two-step map is $(y+a/p)/(ay+1+a^2/p)$ and its odd arguments exceed $2/p$. In both cases every factor exceeds $1+a(2+a)/p$, giving the claim. \end{proof} In particular, a bound of the form $|Q_{n+k}|<|Q_n|$ whenever $|Q_n|$ exceeds a fixed threshold fails for every fixed $k\ge1$. For even $k$ this follows from the proposition. For odd $k$ one also uses $|Q_1|/|Q_0|=(x+a)(x'+a)>(2+a)^2$ at the first step. This applies to Algorithm~5 at $p=5$ and to both algorithms at larger primes. Growth is also possible with a fixed imaginary quadratic field. Choose $s^2=-6$ with $s\equiv13\pmod{25}$, put $m=98+125k$ for $k\ge0$ and set \begin{gather*} q=m^2+6,\quad P=2q+m,\quad M=4q+4m+1,\\ x=(P+s)/q,\quad y=1/5+1/x,\quad z=1+1/y . \end{gather*} At $p=5$ the first three Algorithm~5 digits of $z$ are $1,1/5,-2/5$. Indeed, $1/x=(P-s)/M$, $2/5

3/5$ and the nonreal conjugate pair. Also $1/y\in5\mathbb Z_5$. To see that $x+2/5\in5\mathbb Z_5$, observe that its numerator $12q+5m+5s$ is divisible by $125$, while $v_5(5q)=2$. Its real half-trace is $12/5+m/q<5/2$. Applying \eqref{eq:integral-step} with radical $-25s$ gives absolute denominators $25M$ and $144q+120m+25$ at indices one and three. Their ratio tends to $36/25>1$ as $k\to\infty$. \subsection{Yasutomi's simultaneous algorithm at \texorpdfstring{$p=3$}{p=3}} Let $K$ be a real quadratic field with chosen embeddings into $\mathbb R$ and $\Qp$. Write $\alpha_\infty$ for the real image of $\alpha\in K$. Yasutomi's algorithm \cite[Definitions~1.1 and~1.2]{Yasutomi} chooses the $a_n\in\Z[1/p]$ closest to $(\alpha_n)_\infty$ subject to \[ \alpha_n-a_n\in p\Zp\quad(n\text{ even}),\qquad \alpha_n-a_n\in\Zp\quad(n\text{ odd}), \] and then uses \eqref{eq:step}. For odd $p$ these two sets of admissible digits are $s(\alpha_n)+p\Z$ and $t(\alpha_n)+\Z$. The congruence formulation also applies at $p=2$. The midpoint of two consecutive representatives is rational, so the nearest representative is unique. Yasutomi proved periodicity and real convergence at $p=2$ and conjectured eventual periodicity for the primes $3\le p\le23$ \cite[Corollaries~3.14 and~3.20, Conjecture~5.2]{Yasutomi}. \begin{theorem}\label{thm:yasutomi} For $p=3$, the above algorithm is eventually periodic for every $\alpha\in K\setminus\mathbb Q$. The real limit of its convergents is $\alpha_\infty$. \end{theorem} \begin{proof} For $n\ge1$, put $r_n=1/\alpha_n$, and let $x_n,y_n$ be its two real conjugates, with $x_n$ corresponding to the chosen embedding. The recurrence is \begin{equation}\label{eq:remainder} r_{n+1}=\frac1{r_n}-a_n. \end{equation} The nearest-representative rule gives \[ |x_n|<\begin{cases}1/2,&n\text{ even},\\3/2,&n\text{ odd},\end{cases} \qquad |r_n|_3\le\begin{cases}1,&n\text{ even},\\1/3,&n\text{ odd}. \end{cases} \] First we bound the real separation $\delta_n=|x_n-y_n|$ away from zero. By \eqref{eq:remainder}, \[ \delta_{n+1}=\frac{\delta_n}{|x_ny_n|}. \] If $|x_n|\le A$, then $|y_n|\le A+\delta_n$, and hence \[ \delta_{n+1}\ge f_A(\delta_n),\qquad f_A(t)=\frac{t}{A(A+t)}. \] These functions are increasing on $t>0$. For even $n$, composition yields \[ \delta_{n+2}\ge \frac{16\delta_n}{3(14\delta_n+3)} \ge\min(\delta_n,1/6). \] For odd $n$, it similarly gives \[ \delta_{n+2}\ge\frac{16\delta_n}{14\delta_n+9} \ge\min(\delta_n,1/2). \] Consequently \begin{equation}\label{eq:delta-lower} \delta_n\ge\delta_*:=\min(\delta_1,\delta_2,1/6)>0 \qquad(n\ge1). \end{equation} Next let $u_n,v_n$ be the two $3$-adic conjugates of $r_n$, with $u_n=r_n$. We show that eventually \begin{equation}\label{eq:p-separation} |v_n|_3>1\quad(n\text{ even}),\qquad |v_n|_3\ge1\quad(n\text{ odd}). \end{equation} Once this pattern holds at one index, it persists. At an odd index, $|a_n|_3=|1/u_n|_3>1$, while $|1/v_n|_3\le1$, so the next conjugate has norm greater than one. At an even index, $|a_n|_3=|1/u_n|_3\ge1$, while $|1/v_n|_3<1$, so the next conjugate has norm at least one. If the pattern never occurred, both $u_n$ and $v_n$ would have norm at most $1/3$ at odd indices and at most one at even indices. Iterating \[ u_n-v_n=-u_nv_n(u_{n+1}-v_{n+1}) \] would give $|u_1-v_1|_3\le3^{-N}$ after $N$ steps, since the terminal difference is bounded by one. This contradicts $u_1\ne v_1$. Thus \eqref{eq:p-separation} holds eventually. In particular $|u_n-v_n|_3\ge1$ from some index onwards. Choose an integral quadratic polynomial $F_1$ for $r_1$, and define $F_n(X)=A_nX^2+B_nX+C_n$ recursively by \[ F_{n+1}(X)=(X+a_n)^2F_n\!\left(\frac1{X+a_n}\right). \] The coefficients of every $F_n$ lie in $\mathbb Z[1/3]$. Its roots are the conjugates of $r_n$, and the substitutions preserve the discriminant $\Delta>0$. Also $A_{n+1}=C_n$. By \eqref{eq:delta-lower}, \[ |A_n|=\frac{\sqrt\Delta}{\delta_n}\le\frac{\sqrt\Delta}{\delta_*}. \] By eventual $3$-adic separation, \[ v_3(A_n)=\frac12v_3(\Delta)-v_3(u_n-v_n) \ge\frac12v_3(\Delta). \] Since $\Delta$ is a positive integer, the last inequality and $A_n\in\mathbb Z[1/3]$ imply $A_n\in\mathbb Z$ for all sufficiently large $n$. The real bound therefore leaves only finitely many possible values of $A_n$. The same holds for $C_n=A_{n+1}$ and then for $B_n$, since $B_n^2=\Delta+4A_nC_n$. There are only finitely many transported polynomials and hence finitely many possible $r_n$. Repetition at indices of the same parity gives periodicity, and taking reciprocals gives the same conclusion for the original complete quotients. For real convergence, choose $n\ge1$ and an even integer $h$ such that $\alpha_{k+h}=\alpha_k$ for all $k\ge n$, and put $T=M(a_n)\cdots M(a_{n+h-1})$. Then $((\alpha_n)_\infty,1)^T$ is an eigenvector with eigenvalue \[ \lambda=\prod_{j=1}^{h}(\alpha_{n+j})_\infty, \qquad |\lambda|>(4/3)^{h/2}>1, \] by the real bounds on $x_{n+j}=1/(\alpha_{n+j})_\infty$. Since $\det T=1$, the other eigenvalue is $\lambda^{-1}$, with eigenvector $((\alpha_n')_\infty,1)^T$. For each residue class of indices modulo $h$, the numerator--denominator vectors of the convergents of the periodic tail have the form $T^kv$ with a fixed nonzero rational vector $v$. Such a vector cannot lie in the second eigenspace, whose slope is irrational. The first eigencomponent therefore dominates as $k\to\infty$, and the ratios converge to $(\alpha_n)_\infty$. Applying the fixed matrix of the preperiod gives convergence to $\alpha_\infty$. Its denominator is nonzero at the irrational point $(\alpha_n)_\infty$. \end{proof} \begin{corollary}\label{cor:yas-period-bound} Let $\Delta$ be the discriminant of an integral quadratic polynomial for $r_1$ in the proof of Theorem~\ref{thm:yasutomi}, and put $D=\Delta/3^{v_3(\Delta)}$. The least even period $h$ of the complete quotients satisfies \[ h\le 8\!\sum_{\substack{B\in\Z,\ |B|<7\sqrt D\\B^2\equiv D\pmod4}} \tau\!\left(\frac{|B^2-D|}{4}\right) \ll_{\epsilon}D^{1/2+\epsilon}\qquad(\epsilon>0), \] where $\tau$ denotes the divisor function. \end{corollary} \begin{proof} The integer $v_3(\Delta)=2d$ is even since the two roots lie in $\Q_3$. The integer $D$ is nonsquare, since $\Delta=3^{2d}D$ is the discriminant of an irreducible quadratic. In the eventually periodic part of the orbit, the minimum real conjugate separation at even indices exceeds $1/6$. Indeed, the even two-step bound in the proof of Theorem~\ref{thm:yasutomi} is strict and its increasing right-hand side is at least its argument for arguments at most $1/6$. Applying it to a predecessor of a point of minimum separation proves the assertion. At odd indices the corresponding minimum exceeds $1/2$. For sufficiently large $n$, the same proof gives $v_3(A_n),v_3(C_n)\ge d$, and $B_n^2=\Delta+4A_nC_n$ then gives $v_3(B_n)\ge d$. Dividing each of these polynomials by $3^d$ gives integral coefficients of discriminant $D$. At even indices in the period, write these coefficients as $A,B,C$. The separation estimates and $C_n=A_{n+1}$ give \[ |A|<6\sqrt D,\qquad |C|<2\sqrt D,\qquad |B|<7\sqrt D. \] For each $B$ in the sum there are at most $2\tau(|B^2-D|/4)$ signed factorizations $AC=(B^2-D)/4$, and each polynomial has two roots. The even positions in a minimal even cycle are distinct. Multiplying their number by two proves the displayed bound. In that sum $|B^2-D|/4<12D$ for the terms arising from the orbit, and all terms displayed are $O(D)$. The standard divisor bound $\tau(m)\ll_\epsilon m^\epsilon$ finishes the proof. \end{proof} \subsubsection{The real conjugate at larger primes} \begin{lemma}\label{lem:yas-unit} Let $K$ be a real quadratic field with fixed embeddings into $\mathbb R$ and $\Qp$. Every open interval in $\mathbb R_{>0}$ contains real images of norm-one units $u\in\mathcal O_K[1/p]^\times$ with $v_p(u)$ arbitrarily negative. \end{lemma} \begin{proof} The chosen $p$-adic embedding determines one of the two distinct primes $\mathfrak p,\mathfrak p'$ above $p$. By finiteness of the ideal class group, take $m>0$ and $\pi$ with $(\pi)=\mathfrak p^m$. Writing primes for field conjugation, $\eta=(\pi'/\pi)^2$ is a positive norm-one unit in $\mathcal O_K[1/p]$ with $v_p(\eta)=-2m$. Choose an ordinary norm-one unit $\epsilon$ with $\epsilon_\infty>1$ by the real quadratic unit theorem. The ratio $\log\eta_\infty/\log\epsilon_\infty$ is irrational, since otherwise a nonzero power of $\eta$ would equal a power of $\epsilon$, contradicting their valuations. The positive iterates of the corresponding irrational rotation are dense, as is every tail. Thus $\eta^j\epsilon^k$ lies in the prescribed real interval for arbitrarily large $j>0$ and suitable integers $k$. \end{proof} \begin{theorem}\label{thm:yas-other-embedding} For each prime $p\ge5$ and each real quadratic field $K$ with chosen real and $p$-adic embeddings, Yasutomi's alternating algorithm admits infinitely many $\alpha\in K$ with a purely periodic expansion of least period two whose convergents tend in $\mathbb R$ to the other real conjugate of $\alpha$. \end{theorem} \begin{proof} Choose a unit $u$ as in Lemma~\ref{lem:yas-unit} with \[ \frac{2p}{2p+1}4p+2$. Put \[ x=p^2(1-u),\quad y=u/x,\quad b=-p^{-2},\quad a=-p^2(u+u^{-1}-2). \] The trace $u+u^{-1}$ belongs to $\Z[1/p]$. Direct substitution gives \[ x=a+1/y,\qquad y=b+1/x,\qquad v_p(x)=2+v_p(u)<0, \qquad v_p(y)=-2. \] Our interval gives $x_\infty>2$ and $y_\infty>2/p$. At the even step $x-a=1/y$ belongs to $p\Zp$ and has real absolute value $

1$ in the selected $p$-adic embedding. The attracting real slope is therefore the conjugate $x'=p^2(1-u^{-1})$, which is negative. Both projective subsequences of convergents approach $x'$, since their initial vectors have rational slope and the repelling slope is irrational. Taking $v_p(u)$ arbitrarily negative makes the inputs $x$ distinct. \end{proof} For example, let $p\ge5$. The positive root $x$ of $X^2+p^{-1}X-p=0$, embedded $p$-adically as the root of valuation $-1$, has successive complete quotients $x,x/p$ and digits $-1/p,-1/p^2$. Indeed, $x+1/p=p/x$, $x>2$, and $x/p+1/p^2=1/x$. The period matrix has eigenvalue $x^2/p=1-x/p^2<1$ at the positive real root, so the convergents tend to the other real root. The integer $1+4p^3$ is nonsquare, since a square would give two consecutive coprime positive integers with product $p^3$, forcing that product to be $2$. The polynomial $pX^2+X-p^2$ has a root of valuation $2$ by Hensel's lemma and the other has valuation $-1$. Together with the $p=2$ convergence theorem of \cite[Corollary~3.14]{Yasutomi}, the preceding examples show that $p=3$ is the largest prime for which convergence to the selected real embedding holds for every real quadratic input. The eventual periodicity in \cite[Conjecture~5.2]{Yasutomi} remains open at $p=5,7,11,13,17,19,23$. \subsection{Yasutomi's sign algorithm} In a separate algorithm \cite[formula~(1.1)]{YasuSign}, Yasutomi uses the ordinary, nonnegative truncation $\lfloor\cdot\rfloor_p$. Here $\lfloor u\rfloor_p$ is the unique $c\in\Z[1/p]\cap[0,p)$ for which $u-c\in p\Zp$. With chosen embeddings of a real quadratic field $K$ into $\mathbb R$ and $\Qp$, put \[ \varepsilon_n=\sgn((\alpha_n)_\infty),\qquad b_n=\varepsilon_n\lfloor\varepsilon_n\alpha_n\rfloor_p,\qquad \alpha_{n+1}=1/(\alpha_n-b_n). \] Write $\beta_n=\varepsilon_n\alpha_n$, $x_n=(\beta_n)_\infty$ and $c_n=\lfloor\beta_n\rfloor_p$. For $n\ge1$ we have $v_p(\beta_n)=v_p(c_n)<0$ and $02$ at infinitely many indices. At $p=2$ every quadratic irrational has infinitely many indices with $\varepsilon_{n+1}=\varepsilon_n$. \end{theorem} \begin{proof} Suppose that all late steps change sign and have $c_n\le2$. Equality is impossible since $v_p(c_n)<0$. On this tail $01/(2-x_n)$. All $x_n$ on the tail lie below one. Indeed, $x_n=1$ would give $x_{n+1}>1$, and as long as $10$ a fixed nonsquare integer and $B_n,K_n\in\Z$, $K_n\mid D-B_n^2$. Such initial coordinates are obtained from $(B+s)/K$ by replacing $(B,K,s)$ with $(BK,K^2,Ks)$. On our tail the recurrence is \[ B_{n+1}=c_nK_n-B_n,\qquad K_{n+1}=(B_{n+1}^2-D)/K_n. \] The first new coordinate is integral since $c_nK_n=B_n+s-K_n(\beta_n-c_n)$ belongs to $\Z[1/p]\cap\Zp$. The second belongs to $\Z[1/p]$ by expansion and equals $(c_n-\beta_n)(s+B_{n+1})\in\Zp$. It again divides $D-B_{n+1}^2$. Since $v_p(K_n)\ge-v_p(\beta_n)$, we have $|K_n|\to\infty$. From $x_n\to1$ it follows that $|B_n|\to\infty$. Since $K_nK_{n+1}=B_{n+1}^2-D>0$ eventually, the sign of $K_n$ is eventually constant, and we may choose $K_n>0$ by changing the signs of $B_n,K_n,s$ together. For either $z_n=K_n-B_n$ or $z_n=B_{n+1}-K_n$, we have $K_n\mid z_n^2-D$. Both quantities exceed $s_\infty$ by $x_n<1$ and $c_n-x_n=1/x_{n+1}>1$, respectively. Each $z_n$ tends to $+\infty$. Indeed, a bounded subsequence would contain a fixed integer $z$ and force $K_n\mid z^2-D\ne0$ on that subsequence. Thus eventually both real images of $1-\beta_n$ and of $c_n-1-\beta_n$ are positive. In both embeddings the latter is strictly smaller because $c_n<2$. With $N$ the field norm, the quantities \[ H_n=K_n N(1-\beta_n)=\frac{(K_n-B_n)^2-D}{K_n} \] are then positive integers. The identity $K_{n+1}=K_nN(c_n-\beta_n)$ gives \[ H_{n+1}=K_nN(c_n-1-\beta_n)0$ arbitrarily close to one. Then $c=u+u^{-1}\in\Z[1/p]$ satisfies $21$ and $u_\infty^{-1}$ if $u_\infty<1$. The unit lemma allows either choice with arbitrarily negative valuation. \end{proof} \begin{proposition}\label{prop:yas-sign-two-embeddings} In every real quadratic field embedded in $\Q_2$, each of the two alternatives for the real limit of Yasutomi's sign algorithm is attained by infinitely many inputs of least period six. \end{proposition} \begin{proof} Take a unit $u$ as in Lemma~\ref{lem:yas-unit} with $99/1005/8+1/9>2/3$ and $y_\infty>0$. As $bc-1=-1/16$, the relations \[ (bc-1)x+b=u,\qquad xyz=u,\qquad x-1/y=(u+u^{-1}-b-c)/(bc-1)=a \] follow directly. Also $v_2(x)=4+v_2(u)<0$, $v_2(z)=-3$ and $v_2(y)=-1$. Thus $x-a=1/y$, $y-b=-1/z$ and $z-c=1/x$ belong to $2\mathbb Z_2$. Their real signs give the successive complete quotients $x,y,-z,-x,-y,z,x$. The corresponding digits $a,b,-c,-a,-b,c$ are distinct, so their least period is six. The period eigenvalue on $(x,1)^T$ is $-u^2$. The attracting real slope is $x_\infty$ for $u_\infty>1$ and the other conjugate $(24-16u^{-1})_\infty$ for $u_\infty<1$. In either interval the valuation of $u$ may be chosen arbitrarily negative. \end{proof} There is no uniform bound on the length of consecutive sign changes at $p=2$, even within a fixed quadratic field. \begin{proposition}\label{prop:yas-long-block} For every real quadratic $K\subset\Q_2$ and every $L\ge1$, some irrational input has $L$ initial sign changes with a single common normalized digit. \end{proposition} \begin{proof} Write $K=\Q(\sqrt d)$ with squarefree $d>0$ and choose the sign of $\sqrt d$ positive at the real place. Take an integer $M>L+4$ sufficiently large that $\epsilon\sqrt d<2^{-M-1}$, where $\epsilon=2^M/(2^{3M}+1)$. Put $g=2^{-M}$, $c=2-g$, $\beta_L=1-g+\epsilon\sqrt d$, and recursively set $\beta_j=c-1/\beta_{j+1}$. For $e_j=1-(\beta_j)_\infty$ we have $g/23$ remains open. \subsubsection{Approximation on a periodic orbit} Yasutomi obtained upper bounds with exponents adding to two for his alternating algorithm at $p=2$ \cite[Corollary~3.25]{Yasutomi}. For another family of periodic continued fractions, Barbero, Cerruti and Murru~\cite{BCM} express the $p$-adic convergence rate in terms of the eigenvalues of a period matrix. For each of Yasutomi's two algorithms, the two eigenvalues determine the orders of both approximation errors. \begin{proposition}\label{prop:yas-rates} For either of Yasutomi's algorithms, suppose that the complete quotients of a real quadratic irrational $\alpha\in\Qp$ are eventually periodic. In the alternating algorithm take a period of even length. If $p_n/q_n$ are the convergents in lowest integer terms, there is a $\xi\in\{\alpha_\infty,(\alpha')_\infty\}$ and there are $\gamma_\infty,\gamma_p>0$ with $\gamma_\infty+\gamma_p=2$ such that \[ |\xi-p_n/q_n|\asymp |q_n|^{-\gamma_\infty},\qquad |\alpha-p_n/q_n|_p\asymp |q_n|^{-\gamma_p}. \] At $p=3$ in Theorem~\ref{thm:yasutomi}, $\xi$ is the selected real image. The implied constants depend on the orbit. \end{proposition} \begin{proof} Let $T$ be the product of the matrices $M(a)$ over one period, starting after the first complete quotient. The periodic complete quotient and its conjugate give two eigenlines of quadratic irrational slope, and $\det T=\pm1$. On the selected $p$-adic eigenline its eigenvalue is the product of the complete quotients following the successive digits. Write $P$ for its $p$-adic norm. We have $P>1$. For the sign algorithm every factor has norm $>1$. For the alternating algorithm the factors have norm at least one and every second factor has norm $>1$. The two real eigenvalues have distinct absolute values. Otherwise their ratio would be $1$ or $-1$, as their eigenlines are real and distinct, and $T^2$ would be scalar, contradicting the $p$-adic eigenvalue norms. Let $R>1$ be the larger real eigenvalue modulus. Write the unscaled continuants as $(A_n,B_n)$. On each residue class modulo the period $h$, their column equals $U T^k w$ for $n=n_0+kh$, a fixed rational matrix $U$ of determinant $\pm1$ and a nonzero rational vector $w$. Both eigencomponents of $w$ are nonzero. The two eigenlines transported by $U$ have finite, irrational slopes, so their second coordinates are nonzero. Diagonalization at the real and $p$-adic places therefore gives, for all sufficiently large $k$, \[ |B_n|\asymp R^k,\quad |B_n|_p\asymp P^k,\quad |\xi-A_n/B_n|\asymp R^{-2k},\quad |\alpha-A_n/B_n|_p\asymp P^{-2k}, \] where $\xi$ is the real slope of the transported expanding eigenline. The two error estimates follow by taking a determinant with the expanding eigenvector and dividing by the second coordinate. The unimodular continuant identity shows that the column $(A_n,B_n)$ generates the unit ideal of $\Z[1/p]$. Multiplication by $\max(|A_n|_p,|B_n|_p)$ thus gives a primitive integral column. Since $A_n/B_n\to\alpha\ne0$ in $\Qp$, this factor eventually equals $|B_n|_p\max(1,|\alpha|_p)$. Consequently $|q_n|\asymp(RP)^k$. Choosing \[ \gamma_\infty=\frac{2\log R}{\log R+\log P},\qquad \gamma_p=\frac{2\log P}{\log R+\log P} \] proves the assertion on each of the finitely many residue classes. \end{proof} \begin{proposition}\label{prop:yas-unit-constants} Let $K$ be a real quadratic field embedded in $\Qp$ such that $\mathcal O_K[1/p]^\times$ contains a unit of norm $-1$. For every $C>0$ the sign algorithm has a fixed point $\alpha\in K$ whose convergents $p_n/q_n$ in lowest terms satisfy \[ \lim_{n\to\infty}q_n^2\,|\alpha_\infty-p_n/q_n|\, |\alpha-p_n/q_n|_p>C. \] Such a field exists for every prime $p$. Even with $K$ and $p$ fixed, the product of the two constants in the upper bounds of Proposition~\ref{prop:yas-rates} is unbounded as the fixed point varies. \end{proposition} \begin{proof} Choose a unit $\theta\in\mathcal O_K[1/p]^\times$ of norm $-1$, changing its sign if necessary so that $\theta_\infty>0$. By Lemma~\ref{lem:yas-unit} there are norm-one units $v$ for which $\alpha=\theta v$ satisfies $1<\lambda:=\alpha_\infty<3/2$ and $M:=|\alpha|_p$ is arbitrarily large. Take $M>1$. Since $\alpha'=-1/\alpha$, the trace $c=\alpha-1/\alpha$ belongs to $\Z[1/p]$, with $0\frac{2M}{5}. \] Since the two exponents in Proposition~\ref{prop:yas-rates} sum to two, the product of the two upper-bound constants is at least this limit. For each $p$ one may take $K=\Q(\sqrt{1+4p^2})$ and take $\theta$ to be the positive root of $X^2-p^{-1}X-1$. The integer $1+4p^2$ lies strictly between $(2p)^2$ and $(2p+1)^2$, and Hensel's lemma at $Y=1$ for $Y^2-Y-p^2$, with $Y=p\theta$, gives an embedding in $\Qp$. The polynomial for $\theta$ shows that it is a unit of norm $-1$ in $\mathcal O_K[1/p]$. \end{proof} Universal eventual periodicity for the sign algorithm at $p=2,3$ remains open. Proposition~\ref{prop:yas-rates} gives the real convergence asserted in \cite[Conjecture~3.1(1),(2)]{YasuSign} whenever the orbit is eventually periodic. \section{Real approximation for Ruban's and Schneider's algorithms}\label{sec:ruban} This section allows $p=2$. In Ruban's algorithm~\cite{Ruban70}, the partial quotient at $x$ is the unique $a\in\mathbb Z[1/p]\cap[0,p)$ such that $x-a\in p\mathbb Z_p$. Capuano, Veneziano and Zannier proved that the Ruban expansion of every quadratic irrational has a finite real limit \cite[Proposition~4.5]{CVZ}. They conjectured that this limit is transcendental whenever the expansion is nonperiodic \cite[Section~4.2]{CVZ}. For Schneider's expansions~\cite{Schneider70} of quadratic $p$-adic units, Pejkovi\'c proved a real error bound of order $n^{-2}$ \cite[Theorem~2.3]{PejSchReal}. As in that argument, a quadratic form controls the lengths of the intervals between consecutive convergents. For Ruban expansions, counting its possible middle coefficients gives the following bound. \begin{theorem}\label{thm:ruban-rate} Let $\alpha\in\mathbb Q_p$ be quadratic over $\mathbb Q$, let $r_n=[a_0;\ldots,a_{n-1}]$, and let $\xi$ be the real limit of its Ruban expansion. For all $n\ge2$, \[ |r_n-\xi|\ll_{\alpha,p} n^{-3}. \] If $\xi$ is a zero of the minimal polynomial of $\alpha$, the bound can be replaced by $O_{\alpha,p}(\theta^n)$ for some $0<\theta<1$. \end{theorem} \begin{proof} Use the indexing of \cite{CVZ}, with $w_0=(1,0)$, $w_1=(a_0,1)$, $w_n=(p_n,q_n)$ and $w_{n+1}=a_n w_n+w_{n-1}$. Thus $r_n=p_n/q_n$, and $|\det(w_n,w_{n-1})|=1$. Put $e_0=\max(0,-v_p(\alpha))$, $e_j=-v_p(a_j)\ge1$ for $j\ge1$, and $s_n=\sum_{j=0}^{n-1}e_j$. If $a_0\ne0$, then $e_0=-v_p(a_0)$. The recurrence gives $v_p(q_n)=e_0-s_n$ for $n\ge1$. It also gives $v_p(p_n)=-s_n$ when $a_0\ne0$. When $a_0=0$ we have $e_0=0$, $p_1=0$, $p_2=1$ and $v_p(p_n)=e_1-s_n$ for $n\ge2$. In either recurrence the term containing the newest digit has strictly smaller valuation once both preceding terms are nonzero. The complete-quotient identity gives \[ v_p(p_n-\alpha q_n)=s_{n+1}-e_0 . \] In its denominator $q_n\alpha_n+q_{n-1}$, the first term dominates because $v_p(\alpha_n)=-e_n$. Let $f(X)=aX^2+bX+c$ be the primitive integral minimal polynomial, $F(X,Y)=aX^2+bXY+cY^2$, $\Delta=b^2-4ac$, and $d=v_p(a(\alpha-\alpha'))=v_p(\Delta)/2$. The discriminant is a nonzero nonsquare integer with a square root $s=a(\alpha-\alpha')$ in $\mathbb Z_p$. Put $U_n=F(w_n)$ and $V_n=F(w_n+w_{n-1})-U_n-U_{n-1}$. Since $r_n\to\alpha$ in $\mathbb Q_p$, we have $v_p(p_n-\alpha' q_n)=e_0-s_n+ v_p(\alpha-\alpha')$ for large $n$. Factoring $F$ gives \begin{equation}\label{eq:ruban-forms} v_p(U_n)=e_n+d,\qquad V_n^2-\Delta=4U_n U_{n-1},\qquad V_{n+1}-V_n=2a_nU_n . \end{equation} The second identity is invariance of the discriminant under the basis $(w_n,w_{n-1})$. The last follows by bilinearity. The numbers $U_n$ belong to $\mathbb Z[1/p]$ and are eventually nonzero integers. For all large $n$, $V_n$ is integral since it is rational and $V_n^2$ is integral. Put $T_n=q_nq_{n-1}$ and $L_n=T_{n+1}-T_n=a_nq_n^2$. The intervals with endpoints $r_n,r_{n+1}$ are nested and have lengths $1/T_{n+1}$. Their endpoints stay bounded, and $|r_n-\xi|\le1/T_{n+1}$. Since $p^{e_n}a_n$ is a positive integer, \begin{equation}\label{eq:ruban-growth} L_n|f(r_n)|=a_n|U_n|\ge p^d \end{equation} for all large $n$. Since $f$ is bounded on these intervals, $T_n\gg n$. If $f(\xi)=0$, then $|f(r_n)|\ll1/T_{n+1}$, so $L_n\gg T_{n+1}$ and $T_n$ grows at least exponentially. Suppose $f(\xi)\ne0$. The $U_n$ eventually have one sign, and the integers $V_n$ are then strictly monotone by \eqref{eq:ruban-forms}. Also $|V_n|\ll T_n$ by bilinearity and boundedness of the $r_n$. In particular, $v_p(V_n^2-\Delta)=v_p(4)+2d+e_n+e_{n-1}$ for large $n$. Fix a dyadic interval $H\le T_n<2H$, $H\ge2$, and put $k=\lfloor(2/3)\log_p H\rfloor$. For indices in this interval with $v_p(V_n^2-\Delta)\le k$, \[ L_n L_{n-1}=a_n a_{n-1} T_n^2 \ge p^{-e_n-e_{n-1}} T_n^2\gg H^{4/3}. \] Their two adjacent increments have sum $\gg H^{2/3}$. Apart from the first and last index in the interval, the total of these sums is at most $2H$, since every increment is counted at most twice. This accounts for $O(H^{1/3})$ indices. For each of the remaining indices, one of $V_n-s,V_n+s$ has valuation at most $v_p(2s)$. The other has valuation at least $k+1-v_p(2s)$. Thus all the integers $V_n$ in question lie in at most two residue classes modulo $p^{k+1-v_p(2s)}$ for $H$ sufficiently large. Each class contributes $O(1+H p^{-k})=O(H^{1/3})$ integers of size $O(H)$. Strict monotonicity counts each at most once. Summing the bound for the dyadic intervals through $T_n$ gives $n\ll T_n^{1/3}$. This proves the theorem. \end{proof} The condition that $\xi$ be a real image of $\alpha$ is equivalent to eventual periodicity. An eventually periodic expansion converges to a real image of $\alpha$ by \cite[Theorem~6.5]{CVZ}. Conversely, suppose $\xi=\sigma(\alpha)$ for a real embedding $\sigma$. For $j\ge1$ the Ruban convergents of $\alpha_j$ have a finite real limit $\xi_j\ge a_j>0$ by \cite[Proposition~4.5]{CVZ}. Put $\xi_0=\xi$. Taking limits gives $\xi_j=a_j+1/\xi_{j+1}$ for $j\ge0$. Thus $\xi_j=\sigma(\alpha_j)$ for every $j$, and $\xi_0>0$ as well. The positivity criterion in \cite[Theorem~6.5]{CVZ} gives eventual periodicity. \begin{proposition}\label{prop:ruban-jumps} With the preceding notation, let $Q_n=p^{s_n}q_n$ be the reduced positive denominator of $r_n$. The following two conditions are equivalent. If they hold, then $\xi$ is transcendental. \[ \limsup_{n\to\infty}\frac{\log Q_{n+1}}{\log Q_n}>1, \qquad \limsup_{n\to\infty}\frac{e_n}{s_n}>0 . \] \end{proposition} \begin{proof} The integers $P_n=p^{s_n}p_n$ and $Q_n$ are coprime. Any common prime divides the determinant of the two scaled consecutive columns, whose absolute value is a power of $p$. If $a_0\ne0$, then $P_n$ is a $p$-adic unit. If $a_0=0$, then $Q_n$ is a $p$-adic unit. The interval bound and $v_p(Q_n)=e_0$ give \[ |P_n-\xi Q_n|\,Q_n\,|P_n-\alpha Q_n|_p\,|Q_n|_p \le Q_n/Q_{n+1}. \] Indeed $v_p(P_n-\alpha Q_n)=s_n+s_{n+1}-e_0$ and $|P_n-\xi Q_n|Q_n\le Q_n^2/(q_nq_{n+1})$. If $\xi$ were algebraic, the $p$-adic Subspace Theorem \cite{SchlickeweiReal}, with the forms $X-\xi Y,Y$ at infinity and $X-\alpha Y,Y$ at $p$, would exclude any fixed power saving in $Q_n$ along infinitely many indices. Indeed the height of $(P_n,Q_n)$ is comparable to $Q_n$, and finitely many rational lines contain only finitely many primitive vectors. Thus the first condition implies transcendence. The integers $Q_n$ increase strictly from index two. Boundedness of the positive digits gives $q_n\ll(p+1)^n$, while the two parity subsequences of $q_n$ are bounded below. Hence $\log Q_n\asymp s_n$. Writing $b_n=p^{e_n}a_n$ gives \[ Q_{n+1}=b_nQ_n+p^{e_n+e_{n-1}}Q_{n-1},\qquad 1\le b_n0$ eventually. Write $1\le b_n0$ such that, for all sufficiently large $n$ and both signs, \[ \left|A_n/B_n-z_\pm\right|\ge c_x(n+2)^{-C_x}. \] In particular, suppose that for one real conjugate $z$ there is a subsequence $n_k\to\infty$ such that $n_k^M|A_{n_k}/B_{n_k}-z|\to0$ for every $M>0$. Then the expansion is eventually periodic. On a nonperiodic orbit for which $A_n/B_n\to z$ for one of the two conjugates, the ratio of successive errors tends to one. \end{theorem} Romeo proved that an eventually periodic expansion converges to a real conjugate and conjectured the converse \cite[Proposition~1 and Conjectures~2 and~17]{RomeoReal}. Explicit nonperiodic Browkin~I examples are known for $p=7,11$ \cite[Theorem~1]{PejBrowkinExamples}, and such examples occur in infinitely many distinct real quadratic fields for every $p\ge7$ \cite[Theorem~1]{PejNonperiodic}. We prove the lower bound by counting the integral quadratic forms visited by the orbit. \begin{lemma}\label{lem:romeo-forms} There are a fixed nonsquare integer $D>0$, a choice $s_0^2=D$ in $\Qp$, and, for all sufficiently large $n$, integers $u_n,v_n$ with $v_n\ne0$ such that the complete quotient $x_n=(u_n+s_0)/v_n$ satisfies \[ u_{n+1}=a_nv_n-u_n,\qquad v_{n+1}=(D-u_{n+1}^2)/v_n,\qquad v_n\mid D-u_n^2 . \] If the orbit is nonperiodic, each pair $(u_n,v_n)$ occurs at most twice and $|u_n|\to\infty$. \end{lemma} \begin{proof} For Browkin~I the recurrences and the periodicity criterion in terms of $u_n$ appear in \cite[(9) and Proposition~4.1]{CMT}. We give an argument that also covers the two alternating algorithms. Start with an integral quadratic form $F_0(X,Y)$ having root $x$ and discriminant $D$. Transport it by $F_{n+1}(X,Y)=-F_n(a_nX+Y,X)$. Its coefficients $h_n,k_n,l_n$ lie in $\Z[1/p]$, its discriminant remains $D$, and its roots are $x_n$ and its field conjugate $x_n'$. All three algorithms have $|a_j|_p\ge1$ for $j\ge1$, $|a_1|_p>1$, and $|a_ja_{j+1}|_p>1$ for $j\ge1$. The truncations also give $|x_j|_p=|a_j|_p$ for $j\ge1$. Thus the continuant recurrence gives $|B_j|_p=\prod_{i=1}^j|a_i|_p$ by strict ultrametric dominance. In particular $|B_j|_p\to\infty$. The complete-quotient identity gives $|x-A_j/B_j|_p=(|B_j|_p^2|x_{j+1}|_p)^{-1}$ for $j\ge1$, so the convergents tend to $x$ in $\Qp$. Inverting the prefix at $x'$ gives \[ x'_n=-\frac{A_{n-2}-x'B_{n-2}}{A_{n-1}-x'B_{n-1}}. \] Since $A_j/B_j\to x\ne x'$ in $\Qp$, for all large $n$ this shows $|x'_n|_p=|a_{n-1}|_p^{-1}\le1$ and $|x'_n|_p<|x_n|_p$. Consequently $|x_n-x'_n|_p=|x_n|_p\ge1$. The discriminant identity gives $|h_n|_p=|s_0|_p/|x_n|_p$. The sum and product of the roots then give $|k_n|_p,|l_n|_p\le |s_0|_p\le1$. Thus all three coefficients are integers from this point on. Set $u_n=-k_n$ and $v_n=2h_n$, choosing the sign of $s_0$ so that $x_n=(u_n+s_0)/v_n$ at the first index under consideration. Indeed $u_{n+1}=a_nv_n-u_n$ and $v_nv_{n+1}=D-u_{n+1}^2$ by the transformation of forms. Thus $1/(x_n-a_n)=(u_{n+1}+s_0)/v_{n+1}$, which preserves the choice of $s_0$, while $D-u_n^2=-4h_nl_n$ gives the divisibility. A repeated triple $(u_n,v_n,n\bmod2)$ gives the same complete quotient at the same phase and hence an eventual period. For a fixed $u$ the integer $v$ is a signed divisor of $D-u^2\ne0$. This proves the final assertions. \end{proof} \begin{proposition}\label{prop:romeo-series} Suppose the orbit is nonperiodic, and label $z_+,z_-$ so that $s_0$ has real images $\sqrt D,-\sqrt D$, respectively. With $q_n=A_n/B_n$ and $R_n=(q_n-z_+)/(q_n-z_-)$, there is $N$ such that $R_n$ has constant sign for $n\ge N$ and \[ \log|R_n|+2\sqrt D\sum_{j=N}^{n+1}u_j^{-1} \quad\hbox{has a finite limit.} \] Thus $q_n$ tends to $z_+$ or $z_-$ precisely when the partial sums of the displayed series tend to $+\infty$ or $-\infty$, respectively. The convergents have a projective real limit precisely when these sums have a limit in $[-\infty,+\infty]$. In the finite-sum case the limit differs from both conjugates and is finite unless $R_n\to1$. \end{proposition} \begin{proof} Write the finite-tail identity at the two real embeddings as $(A_n-z_\pm B_n)x_{n+1}^\pm=-(A_{n-1}-z_\pm B_{n-1})$. Division yields, for all sufficiently large $n$, \[ \frac{R_n}{R_{n-1}}=\frac{u_{n+1}-\sqrt D}{u_{n+1}+\sqrt D}. \] The factors are eventually positive. The number of indices for any fixed $u$ is at most $4\tau(|u^2-D|)$, with $\tau$ the divisor function. As $\tau(m)\le2\sqrt m$, we have $\sum_{j\ge N}|u_j|^{-3}<\infty$. The assertion follows on summing $\log|(u-\sqrt D)/(u+\sqrt D)|=-2\sqrt D/u+O_D(|u|^{-3})$ and inverting the fractional linear map $q\mapsto(q-z_+)/(q-z_-)$. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:romeo-rate}] Write $A=\max(1,\sup_j|a_j|)$, which is finite for each algorithm. We show that \begin{equation}\label{eq:romeo-cancel} \left|\sum_{j=N}^{n+1}\frac1{u_j}\right|\ll_{D,A}\log(n+2) \end{equation} after increasing $N$ so that $u_j^2>2D$ throughout the tail. Let $\theta=1/(4(A+1))$. Mark the edge $(j,j+1)$ if $|v_j|\le\theta\min(|u_j|,|u_{j+1}|)$. No two marked edges share a vertex, since $|v_{j-1}v_j|=u_j^2-D>u_j^2/2$. At a marked edge the recurrence gives $|u_j+u_{j+1}|\le A|v_j|$ and $|u_j|\le(1+A\theta)|u_{j+1}|$. Therefore \[ \left|\frac1{u_j}+\frac1{u_{j+1}}\right| \le A(1+A\theta)\frac{|v_j|}{u_j^2}. \] At a vertex $j$ belonging to no marked edge both $|v_{j-1}|$ and $|v_j|$ exceed $\theta |u_j|/2$. Indeed a smaller $|v_j|$ would give $|u_{j+1}|\ge(1-A\theta/2)|u_j|\ge|u_j|/2$ and mark the right edge. The same argument with $u_{j-1}=a_{j-1}v_{j-1}-u_j$ marks the left edge if $|v_{j-1}|$ is too small. The product formula then gives $|v_j|\asymp_A |u_j|$ at every unmatched vertex. Let $\rho(d)=\#\{r\bmod d:r^2\equiv D\pmod d\}$. We recall the estimate $\sum_{d\le X}\rho(d)\ll_D X$ from the divisor problem for quadratic polynomials \cite[Lemma~2]{HooleyQuad}. To see it directly, let $\chi$ be the nonprincipal quadratic character of $\mathbb Q(\sqrt D)$. For $\gcd(d,2D)=1$, $\rho(d)\le(1*\chi)(d)$ by the prime-power formulas. The nonnegative function $1*\chi$ has partial sums $O_D(X)$, since $\sum_{b\le X}\chi(b)\lfloor X/b\rfloor =X\sum_{b\le X}\chi(b)/b+O(X)$, and $\chi$ has bounded partial sums. At each prime $l\mid 2D$ the numbers $\rho(l^k)$ are bounded in $k$. For $k>v_l(D)$ the valuation of a root is forced to be $v_l(D)/2$ whenever a root exists. After dividing out this fixed power, the unit congruence has at most two roots for odd $l$, or four for $l=2$. The sum of the reciprocals of integers supported on the finitely many primes dividing $2D$ is finite. Multiplicativity now gives the estimate. For $H\le |u_j|<2H$ count visits by the state $(u_j,v_j)$, whose multiplicity is at most two. For fixed $d=|v_j|$ there are $O(\rho(d)(H/d+1))$ such visits. At unmatched vertices $d\asymp_A H$, so there are $O_{D,A}(H)$ of them and their absolute contribution to \eqref{eq:romeo-cancel} is $O_{D,A}(1)$ per dyadic range. At marked edges with $H\le|u_j|<2H$ the sum of the absolute values of the paired contributions is at most a constant times \[ \frac1{H^2}\sum_{d\le 2\theta H}d\,\rho(d)(H/d+1) \ll_{D,A}1 . \] A finite interval cuts at most two marked edges, giving bounded endpoint contributions. Sum over the $O(\log(n+2))$ dyadic ranges with $H\le n+2$. In the remaining ranges each singleton or pair contributes $O_A(1/(n+2))$, and there are at most $n+2$ terms. This proves \eqref{eq:romeo-cancel}. Proposition~\ref{prop:romeo-series} now gives $|\log|R_n||\ll_x \log(n+2)$. Since $q_n-z_+=(z_+-z_-)R_n/(1-R_n)$ and $q_n-z_-=(z_+-z_-)/(1-R_n)$, this gives the claimed lower bounds after increasing the constant. When $q_n\to z_+$, the quotient of successive errors tends to one by the recurrence for $R_n$ and $q_n-z_-\to z_+-z_-$. Interchanging the roots gives the other case. For an eventually periodic word, let $H$ be the period matrix after a prefix, doubling the period if necessary to make its determinant one. Its two real fixed points are the two irrational conjugates of the complete quotient, unless $H$ is scalar. The scalar case would make all convergents along a residue class of the period equal to one rational projective point, contrary to their $p$-adic convergence to the irrational input. Thus $H$ has distinct real eigenlines and, since $\det H=1$, distinct eigenvalue moduli. The powers of $H$ send every rational line exponentially to the attracting eigenline, as the repelling line is irrational. This applies to each of the finitely many positions in a period. Reinserting a rational prefix preserves the rate at these irrational real points. \end{proof} The same count gives a lower bound for the sum of the absolute values of the digits. For every real quadratic orbit of any of the three algorithms there is a constant $C_x$ such that \[ \sum_{j=1}^n|a_j|\ge\log(n+1)-C_x \qquad(n\ge1). \] On a periodic tail this sum grows linearly. Otherwise put $s_n=\sum_{i=0}^{n-1}|a_i|$. In Euclidean operator norm, $\|M(a)\|=\exp(\operatorname{arsinh}(|a|/2))\le e^{|a|/2}$. The leading coefficient of the transported form $F_j$ in Lemma~\ref{lem:romeo-forms} is, up to sign, the value of $F_0$ at the first column of $M(a_0)\cdots M(a_{j-1})$. Hence $|v_j|\le H=C e^{s_n}$ for $j\le n$, with $C\ge1$ depending only on $F_0$. For a sufficiently large $j\le n$ put $d=|v_j|$. Then $u_j^2\equiv D\pmod d$ and $|u_j|\le\sqrt{D+Hd}$, since $D-u_j^2=v_jv_{j-1}$. Each pair $(u_j,v_j)$ occurs at most twice. Counting the $\rho(d)$ residue classes and summing over $d$ gives \[ n\ll_x 1+\sum_{d\le H}\rho(d)(1+\sqrt{H/d})\ll_x H . \] The last bound follows by partial summation from $\sum_{d\le t}\rho(d)\ll_D t$. Taking logarithms proves the assertion. \begin{corollary}\label{cor:romeo-sign} If the digits of a real quadratic orbit of any of the three algorithms eventually have one sign, its convergents have a projective real limit, with error $O(n^{-3})$ in projective distance. In the nonperiodic case this limit differs from both real conjugates. If all digits from $a_1$ on have one sign, the limit is finite. \end{corollary} \begin{proof} Choose $N\ge1$ so that $a_{N+j}$ has a fixed sign $\sigma$ for $j\ge0$. The positive continued fraction with digits $c_j=|a_{N+j}|$ has quadratic $p$-adic value $\sigma x_N$. Its consecutive real convergents determine nested intervals in $[c_0,c_0+1/c_1]$. Since $|x_{N+j}|_p=|c_j|_p\ge1$ and $|c_jc_{j+1}|_p>1$, the valuation computation in Theorem~\ref{thm:ruban-rate} applies with $e_j=-v_p(c_j)\ge0$. In its notation, \eqref{eq:ruban-growth} gives $T_{j+1}-T_j\gg1$, since $f$ is bounded on the displayed interval. Thus the interval lengths $1/T_{j+1}$ tend to zero. The rest of the proof of Theorem~\ref{thm:ruban-rate} gives $1/T_{j+1}=O(j^{-3})$. Restoring the sign gives a finite real limit $\eta$ for the original tail, with $|\eta|\ge c_0>0$. The fixed prefix is Lipschitz in angular distance on the real projective line. Its image of $\eta$ is finite unless $B_{N-1}\eta+B_{N-2}=0$. For $N=1$ this denominator is $\eta$. For a nonperiodic orbit $|u_n|\to\infty$ and the recurrence for $v_{n+1}$ shows that $v_n$ eventually alternates in sign. As in the proof of \cite[Proposition~26]{BMU} for Browkin~I, $g_n=(-1)^nu_n$ has increments $(-1)^{n+1}a_nv_n$ of constant sign. It is eventually monotone, of constant sign, and $|g_n|\to\infty$. The alternating-series test gives convergence of $\sum 1/u_n=\sum(-1)^n/g_n$. Proposition~\ref{prop:romeo-series} now excludes both conjugates. \end{proof} \begin{corollary}\label{cor:romeo-large-digits} Write $e_n=-v_p(a_n)$, and fix $\epsilon>0$. Along every nonperiodic real quadratic orbit of the three algorithms, \[ |\log|R_n||\ll_{x,\epsilon} 1+\sum_{j=N}^{n+1}p^{-(e_j+e_{j-1})/(1+\epsilon)}. \] If the series on the right converges, the convergents have a projective real limit distinct from both conjugates. A sufficient digit condition is $e_j+e_{j-1}\ge(1+\delta)\log_p j$ eventually for some $\delta>0$. \end{corollary} \begin{proof} For the fixed $p$-adic root $s_0$ of $D$ and all integers $m$, \[ p^{v_p(m^2-D)}\ll_{D,p,\epsilon} (1+|m|)^{1+\epsilon}. \] Indeed the two-place Subspace Theorem \cite{SchlickeweiReal}, applied to $(m,1)$ with forms $X,Y$ at infinity and $X-s_0Y,Y$ at $p$, bounds $|m-s_0|_p$ below by a constant times $(1+|m|)^{-1-\epsilon}$. Each exceptional rational line contains at most one $(m,1)$, and $s_0$ is irrational. Applying the bound also to $-s_0$ and using $\min\{v_p(m-s_0),v_p(m+s_0)\}\le v_p(2s_0)$ gives the displayed estimate. In Lemma~\ref{lem:romeo-forms}, $v_p(v_j)=v_p(2s_0)+e_j$ eventually, since $|x_j-x'_j|_p=p^{e_j}$. Substituting $m=u_j$ in the preceding estimate and using $D-u_j^2=v_jv_{j-1}$ gives $|u_j|^{-1}\ll_{x,\epsilon}p^{-(e_j+e_{j-1})/(1+\epsilon)}$ for large $j$. Proposition~\ref{prop:romeo-series} proves the claims, taking $0<\epsilon<\delta$ in the last assertion. \end{proof} \section{Almost-sure real convergence}\label{sec:romeo-metric} Romeo \cite[Conjecture~4]{RomeoReal} asks whether $|B_n|$ tends to infinity with probability one for the three algorithms when $p\ge5$. We use additive Haar measure on $\Qp$. The quadratic inputs considered in \cite[Assumption~3]{RomeoReal} form a countable set of Haar measure zero. \begin{theorem}\label{thm:romeo-haar} For each odd prime $p$ and each of Browkin~I, Browkin~II and the alternating algorithm of Murru and Romeo \cite[Algorithm~(5)]{MR24}, there is a constant $\lambda>0$ such that, for Haar-almost every $x\in\Qp$, the convergents $q_n=A_n/B_n$ have a finite transcendental real limit $L$ and \[ \lim_{n\to\infty}\frac{\log|B_n|}{n}=\lambda,\qquad \lim_{n\to\infty}\frac{\log|q_n-L|}{n}=-2\lambda. \] The irrationality exponent of $L$ is finite. \end{theorem} For $k\ge0$, let $S_k$ be the set of $m/p^k$ with $m\in\Z$, $p\nmid m$ and $|m|1$ gives $1/(v+z)\in p\Zp$, and the preceding digit is $u$. The Browkin~I branches $y\mapsto1/y-u$ are fractional linear maps of the type considered by Rao and Yasutomi \cite{RaoYasutomi}. The cylinder argument of Choudhuri and Makadiya \cite{ChoudhuriMakadiya} for Ruban's representatives (Lemmas~13 and~15 of the preprint) also applies to balanced representatives. For Murru--Romeo, $|v|_p\ge1$ gives $1/(v+z)\in\Zp$, so the preceding odd truncation is $u\in T$. In Browkin~II the next even quotient is a unit. If the odd truncation $b\in T$ is uncorrected, its remainder $1/(v+z)$ is a unit and every $v\in S_0$ is possible. If it is corrected, the odd digit is $u=b-\sgn b$, and its remainder is congruent to $\sgn b$ modulo $p$. Thus $v=\sgn b$. Conversely, with this value of $v$ we have $u+1/(v+z)\in b+p\Zp$, which activates the correction. These conditions exhaust the possibilities. Indeed, an odd complete quotient has norm greater than one. Its remainder belongs to $p\Zp$ in Browkin~I, to $\Zp^\times$ in Browkin~II and to $\Zp$ in Murru--Romeo. On each branch $|v+z|_p=|v|_p\ge1$ and $|u+1/(v+z)|_p=|u|_p>1$. Inversion sends a ball $c+r\Zp$ with $|r|_p<|c|_p$ onto $c^{-1}+(r/c^2)\Zp$ and scales distances by $|c|_p^{-2}$. Each branch therefore maps $p\Zp$ onto a ball with relative Haar measure $|u|_p^{-2}|v|_p^{-2}$. Conditional on this branch, the new remainder $y_{j+1}$ is again uniform on $p\Zp$. The branch balls are disjoint and cover $p\Zp$ up to the countable set of terminating inputs. Since $y_0$ is uniform on $p\Zp$, iteration gives the asserted pair law. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:romeo-haar}] Fix the initial coset. Write $G_j=M(a_{2j-1})M(a_{2j})$ for $j\ge1$. These matrices are independent and identically distributed in $\mathrm{SL}_2(\mathbb R)$. All digit matrices and their inverses have uniformly bounded real norm, since the digits lie in a bounded real interval. In particular, the law $\mu$ of $G_j$ has a finite exponential moment. Put $h=1/p$ and take $e=h$ for Browkin~I and $e=1$ for the other two algorithms. By Lemma~\ref{lem:romeo-words}, the support contains $Q_+=M(h)M(e)$ and $Q_-=M(-h)M(e)$. The trace of $Q_+$ is $2+he>2$. A finite invariant set on $\mathbb P^1(\mathbb R)$ would be invariant under the group generated by the support. The translation \[ Q_+Q_-^{-1}=\begin{pmatrix}1&2h\\0&1\end{pmatrix} \] would force it to lie in $\{\infty\}$, whereas $Q_+\infty=h+1/e$ is finite. The semigroup is therefore strongly irreducible and contains a proximal element. Its top Lyapunov exponent $\gamma$ is positive by Furstenberg's theorem \cite[Theorem~8.6]{FurstenbergReal}. Put $H_m=G_1\cdots G_m$ and equip the projective line with the distance \[ d([v],[w])=\frac{|\det(v,w)|}{\|v\|\,\|w\|}. \] For every $\epsilon>0$ there are $c,C>0$ such that, uniformly in nonzero rows $f$ and columns $v$, \[ \mathbb P\left(\left|\log\frac{|fH_mv|}{\|f\|\,\|v\|}-m\gamma\right| >m\epsilon\right)\le C e^{-cm}, \qquad \log 0=-\infty. \] Indeed, the logarithm of the coefficient ratio equals $\log(\|H_mv\|/\|v\|)+\log d(H_m[v],\ker f)$. The two bounds of \cite[Proposition~2.1]{DKWReal} apply with $\epsilon/2$. Reversing the order of an iid sample preserves its law. Put $w=(1,0)^{\mathsf T}$. Apply the estimate with $v=w$ and with $v=M(a_{2m+1})w$. The latter vector is independent of $H_m$ and has norm between $1$ and a fixed constant. Applying Borel--Cantelli with $\epsilon=1/k$, $k\ge1$, shows that for each fixed $f\ne0$, almost surely \[ \lim_{n\to\infty}\frac1n\log|fM(a_1)\cdots M(a_n)w| =\lambda,\qquad \lambda=\frac{\gamma}{2}. \] Taking $f=(0,1)M(a_0)=(1,0)$ gives the assertion for $B_n$. Almost surely all sufficiently late denominators are nonzero, and \[ |q_n-q_{n-1}|=|B_nB_{n-1}|^{-1}=\exp(-2\lambda n+o(n)). \] Summation gives a finite limit $L$ and $\limsup_{n\to\infty}n^{-1}\log|q_n-L|\le-2\lambda$. With $f=(0,1)$ the same argument gives, simultaneously for all $j\ge0$, a real limit $Z_{2j+1}$ of the tail beginning at $a_{2j+1}$. These limits have a common law $\nu$. The identity $Z_1=G_1Z_3$ and the independence of $Z_3$ from $G_1$ make $\nu$ the stationary measure of $\mu$. By \cite[Proposition~2.2]{DKWReal}, there are $C,\delta>0$ such that $\nu\{z:d(z,t)2/\delta$. For each $b\ge1$ there are $O_K(b)$ integers $a$ with $|a/b|\le K+1$. Since $\sum_{b\ge1} b^{1-\tau\delta}<\infty$, Borel--Cantelli gives probability zero to the event that $|L|\le K$ and $|L-a/b|R\}+\nu\{|z|1. \] In particular, $D_n|L-q_n|\to\infty$ almost surely. \end{corollary} \begin{proof} Write $k_j=-v_p(a_j)$ for $j\ge1$. Every odd digit has $\mathbb P(k_j=k)=(p-1)p^{-k}$ for $k\ge1$, by Lemma~\ref{lem:romeo-words}. At even indices Browkin~I has the same law, Browkin~II has $k_j=0$, and Murru--Romeo has $\mathbb P(k_j=k)=(p-1)p^{-k-1}$ for $k\ge0$. Thus $\kappa$ is half the mean of $k_1+k_2$. The value $p/(p-1)$ also occurs for Ruban's representatives over $\Qp$ in Choudhuri and Makadiya \cite{ChoudhuriMakadiya}, Proposition~23 of the preprint. The strong law for the independent digit pairs and Borel--Cantelli for their geometric tails give $n^{-1}\sum_{j=1}^n k_j\to\kappa$ and $k_{n+1}/n\to0$ almost surely. The continuant recurrence gives $|B_n|_p=p^{\sum_{j=1}^n k_j}$, since $|a_ja_{j+1}|_p>1$. The determinant identity implies that $A_n$ and $B_n$ have no common prime factor different from $p$ in $\Z[1/p]$. Hence \[ D_n=|B_n|\,|B_n|_p\max(1,|q_n|_p). \] The last factor is bounded since $q_n\to x$ in $\Qp$. Moreover $|x-q_n|_p=(|B_n|_p^2|\alpha_{n+1}|_p)^{-1}$ and $|\alpha_{n+1}|_p=p^{k_{n+1}}$. These identities and Theorem~\ref{thm:romeo-haar} give the three limits. It remains to show $\lambda<\kappa\log p$. For Browkin~I the absolute values of the entries of each $M(a_j)$ are bounded by the corresponding entries of $M(p/2)$, whose spectral radius is less than $p$. For the other two algorithms the absolute values of the entries of each digit-pair matrix are bounded by those of $M(U)M(V)$, with $(U,V)=(1,(p-1)/2)$ for Browkin~II and $(U,V)=(1/2,p/2)$ for Murru--Romeo. Both comparison matrices have determinant one and trace $2+UV0 . \] Every cubic field contained in $\mathbb Q_p$ has such a generator by \cite[Proposition~2.3]{STY}. For a $\mathbb Q$-basis $1,x,y$ of $K$, set $m_y=v(y)$ and $j=\max(m_y-v(x),0)$. First take $p^jx/y$ and $p^{m_y}/y$ and subtract from each its digit of degree zero. Both resulting elements belong to $p\mathbb Z_p$. Write them in the basis $z^2,z,1$ and reduce their first two columns by row operations in $\mathrm{GL}_2(R)$ as in \cite[Sect.~4.4]{STY}. Apply the same operations to the constant column. Finally subtract $\langle c_0\rangle_p$ from each coordinate with rational constant $c_0$. Denote this map by $T$. If $G_2(\alpha)$ is the vector after inversion and subtraction of the digits of degree zero, then our translation is $\gamma'(G_2(\alpha))$ in the notation of \cite[Sect.~4.4]{STY}. We take the sign in the inversion to be $+1$. An initial basis may be any basis in $K$. After one step the two coordinates belong to $p\mathbb Z_p$. We use periodicity in the sense of \cite[Sect.~3]{STY}, namely equality of two remainders at distinct indices. \begin{theorem}\label{thm:sty-cubic} For every prime $p$, every cubic generator $z$ satisfying Condition H and every basis $1,x,y$ of $\mathbb Q(z)$, the sequence $T^n(x,y)$ is eventually periodic. \end{theorem} \begin{proof} We show that only finitely many reduced coefficient matrices occur along each orbit. After one step the pair has the form \[ x=p^d z^2+u z+C,\qquad y=p^e z+D, \] where $d,e\in\mathbb Z$, $u$ contains only digits of degree less than $e$, and $C,D\in\mathcal D$. Indeed, multiplication by the pivot $y$ sends $1,x/y,1/y$ to the basis $y,x,1$. Scaling the inverted coordinates by nonzero rationals, adding rational constants and performing invertible row operations preserve independence with $1$. Thus both diagonal pivots are nonzero. Since $x,y\in p\mathbb Z_p$, the constants are $C=[-p^d z^2-uz]_p$ and $D=[-p^e z]_p$. Write $y=p^e(z+t)$. If $e+k>0$, then $D=t=0$. Otherwise $v(D)=e+k$ and $v(t)=k$. In both cases $v(z+t)=v(y)-e$. Since $f(z)=0$, we have \[ \frac{1}{z+t}= -\frac{z^2+(a-t)z+b-at+t^2}{f(-t)} . \] The numerator evaluated at $z$ is a $p$-adic unit, whence $v(f(-t))=v(z+t)$. Put $P(X)=p^dX^2+uX+C$, $r=P(-t)$ and $j=\max(v(y)-v(x),0)$. The rows of nonconstant coefficients after inversion generate over $R$ a lattice with basis \begin{equation}\label{eq:sty-lattice} V=(1,a-t),\qquad \rho V+p^h(0,1),\qquad h=d+j-e,\quad v(\rho)=v(r)+j-v(y). \end{equation} Indeed the row from $p^{v(y)}/y$ is $-p^{v(y)-e}V/f(-t)$, a unit multiple of $V$. Division of $P(X)$ by $X+t$ gives the other row with $\rho=-p^{j-e}r/f(-t)$. Write $d',e',u'$ for the next reduced entries. The first column and the determinant give \[ d'=\min(0,v(\rho)),\qquad e'=h-d'. \] If $d'=0$, subtract the term $\rho V$ in \eqref{eq:sty-lattice}. It follows that $u'$ is the representative of $a-t$ modulo $p^{e'}R$ with digits of degree less than $e'$. In particular $u'\in R$. After two steps every lattice under consideration has a primitive vector $(1,A)$ with $A\in R$, by \eqref{eq:sty-lattice}. Here primitive means that it is a member of an $R$-basis of the lattice. In particular $d\le0$ from the second step onward. For a reduced matrix with rows $(p^d,u),(0,p^e)$, put \[ m=\min(d,e,v(u)),\qquad B=d+e-2m . \] The minimum valuation amongst all entries and the determinant valuation are unchanged by invertible row operations over $R$. Hence $m$ and $B$ can be read from any basis of the lattice. Suppose first that $e\ge0$, so $t=0$ and $v(y)=e+k$. We have $v(C)\ge m+k$ and $v(x)\ge m+k$. Indeed $p^d z^2+uz$ has valuation at least $m+k$. If its valuation is positive then $C=0$. Otherwise its valuation equals $v(C)$ and $v(x)\ge1$. Consequently $j\le e-m$, and both $v(\rho)$ and $h$ are at least $m+j-e$. Equation~\eqref{eq:sty-lattice} now gives $m'\ge m+j-e$ and \[ B'=h-2m'\le B-j . \] Suppose next that $e<0$ and $d<0$, at a step where the primitive vector $(1,A)$ is available. Its basis coefficients in the reduced rows are $p^{-d}$ and $(A-p^{-d}u)/p^e$. The first is in $pR$, so the second is a unit. Since $A\in R$ and $e<0$, this implies $v(u)=d+e$. Now \[ x-r=(z+t)\{p^d(z-t)+u\},\qquad v(x-r)=v(y)+d . \] To see the last equality, use $v(z-t)\ge k$ and $v(u)=d+e0$. By the primitive vector at the next step, $p^{-d'}u'\in R$, since its difference from an element of $R$ belongs to $p^{e'}R$. Thus $m'=d'$ and again $B'=B-j$. It follows that an orbit with $d<0$ at every step from the second onward has bounded $B$. Here $m\le d<0$. If $e\ge0$, then $B=(d-m)+(e-m)\ge-m$. If $e<0$, we found that $v(u)=d+e$, so $m=d+e$ and $B=-m$. Thus both $d$ and $e$ lie between $m\ge-B$ and $m+B\le B$. All nonzero digits of $u$ have degrees between $m$ and $e-1$. This gives finitely many possible reduced matrices, and the rational constants are uniquely determined. The orbit is eventually periodic. It remains to consider an orbit reaching $d=0$ from the second step onward. We have shown that $u\in R$, so $C=0$. For $e\ge0$ one has $t=0$ and $r=0$. For $e<0$ the digit condition gives $u=0$, so $x=z^2$ and $r=t^2$. Since $v(t)\ge k$, we have $v(r)\ge2k=v(x)$, including $t=0$. In either case \eqref{eq:sty-lattice} gives $d'=0$, so $d$ stays zero. For $e\ge0$ the recurrence is \[ e'=-\min(e,v(z+u))\le0. \] For $e=-s<0$ it gives $e'=s+\max(v(y)-2k,0)>0$ and $u'\equiv a-t\pmod {p^{e'}R}$. At the following step, \[ |e''|=\min(e',v(z+a-t)). \] Set $L=v(2z+a)$, a finite nonnegative integer. If $s\ge L$, then $v(z+t)=s+v(y)>L$, so $v(z+a-t)=L$. There are only finitely many positive $s0 . \] Write $G_{s,\varepsilon}(\alpha)$ for the last-coordinate inversion with sign $\varepsilon\in\{-1,1\}$ followed by subtraction of the digits of degree zero, and put $G_s=G_{s,1}$. In formula~(4) of \cite[Sect.~4.4]{STY} the row operation is computed from $G_s(\alpha)$ for either sign and the translation is evaluated on $\alpha$. If $A_\alpha$ is the matrix of the nonconstant coefficients in the ordered basis $z^s,\ldots,z,1$ and $C_\alpha$ is the column of constants, write $U_\alpha\in\mathrm{GL}_s(R)$ for the row operation reducing $A_\alpha$. Then $\gamma'(\alpha)=-\langle U_\alpha C_\alpha\rangle_p$, with the brackets taken coordinatewise. The resulting map is \[ T_{0,\varepsilon}(\alpha) =U_{G_s(\alpha)}G_{s,\varepsilon}(\alpha)+\gamma'(\alpha). \] \begin{proposition}\label{prop:sty-literal} Let $\ell>p$ be a prime at which the coefficients of the monic minimal polynomial of $z$ are integral, and put $S=\mathbb Q\cap\mathbb Z_\ell$. Write $\alpha=A(z^s,\ldots,z)^t+C$, where $A\in\mathrm{GL}_s(S)$ has last row $(0,\ldots,0,q)$ and $C=(C_1,\ldots,C_s)^t\in\mathbb Q^s$. Suppose $|C_i|_\ell\le M=|C_s|_\ell>1$ for all $i$, with $|\ell|_\ell=1/\ell$. After $n$ steps of $T_{0,\varepsilon}$, the rational constant in the last coordinate has $\ell$-adic absolute value $M^{2^n}$, even if the signs vary from step to step. In particular the expansion for either fixed sign is not eventually periodic. \end{proposition} \begin{proof} Every invertible $p$-reduced matrix has diagonal entries which are powers of $p$ and entries above the diagonal in $\mathbb Z[1/p]$. It therefore belongs to $\mathrm{GL}_s(S)$. The nonconstant matrix of $G_{s,\varepsilon}(\alpha)$ is $\varepsilon$ times that of $G_s(\alpha)$. Thus after one step the nonconstant matrix is $\varepsilon H$ with $H$ $p$-reduced. The translation changes only the constants. The current nonconstant matrix $A$ therefore lies in $\mathrm{GL}_s(S)$ at every step, including the first by hypothesis. Its row operation $U_\alpha=(U_\alpha A)A^{-1}$ also lies in $\mathrm{GL}_s(S)$. At the current step write $y=\alpha_s=qz+D$, where $D=C_s$ and $q$ is an $\ell$-adic unit. This holds initially because $A$ has the stated last row and unit determinant over $S$. At each later step $q=\pm p^e$ for some integer $e$. Assume that $|C_i|_\ell\le M=|D|_\ell>1$ for all $i$. The inverted coordinates before row reduction are $g_i=a_i\alpha_i/y-\delta_i$ for $ip$, the first value is an $\ell$-adic unit and the others are integral at $\ell$. The functional $\lambda(w)=\mu(yw)$ satisfies $\lambda(1)=1$ and $\lambda(g_i)=0$ for every $i$. From $\alpha=A(z^s,\ldots,z)^t+(C_1,\ldots,C_s)^t$ and the integrality of $A^{-1}$ we obtain $|\mu(z^j)|_\ell\le M$ for $1\le j\le s$. The minimal polynomial gives this bound also for $j=s+1$. Moreover $q\mu(z)=1-D\mu(1)$ gives $|\mu(z)|_\ell=M$. Consequently \[ |\lambda(z^j)|_\ell =|q\mu(z^{j+1})+D\mu(z^j)|_\ell\le M^2 \quad(1\le j\le s),\qquad |\lambda(z)|_\ell=M^2 . \] After the row operations all inverted coordinates are still annihilated by $\lambda$. Thus their new constants are the entries of $-A'(\lambda(z^s),\ldots,\lambda(z))^t$, where $A'=\varepsilon H$ is the new nonconstant matrix. They have absolute value at most $M^2$, and the last has absolute value exactly $M^2$ because the only nonzero entry in the last row of $A'$ is an $\ell$-adic unit. All entries of $U_\alpha C$ have absolute value at most $M$. Since the truncation $[c_0]_p$ of a rational number belongs to $\mathbb Z[1/p]$, the entries of the input translation $-\langle U_\alpha C\rangle_p$ also have absolute value at most $M$. Thus the new constants satisfy the same inequalities with $M^2$ in place of $M$, independently of the sign at this step. Induction proves the formula and shows that no two remainders are equal. For either fixed sign, the branch data also fail to be eventually periodic. Indeed, from the first iterate onward the current nonconstant matrix is a $p$-reduced matrix multiplied by $\varepsilon$, so $U_\alpha=\varepsilon I$. The last entry of $\gamma'(\alpha)$ then has absolute value $|D|_\ell$. \end{proof} \begin{corollary}\label{cor:sty-dense-higher} For each prime $\ell$ as in Proposition~\ref{prop:sty-literal}, there is a dense set of $\alpha\in\mathbb Q_p^s$ with $1,\alpha_1,\ldots,\alpha_s$ a $\mathbb Q$-basis of $K$ for which $T(\alpha)=(z^s,\ldots,z)$ is fixed by $T$. For the same $\alpha$ and either sign $\varepsilon$, the rational constant in the last coordinate of $T_{0,\varepsilon}^n(\alpha)$ has $\ell$-adic absolute value $\ell^{2^n}$ for every $n\ge0$. \end{corollary} \begin{proof} If the nonconstant coefficient matrix of $G_s(\alpha)$ belongs to $\mathrm{GL}_s(R)$, its $p$-reduced form is the identity. Each output coordinate of $T$ lies in $p\mathbb Z_p$ and its nonconstant part is a positive power of $z$. Its normalized constant must therefore be zero. This gives $T(\alpha)=(z^s,\ldots,z)$. For the power basis the nonpivot ratios are $z^{s-1},\ldots,z$, and \[ p^k/z=-(z^s+a_1z^{s-1}+\cdots+a_s)/c \] has integral coefficients at $p$ with leading coefficient a unit. The matrix is thus unimodular and the power basis is fixed. This unimodular-matrix argument for a family with last coordinate $z$ appears in the proof of \cite[Theorem~6.2]{STY}. Take a target $(x_1,\ldots,x_s)$ with all coordinates nonzero. Choose $q\in1+\ell\mathbb Z[1/p]$ so that $qz$ is arbitrarily close to $x_s$ and has the same valuation. For $i0$, the line in Theorem~\ref{thm:jp} contains a set of Hausdorff dimension greater than $1/2$ consisting of points whose Jacobi--Perron expansions are infinite and not eventually periodic. The $p$-adic absolute values of their partial quotients are bounded in terms of $p$ and $\varepsilon$. For either coordinate $x$ of every point in this set, \[ |x-r|_p\gg_{p,\varepsilon}H(r)^{-2-\varepsilon} \qquad(r\in\Q). \] In particular, both irrationality exponents are at most $2+\varepsilon$. \end{proposition} \begin{proof} For $k\ge1$, replace $p^{-k}$ in the digit formulas by $jp^{-k}$, where $1\le j2p^{5/2}/(p-1)$, taking the least possible values. Restrict to $k_0\le k\le K$. Since \[ \sum_{k=k_0}^K N_k r_k^{1/2} =\frac{(K-k_0+1)(p-1)}{2p^{5/2}}>1, \] there is a unique $s>1/2$ with $\sum_{k=k_0}^K N_kr_k^s=1$. Assign probability $r_k^s$ to each symbol $(k,j)$ independently at every position. The induced measure on the set of infinite expansions gives mass $R^s$ to each cylinder of ratio $R$. Let $\delta>0$ be the minimum distance between distinct first images, which are finitely many disjoint compact sets. In a cylinder of ratio $R$, distinct children are separated by at least $R\delta$. A ball of radius $u<\delta$ meeting the support therefore meets only one successive child as long as $u2H(r)H(q)$, increasing $m$ by one if $r=r_m$. Clearing denominators gives \[ |r-r_m|_p\ge \frac1{2H(r)H(r_m)}>p^{-T_m}\ge |\alpha-r_m|_p . \] It follows that $|\alpha-r|_p=|r_m-r|_p>p^{-T_m}$. Our choice of $m$ gives $S_m\le\log_p(2H(r)H(q))+2K$, and $T_m\le(2+3/k_0)S_m\le(2+\varepsilon)S_m$. The claimed bound follows. It also holds for $-(p-1)\alpha-h$, since this affine map preserves $p$-adic distances and changes rational heights by at most a constant factor in either direction. \end{proof} \section{Irreducibility and prime values of a polynomial sequence}\label{sec:poly} Capuano, Mula, Terracini and Veneziano \cite[Section~4.6.3]{CMTV} study period-three continued fractions attached to the Pell equation with $d=a^2+1$. For a positive integer $a$ write \begin{equation}\label{eq:pell-uv} (a+\sqrt d)^{2n}=u_n+v_n\sqrt d . \end{equation} For every $n$ we have $u_n^2-dv_n^2=1$ and $u_n-dv_n=f_n(a)$, where the polynomials $f_n$ are defined by \begin{equation}\label{eq:fn} \begin{split} f_0(X)&=1,\qquad f_1(X)=-2X^3+2X^2-2X+1,\\ f_{n+2}(X)&=(4X^2+2)f_{n+1}(X)-f_n(X). \end{split} \end{equation} Indeed, $(a+\sqrt d)^2$ and $(a-\sqrt d)^2$ have sum $4a^2+2$ and product $1$. By \cite[Proposition~4.26]{CMTV}, if $|f_n(a)|=p^s$ for a prime $p$ and $s\ge1$, then \begin{equation}\label{eq:period-three} [\,\overline{a u_n,\ a/f_n(a),\ a v_n}\,] \end{equation} converges in $\Qp$ to a square root of $d$. Indeed, putting $D=u_n-v_n$, the identity $(u_n+v_n)f_n(a)=1-a^2u_nv_n$ gives the period matrix \[ \frac{1}{f_n(a)} \begin{pmatrix}a&dD\\D&a\end{pmatrix}. \] It has determinant $-1$. Since $f_n(a)\equiv1\pmod{2a}$ by \eqref{eq:fn}, the trace has $p$-adic norm $p^s>1$, and Hensel's lemma gives two eigenvalues in $\Qp$ of distinct norms. Its fixed points are $\pm\sqrt d$, both irrational over $\Q$. Each of the three subsequences of convergents starts at a rational projective point and therefore tends to the attracting fixed point. Conjecture~4.29 of \cite{CMTV} asserts that $f_n$ is irreducible for every $n\ge1$. Their Conjecture~4.30 asks whether, for each fixed positive integer $a$, infinitely many values $|f_n(a)|$ are prime. \begin{theorem}\label{thm:irreducible} For every $n\ge1$, the polynomial $f_n(X)$ is irreducible in $\Z[X]$. \end{theorem} \begin{proof} Consider \[ P_n(Z)=Z^{2n+1}-Z^{2n}-Z-1 . \] Ljunggren's criterion for quadrinomials with coefficients $\pm1$ \cite[Theorem~1]{Ljunggren}, also stated in \cite[Theorem~1]{FJ}, gives irreducibility over $\Q$ if $P_n$ has no root of unity. If $P_n(\zeta)=0$ and $|\zeta|=1$, then $\zeta^{2n}(\zeta-1)=\zeta+1$. Equality of the absolute values of $\zeta-1$ and $\zeta+1$ gives $\zeta=\pm i$. For these two values $(\zeta+1)/(\zeta-1)=-\zeta$ is imaginary, whereas $\zeta^{2n}$ is real. It follows that $P_n$ is irreducible. Write $x=(Z-Z^{-1})/2$ and $y=(Z+Z^{-1})/2$, so that $y^2=x^2+1$ and $x+y=Z$. Adding and subtracting $(x+y)^{2n}$ and $(x-y)^{2n}$ as in \eqref{eq:pell-uv} gives $2f_n(x)=(1-y)Z^{2n}+(1+y)Z^{-2n}$. Hence \begin{align*} 4Z^{2n+1}f_n\!\left(\frac{Z-Z^{-1}}2\right) &=(Z+1)^2-Z^{4n}(Z-1)^2\\ &=-P_n(Z)\bigl(Z^{2n+1}-Z^{2n}+Z+1\bigr). \end{align*} If $z$ is a root of $P_n$, then $x=(z-z^{-1})/2$ satisfies $f_n(x)=0$, and $z^2-2xz-1=0$. The degree $[\Q(z):\Q(x)]$ is at most $2$ and divides the odd integer $[\Q(z):\Q]=2n+1$, so it is $1$. Thus $[\Q(x):\Q]=2n+1=\deg f_n$, the last equality following from \eqref{eq:fn}. Finally, $f_n(0)=1$ by the recurrence, so $f_n$ is primitive. Gauss's lemma gives the assertion over $\Z$. \end{proof} \subsection{Prime divisors and two specializations}\label{subsec:prime-values} Fix $a\ge1$, put $d=a^2+1$, and write $\varepsilon=a+\sqrt d$ and $\eta=(1+\sqrt d)/a$. Since $a\eta=1+\sqrt d$ and $a\eta^{-1}=\sqrt d-1$, equation \eqref{eq:pell-uv} gives \begin{equation}\label{eq:fn-unit} f_n(a)=\frac{a}{2}\left(\eta\varepsilon^{-2n} -\eta^{-1}\varepsilon^{2n}\right). \end{equation} In particular $|f_n(a)|\to\infty$. \begin{proposition}\label{prop:prime-divisors} Suppose that a prime $\ell$ divides $f_n(a)$. Then $d$ is a nonzero square modulo $\ell$. For either square root $t$ of $d$ modulo $\ell$, put $e=a+t$ and let $r$ be the multiplicative order of $e^4$ in $\mathbb F_\ell^\times$. For every $m\ge0$, \[ \ell\mid f_m(a)\quad\Longleftrightarrow\quad m\equiv n\pmod r,\qquad r\mid\frac{\ell-1}{\gcd(4,\ell-1)},\qquad r\nmid 2n . \] Consequently, $\ell-1\mid8n$ excludes $\ell$ as a prime divisor of $f_n(a)$ for every $a$. In particular $3$ and $5$ divide none of these values. \end{proposition} \begin{proof} We have $\ell\nmid2a$. The congruence $u_n\equiv dv_n\pmod\ell$ and $u_n^2-dv_n^2=1$ give $a^2dv_n^2\equiv1\pmod\ell$, so $d=(av_n)^{-2}$ in $\mathbb F_\ell$. Put $w=(1+t)/a$ in that field. Both $e$ and $w$ are nonzero since $t^2-a^2=1$ and $t^2-1=a^2$. Substituting $\sqrt d=t$ in \eqref{eq:fn-unit} gives $\ell\mid f_m(a)$ precisely when $e^{4m}=w^2$. The solutions form the residue class of $n$ modulo $r$. The group of fourth powers in $\mathbb F_\ell^\times$ has order $(\ell-1)/\gcd(4,\ell-1)$. Moreover, $w-w^{-1}=2/a$ and $w+w^{-1}=2t/a$ are nonzero, so $w^2\ne\pm1$. Thus $e^{8n}=w^4\ne1$, giving $r\nmid2n$ and, by Fermat's theorem, $\ell-1\nmid8n$. \end{proof} Given $B\ge2$, take $n$ to be a positive multiple of all $\ell-1$ for primes $\ell\le B$. Then no prime at most $B$ divides any $f_n(a)$, simultaneously for all $a\ge1$. For each fixed $a$ there is therefore an infinite subsequence of pairwise coprime values with absolute value greater than $1$. At each step choose $B$ larger than every prime divisor already used and take $n$ sufficiently large. Let $S_0=S_1=1$ and $S_{m+2}=2S_{m+1}+S_m$. The odd-indexed $S_m$ are the Newman--Shanks--Williams numbers \cite{NSW}. Let $L_m$ denote the Lucas numbers with $L_0=2$, $L_1=1$. For $d=5$, Capuano, Mula, Terracini and Veneziano related prime powers in the period-three problem to Lucas numbers and gave explicit examples for $a=2$ \cite[Examples~4.25 and~4.28]{CMTV}. \begin{proposition}\label{prop:prime-specializations} For $n\ge1$ one has \[ f_n(1)=-S_{2n-1},\qquad f_n(2)=-L_{6n-1}. \] At $a=1$, Conjecture~4.30 of \cite{CMTV} is equivalent to the infinitude of Newman--Shanks--Williams primes, Question~(D) of \cite[p.~130]{NSW}. At $a=2$, it is equivalent to the existence of infinitely many primes $q\equiv5\pmod6$ for which $L_q$ is prime. \end{proposition} \begin{proof} For $a=1$ we have $\eta=\varepsilon=1+\sqrt2$. For $a=2$, putting $\varphi=(1+\sqrt5)/2$ gives $\eta=\varphi$ and $\varepsilon=\varphi^3$. The two identities follow from \eqref{eq:fn-unit} and the usual formulas for $S_m$ and $L_m$. For odd $r,s>1$, let $A,B$ be the $r$th powers of the two conjugate units in the relevant formula. Then $(A^s+B^s)/(A+B)$ is a rational algebraic integer, so $S_r\mid S_{rs}$ and $L_r\mid L_{rs}$. The inequalities $11$ is an algebraic unit. A nontrivial relation would make a positive power of $\eta$ integral, hence $\eta$ itself integral, whereas its trace is $2/a$. The question of infinitely many prime terms for fixed $a$ remains open. \begin{proposition}\label{prop:fixed-gap} For every $h\ge1$ there is a least positive integer $C_h$ for which \[ \gcd\bigl(f_m(a),f_{m+h}(a)\bigr)\mid C_h \qquad (m\ge0,\ a\ge1). \] It is effectively computable, and $C_1=1$, $C_2=1$, $C_3=91$, $C_4=17$. \end{proposition} \begin{proof} Write $T=4X^2+2$, $U_0=0$, $U_1=1$ and $U_{j+1}=TU_j-U_{j-1}$. Fix $a$ and evaluate the polynomials at $a$. The recurrence and $f_0=1$ give $\gcd(f_j,f_{j+1})=1$ for every $j$. Since $f_{m+h}=U_hf_{m+1}-U_{h-1}f_m$, the required gcd is $\gcd(f_m,U_h)$. Similarly $\gcd(U_h,U_{h-1})=1$. Reducing the same identity modulo $U_h$ and iterating therefore gives $\gcd(f_m,U_h)=\gcd(f_b,U_h)$ for $b\equiv m\pmod h$, $0\le bU_{j-1}(X)$ for $j\ge1$ by induction. Hence $U_h$ cannot be divisible by the irreducible polynomial $f_b$, and $\operatorname{Res}(f_b,U_h)\ne0$. The specialized gcd divides this resultant by the integral B\'ezout identity for the resultant. The case $b=0$ contributes $1$. Let $B_h$ be the odd part of the least common multiple of the absolute resultants for $0\le b