\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath,amssymb}
\usepackage[margin=1in]{geometry}
\usepackage[hidelinks]{hyperref}
\hypersetup{pdftitle={The four winding differences of the Theodorus spiral},pdfsubject={OEIS A172164}}
\newcommand{\tfracpart}[1]{\{#1\}}
\title{The four winding differences of the Theodorus spiral}
\author{Research note on OEIS A172164}
\date{28 November 2026}
\begin{document}
\maketitle

\noindent\textbf{Theorem.}
The difference between the numbers of complete triangles in two successive turns of the Theodorus spiral takes exactly the values $18,19,20,21$. The sequence is not eventually periodic. Put $r=2\pi^2-19$. The four values have the following natural densities, in the same order:
\[
\frac{(1-r)^2}{4},\qquad \frac12-\frac{r^2}{4},\qquad
\frac12-\frac{(1-r)^2}{4},\qquad \frac{r^2}{4}.
\]
The first assertion answers S. Dumortier's 2010 conjecture in OEIS A172164 [1]. The accompanying Lean theorem \texttt{Theodorus.conjecture} formalizes this four-value assertion using the finite angle sum and its first strict crossing of each full revolution. The periodicity and density arguments are given below.

\section*{The angle and its quadratic approximation}
The angle after $m$ right triangles is
\[
\theta_m=\sum_{j=1}^m\arctan(1/\sqrt j),\qquad \theta_0=0.
\]
For $n\ge1$, let $M_n$ be the first $m$ for which $\theta_m>2\pi n$, and put $M_0=0$. These crossings exist by comparison with $\sum j^{-1/2}$.
They are OEIS A072895 [2]. No positive-index spoke lies on the initial ray, by Teuffel's noncoincidence theorem [3]. Thus turn $n$ contains $M_n-M_{n-1}-1$ complete triangles, including the first turn under the convention $M_0=0$. The quantity of interest is
\[
D_n=M_{n+2}-2M_{n+1}+M_n,\qquad n\ge0.
\]

Put $s=7/6$ and $F(m)=2\sqrt{m+s}$. For every integer $m\ge1$,
\begin{equation}
\big|\arctan(m^{-1/2})-[F(m)-F(m-1)]\big|
\le \tfrac15 m^{-5/2}.\label{eq:one}
\end{equation}
To see this, start both approximations with $B=m^{-1/2}-\tfrac13m^{-3/2}$. Integrating $1/(1+t^2)=1-t^2+t^4/(1+t^2)$ gives
\[
0\le\arctan(m^{-1/2})-B\le \tfrac15 m^{-5/2}.
\]
On the other hand,
\[
F(m)-F(m-1)=\int_{1/6}^{7/6}(m+u)^{-1/2}\,du .
\]
Taylor's theorem gives $0\le (m+u)^{-1/2}-m^{-1/2}+u m^{-3/2}/2\le(3/8)u^2m^{-5/2}$ throughout the interval. The integrals of $u$ and $u^2$ are $2/3$ and $19/36$, so this second approximation lies between $B$ and $B+(19/96)m^{-5/2}$. Since $19/96<1/5$, this proves \eqref{eq:one}.

Absolute convergence of these successive errors gives a constant $K=\lim_m(\theta_m-F(m))$. Summing \eqref{eq:one} from $m+1$ to infinity and comparing with the integral yields
\begin{equation}
|\theta_m-K-2\sqrt{m+s}|\le\frac{2}{15m^{3/2}},\qquad m\ge1.\label{eq:tail}
\end{equation}
This recovers the first-order angular approximation studied in [4,5], with the explicit bound needed here.

\section*{The second differences}
Define $W(m)=((\theta_m-K)/2)^2-s$. By \eqref{eq:tail},
\begin{equation}
|W(m)-m|\le \frac{2\sqrt{m+s}}{15m^{3/2}}+\frac{1}{225m^3}=:b_m.
\label{eq:square}
\end{equation}
For $m\ge8$, $\sqrt{m+s}<\tfrac32\sqrt m$, so $b_m<1/32$. Also $\theta_m-K>0$ there, and $b_m\to0$.

Let $Q(n)=(\pi n-K/2)^2-s$. Each triangle angle is at most $\pi/4$, so $M_n\ge9$ for $n\ge1$. Applying the increasing function $t\mapsto ((t-K)/2)^2-s$ on $[\theta_{M_n-1},\theta_{M_n}]$ to the crossing inequalities gives
\[
W(M_n-1)\le Q(n)<W(M_n).
\]
Consequently, for $e_n=M_n-Q(n)$,
\begin{equation}
-b_{M_n}<e_n\le 1+b_{M_n-1},\qquad n\ge1.\label{eq:round}
\end{equation}
In particular $-1/32<e_n<1+1/32$. The second difference of $Q$ is $2\pi^2$, and the second difference of any three numbers in this interval has absolute value less than twice its width, namely $17/8$. Therefore $17<D_n<22$ for $n\ge1$, using $31/10<\pi<22/7$. Integrality gives the four asserted possibilities.

For $n=0$ the first two crossings are $M_1=17$ and $M_2=54$, so $D_0=20$. The crossings and differences below also witness all four values:
\[
\begin{array}{r|rrrrrrrrr}
n&0&1&2&3&4&5&6&7&8\\
\hline
M_n&0&17&54&110&186&281&396&532&686\\
D_n&20&19&20&19&20&21&18&&
\end{array}
\]
For a reproducible exact check, the accompanying \texttt{check\_crossings.py} bounds the first angle by writing it as $\pi/4$ exactly, and bounds each subsequent angle with two alternating arctangent sums of 10 and 11 terms. The square roots are enclosed by integer square roots on a grid of mesh $10^{-8}$. Comparisons use $333/106<\pi<355/113$. The checks compare the two angle sums on either side of each proposed crossing directly with $2\pi n$.

\section*{Mean, periodicity and frequency}
Since $M_n=Q(n)+O(1)$, summing the second differences through $n=N-1$ and telescoping gives
\[
\frac1N\sum_{n=0}^{N-1}D_n=2\pi^2+O(1/N).
\]
An eventually periodic integer sequence has rational mean. The transcendence of $\pi$ makes $2\pi^2$ irrational, proving the aperiodicity assertion.

To find the frequencies, Weyl's polynomial equidistribution theorem [6] gives joint equidistribution of $(\tfracpart{Q(n)},\tfracpart{Q(n+1)})$ on the unit square. Indeed, for any nonzero integer pair $(h,k)$, $hQ(n)+kQ(n+1)$ has irrational quadratic coefficient $(h+k)\pi^2$ if $h+k\ne0$, and irrational linear coefficient $2k\pi^2$ otherwise. In particular $\tfracpart{Q(n)}$ is uniformly distributed. By \eqref{eq:round}, $M_n$ differs from $\lfloor Q(n)\rfloor+1$ only on a set of natural density zero: for any fixed $\epsilon>0$ all sufficiently large disagreements have fractional part in $[0,\epsilon]\cup[1-\epsilon,1)$. Their upper density is at most $2\epsilon$. The same is true after either of the two index shifts in $D_n$.

Writing $X=\tfracpart{Q(n)}$ and $Y=\tfracpart{Q(n+1)}$, the second difference of $\lfloor Q(n)\rfloor$ is $\lfloor 2\pi^2+2Y-X\rfloor$. Therefore the density for an integer $d$ is the area where $d\le 2\pi^2+2Y-X<d+1$ in the unit square. The boundaries are line segments of zero area. Under uniform area measure, $2Y-X$ has density $(w+1)/2$ on $[-1,0]$, $1/2$ on $[0,1]$, and $(2-w)/2$ on $[1,2]$. Integrating gives the four formulas in the theorem. Numerically they yield $1.70030\%$, $36.33926\%$, $48.29970\%$, and $13.66074\%$.

\section*{Sources}
\begin{enumerate}
\item S. Dumortier, \href{https://oeis.org/A172164}{OEIS A172164} (2010). See also \href{https://isitsolved.com/longlist/IIS-L-09859}{Is it Solved? IIS-L-09859}.
\item \href{https://oeis.org/A072895}{OEIS A072895}, first winding-crossing indices.
\item E. Teuffel, Eine Eigenschaft der Quadratwurzelschnecke, \emph{Math.-Phys. Semesterber.} 6 (1958), 148--152.
\item H. Kociemba, \href{https://kociemba.org/themen/spirale/theodorus.html}{The Spiral of Theodorus}, angular expansions and estimates for winding indices.
\item D. Brink, \href{https://doi.org/10.4169/amer.math.monthly.119.09.779}{The spiral of Theodorus and sums of zeta-values at the half-integers}, \emph{Amer. Math. Monthly} 119 (2012), 779--786.
\item H. Weyl, \href{https://doi.org/10.1007/BF01475864}{\emph{\"Uber die Gleichverteilung von Zahlen mod. Eins}}, \emph{Math. Ann.} 77 (1916), 313--352.
\end{enumerate}
\end{document}
