\documentclass[12pt]{rhumj_new}
\usepackage[T1]{fontenc}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage{hyperref}
\title[Niven's Theorem Using Algebraic Number Theory]{A Proof of a Generalization of Niven's Theorem Using Algebraic Number Theory}
\author{Caroline Nunn}
\affiliation{University of Maryland, College Park}
\email{jnunn@umd.edu}
\yr{2021}
\subjclass{11R04}
\keywords{Number Theory, Algebraic Number Theory, Trigonometry}
\abstract{Niven’s theorem states that the sine, cosine, and tangent functions are rational for only a few rational multiples of $\pi$. Specifically, for angles $\theta$ that are rational multiples of $\pi$, the only rational values of $\sin(\theta)$ and $\cos(\theta)$ are $0$, $\pm\frac{1}{2}$, and $\pm1$. For tangent, the only rational values are $0$ and $\pm1$. We present a proof of this fact, along with a generalization, using the structure of ideals in imaginary quadratic rings. We first show that the theorem holds for the tangent function using elementary properties of Gaussian integers, before extending the approach to other imaginary quadratic rings. We then show for which rational multiples of $\pi$ the squares of the sine, cosine, and tangent functions are rational, providing a generalized form of Niven’s theorem. We end with a discussion of a few related combinatorial identities.}
\pagenumbering{gobble}
\begin{document}
\section{Introduction}
The identity
\begin{equation}\label{motivator}
(1+i)^4=-4
\end{equation}
gives an example of a complex number (specifically, a Gaussian integer) which, when raised to an integral power, gives a real number. This is, by itself, rather unremarkable; however, a search for other examples shows that, aside from trivial cases, multiples, and conjugates, this number appears to be the only Gaussian integer with this property. In fact, this is true:
\begin{thm}\label{nivtangauss}
Let $\alpha\in\mathbb{Z}[i]$ be a nonzero Gaussian integer such that there exists $n\in\mathbb{Z}^+$ and $c\in\mathbb{Z}$ with $\alpha^n=c$.\footnote{Here and throughout this paper, $\mathbb{Z}^+$ denotes the positive integers. In particular, $0\notin\mathbb{Z}^+$.} Then $\alpha$ is an integer multiple of either a unit or an associate of $1+i$.
\end{thm}
This result follows from a classic theorem on trigonometric functions that was included in Ivan Niven's famous book \textit{Irrational Numbers} \cite{niven}. This theorem can be stated as follows:
\begin{thm}[Lehmer, Olmsted, Niven]\label{origthm}
\begin{equation}\label{nivsin}
\sin\left(\pi\mathbb{Q}\right)\cap\mathbb{Q}=\cos\left(\pi\mathbb{Q}\right)\cap\mathbb{Q}=\left\{0,\pm\tfrac{1}{2},\pm1\right\}
\end{equation}
and
\begin{equation}\label{nivtan}
\tan\left(\pi\mathbb{Q}\right)\cap\mathbb{Q}=\{0,\pm1\}.
\end{equation}
\end{thm}
Theorem \ref{nivtangauss} follows easily from (\ref{nivtan}): let $\alpha=a+bi$ be a Gaussian integer. For $\alpha$ to have the desired property, we must have that $\theta=\arctan(b/a)$ is a rational multiple of $\pi$. This is because $\alpha$ may be written in polar form as $\pm|\alpha|e^{i\theta}$, so for $\alpha^k=(\pm|\alpha|)^ke^{ik\theta}$ to be real, $k\theta$ must be an integer multiple of $\pi$, meaning $\theta$ is a rational multiple of $\pi$. However, this method of proof requires trigonometry, while our original question was purely algebraic and did not make any reference to trigonometric functions. This suggests that there might be a method of proving this result without reference to trigonometry.
In fact, as we will see in Corollary \ref{nivtanc}, Theorem \ref{nivtangauss} is equivalent to Niven's theorem, at least in the case of the tangent function. This means that an algebraic proof of Theorem \ref{nivtangauss} gives a new approach to proving the tangent part of Niven's theorem. Finding such an algebraic proof is the focus of section \label{sec:tan}.
In section \ref{sec:gen} we generalize the method of section \ref{sec:tan} to quadratic rings other than the Gaussian integers. This can be seen to imply a generalized form of Niven's theorem. Specifically, we are able to classify when the tangent of a rational multiple of $\pi$ is the square of a rational number. The Pythagorean trigonometric identities allow us to extend this result to the other trigonometric functions. Section \ref{sec:comb} gives a few related combinatorial identities.
Niven's original proof \cite{niven} also uses algebraic number theory, but the approach is different. Niven first proves a result of D. H. Lehmer \cite{lehmer}; namely, that for integers $k\geq0$, $n>2$ with $\gcd(k,n)=1$, the number $2\cos(2\pi k/n)$ is an algebraic integer of degree $\phi(n)/2$, where $\phi(n)$ is Euler's $\phi$--function. Niven's theorem then follows for cosine noting that $\phi(n)=2$ if and only if $n=3$, $4$, or $6$. Niven then extends this result in a modified form to the sine and tangent functions, thus proving the full theorem.
For other proofs, see \cite{bcg,jahnel,olmsted,schaumberger}.
\section{Proof of Niven's theorem for the tangent function}\label{sec:tan}
The Gaussian integers $\mathbb{Z}[i]=\{\alpha\in\mathbb{C}\mid \alpha=a+bi,a,b\in\mathbb{Z}\}$ are a special subset of the complex numbers with properties similar to the regular integers. To distinguish between regular integers and Gaussian integers, we will always refer to $\mathbb{Z}[i]$ as ``Gaussian'', reserving ``integer'' for $\mathbb{Z}$. Note that $\mathbb{Z}[i]$ is a ring and recall the following definitions from ring theory:
\begin{defin}
A \textbf{unit} is an element of a ring whose multiplicative inverse is also in the same ring.
Two numbers $\alpha$ and $\beta$ are called \textbf{associates} if there exists a unit $u$ such that $\alpha=u\beta$.
\end{defin}
The units of $\mathbb{Z}[i]$ are $\{1,i,-1,-i\}$. So for any $\alpha\in\mathbb{Z}[i]$, the set of associates of $\alpha$ is given by $\{\alpha,i\alpha,-\alpha,-i\alpha\}$.
\begin{lemma}\label{assconj}
Let $\alpha\neq0$ be a Gaussian integer that is an associate of its complex conjugate. Then $\alpha$ is an integer multiple of $1$, $i$, or $1\pm i$.
\end{lemma}
\begin{proof}
Let $\alpha=a+bi$. The associates of $\alpha$ are $\{a+bi,-b+ai,-a-bi,b-ai\}$, and the conjugate of $\alpha$ is $a-bi$. If $a-bi=a+bi$, then $b=0$, so $\alpha=a$ is an integer. If $a-bi=-a-bi$, then $a=0$, so $\alpha=bi$ is an integer multiple of $i$. Finally, if $a-bi=\pm b\mp ai$, we find by comparing real and imaginary parts that $b=\pm a$. Then $\alpha=a\pm ai$ is an integer multiple of $1\pm i$.
\end{proof}
An analogue of unique factorization holds in $\mathbb{Z}[i]$. However, because of the fact that any element can be trivially factored, for example, as $\alpha=-i(i\alpha)$, we must be careful about what we mean by ``unique factorization''.
\begin{defin}
An element $\alpha$ of a ring is called \textbf{irreducible} if $\alpha$ is not a unit and for all $\beta$ and $\gamma$ in the ring with $\alpha=\beta\gamma$, one of $\beta$ or $\gamma$ must be a unit.
A \textbf{prime} element is an irreducible element $\pi$ with the following property: if $\pi\mid\alpha\beta$, then $\pi\mid\alpha$ or $\pi\mid\beta$.
\end{defin}
\begin{prop}
All irreducible elements of $\mathbb{Z}[i]$ are prime. Furthermore, each nonzero element of $\mathbb{Z}[i]$ may be written in the form $\pi_1\cdots\pi_n$, where $\pi_1,...,\pi_n$ are prime. This factorization is unique up to reordering and replacement by associates.
\end{prop}
For a proof, see \cite{kraftwash}, Corollary 18.10 and Theorem 18.12. Now we are ready to prove Theorem \ref{nivtangauss}.
\begin{proof}[Proof (of Theorem \ref{nivtangauss})]
Let $\alpha=a+bi$, where $a$ and $b$ are integers with $\gcd(a,b)=1$. Suppose there exists a positive integer $n$ and an integer $c$ such that $\alpha^n=c$. Let $\pi$ be a prime factor of $\alpha$. Then since $\alpha\mid c$, we have $\pi\mid c$. This means that there exists a $\rho$ such that $\pi\rho=c$. Taking conjugates, we find $\bar\pi\bar\rho=\bar c=c$. Therefore, $\bar\pi\mid c$. Since $c=\alpha^n$ and $\bar\pi$ is prime, $\bar\pi\mid\alpha$. Suppose for a contradiction that $\pi$ and $\bar\pi$ are relatively prime. Then $\pi\bar\pi\mid\alpha$. But $\pi\bar\pi$ is an integer, and since $\gcd(a,b)=1$, $\alpha$ has no integer factors. Therefore $\pi$ and $\bar\pi$ are not relatively prime and so, since they are both primes, must be associates. By Lemma \ref{assconj}, $\pi$ is an associate of $1+i$ (note that $1-i=-i(1+i)$ is an associate of $1+i$). Therefore, $\alpha$ must be a unit times a power of $1+i$. However, since $2\mid2i=(1+i)^2$ and $\alpha$ is assumed to have no integer factors, we find that $\alpha$ is either a unit or an associate of $1+i$.
For $\alpha$ where $\gcd(a,b)>1$, the result follows from the previous result using $\alpha'=\alpha/\gcd(a,b)$.
\end{proof}
\begin{corollary}\label{nivtanc}
$\tan\left(\pi\mathbb{Q}\right)\cap\mathbb{Q}=\{0,\pm1\}.$
\end{corollary}
\begin{proof}
Suppose $\tan(\pi m/n)=b/a$, where $a,b,m,n\in\mathbb{Z}$. Let $\alpha=a+bi$. Note that $\alpha$ is a Gaussian integer, so any positive power of $\alpha$ is also a Gaussian integer. Then $\alpha=\pm re^{i\pi m/n}$, where $r=\sqrt{a^2+b^2}$, so $\alpha^n=(\pm r)^ne^{i\pi m}=(-1)^m(\pm r)^n$. Then $\alpha^n$ is a real number and a Gaussian integer, so is an integer. This means that $\alpha$ is an integer multiple of either a unit or $1+i$, i.e., $\alpha$ is either $a+0i$ or $a\pm ai$. Then $\tan(\pi m/n)$ is either $0$ or $\pm 1$.
\end{proof}
\section{Niven generalized}\label{sec:gen}
The Gaussian integers can be generalized as follows:
\begin{defin}
A \textbf{quadratic field} is a field extension of the rational numbers given by $\mathbb{Q}(\sqrt{d})=\{x+y\sqrt{d}\mid x,y\in\mathbb{Q}\}$, where $d$ is a square-free integer. If $d>0$, the quadratic field is said to be \textbf{real}, otherwise, it is \textbf{imaginary}. The \textbf{ring of algebraic integers} in $\mathbb{Q}(\sqrt d)$, denoted $\mathcal{O}_d$, is defined as the intersection of $\mathbb{Q}(\sqrt d)$ with the algebraic integers, that is, roots of polynomials over the integers with leading coefficient $1$. As the name implies, this set is a ring.
\end{defin}
For example, $\mathbb{Q}[i]$ is a quadratic field with $d=-1$, and its ring of algebraic integers is the Gaussian integers. We will describe the ring of algebraic integers for arbitrary quadratic fields later in Proposition \ref{funfacts}. Again, we will always refer to algebraic integers as algebraic integers and refer to regular integers as ``integers''.
\begin{prop}\label{real}
Let $\alpha\neq0$ be an element of a real quadratic field $K=\mathbb{Q}(\sqrt{d})$ such that there exists $n\in\mathbb{Z}^+$ and $c\in\mathbb{Q}$ with $\alpha^n=c$. Then $\alpha$ is rational or a rational multiple of $\sqrt{d}$.
\end{prop}
\begin{proof}
Suppose for contradiction that $\alpha=(a+b\sqrt{d})$ for rational $a\neq0$, $b\neq0$. It suffices to show that $\alpha^n$ is irrational for positive $a$ and $b$, since if $\alpha$ is rational so are $-\alpha$, $\bar\alpha$, and $-\bar\alpha$. Let $a_n+b_n\sqrt{d}=(a+b\sqrt{d})^n$. Expanding the right hand side with the binomial theorem, we find that $b_n>0$, since it is a sum of positive numbers. Since $\alpha^n$ was assumed to be rational, we have found that $\sqrt{d}=(\alpha^n-a_n)/b_n$ is rational, a contradiction. Hence, one of $a$ or $b$ must equal $0$.
\end{proof}
For imaginary quadratic fields, we can extend the argument used to prove Theorem \ref{nivtangauss}. However, the argument must be modified to account for the failure of unique factorization in arbitrary quadratic rings. Recall that a set $\mathfrak a$ is called an ideal of a ring $R$ if $\mathfrak a$ is an additive subgroup of $R$ with the property that if $\alpha\in\mathfrak a$, we have $\alpha\beta\in\mathfrak a$ for all $\beta\in R$. If there exists an $\alpha\in R$ such that $\mathfrak a=\{\alpha r:r\in R\}$, we say that $\mathfrak a$ is \textit{principal} and write $\mathfrak a=\langle\alpha\rangle$. We denote by $N(\mathfrak a)$ the index of $\mathfrak a$ as a subgroup of the additive group of the ring, that is, $N(\mathfrak a)=[\mathcal{O}_d:\mathfrak a]$.
Ideals can be multiplied; for ideals $\mathfrak a$ and $\mathfrak b$, the ideal $\mathfrak a\mathfrak b$ is defined to be the smallest ideal containing products of elements of $\mathfrak a$ and $\mathfrak b$. We have $N(\mathfrak a\mathfrak b)=N(\mathfrak a)N(\mathfrak b)$. Note that in a quadratic ring, $\langle N(\mathfrak a)\rangle=\mathfrak a\bar{\mathfrak a}$, where $\bar{\mathfrak a}$ is the ideal obtained by conjugating each element of $\mathfrak a$. For ideals $\mathfrak a$ and $\mathfrak c$, if there exists an ideal $\mathfrak b$ such that $\mathfrak a\mathfrak b=\mathfrak c$, we say $\mathfrak a\mid\mathfrak c$. Equivalently, $\mathfrak a\mid\mathfrak c$ if $\mathfrak c\subseteq\mathfrak a$. When $\mathfrak c=\langle\gamma\rangle$ is a principal ideal, we write $\mathfrak a\mid\gamma$. An ideal $\mathfrak{p}$ is said to be \textit{prime} if it has the property that $\mathfrak{p}\mid\mathfrak{a}\mathfrak{b}$ implies $\mathfrak{p}\mid\mathfrak{a}$ or $\mathfrak{p}\mid\mathfrak{b}$. While factorization of elements is not unique in general, an ideal of $\mathcal{O}_d$ can always be uniquely factored into prime ideals. For a proof, see \cite{stewtall,quadratic}.
\begin{lemma} \label{pispbar}
Let $\alpha\neq0$ be an algebraic integer in a quadratic field $K$ with no integer factors other than $\pm1$ such that there exists $n\in\mathbb{Z}^+$ and $c\in\mathbb{Z}$ with $\alpha^n=c$. Then any prime ideal factor $\mathfrak{p}$ of $\langle\alpha\rangle$ satisfies $\mathfrak{p}=\bar{\mathfrak{p}}$.
\end{lemma}
\begin{proof}
Let $\mathcal{O}_d$ be the ring of algebraic integers in the quadratic field $K=\mathbb{Q}(\sqrt{d})$, and let $\alpha$ be an element of $\mathcal{O}_d$ with no nontrivial integer factors (i.e., the only integer factors are $1$ and $-1$) such that $\alpha^n=c$ for some positive integer $n$ and integer $c$. Let $\mathfrak{p}$ be a prime ideal factor of $\langle\alpha\rangle$. Since $\mathfrak{p}\mid\alpha$ and $\alpha\mid c$, we have $\mathfrak{p}\mid c$. Taking conjugates, we find $\bar{\mathfrak{p}}\mid\bar c=c$. Since $c=\alpha^k$ and $\bar{\mathfrak{p}}$ is prime, $\bar{\mathfrak{p}}\mid\alpha$. Suppose for a contradiction that $\mathfrak{p}\neq\bar{\mathfrak{p}}$. Then $\mathfrak{p}$ and $\bar{\mathfrak{p}}$ are distinct prime ideal factors of $\langle\alpha\rangle$ and $\mathfrak{p}\bar{\mathfrak{p}}\mid\alpha$. Since $\mathfrak{p}\bar{\mathfrak{p}}=\langle N(\mathfrak{p})\rangle$, we have $N(\mathfrak{p})\mid\alpha$. Then $N(\mathfrak{p})$ is a nontrivial integer factor of $\alpha$, a contradiction. Therefore, all prime ideal factors of $\langle\alpha\rangle$ satisfy $\mathfrak{p}=\bar{\mathfrak{p}}$.
\end{proof}
To pin down exactly which $\alpha$ have the desired property, we need to know a little bit more about the ring of algebraic integers in quadratic fields. Recall that $d$ is a square-free integer.
\begin{prop} \label{funfacts}
Let $K=\mathbb{Q}(\sqrt{d})$ and let $\mathcal{O}_d$ be the ring of algebraic integers in $K$. Then
\begin{enumerate}[label=(\alph*)]
\item $\mathcal{O}_d=\mathbb{Z}[\theta]$, where $\theta=\sqrt{d}$ if $d\not\equiv1$ (mod $4$) or $\theta=\frac{1+\sqrt{d}}{2}$ if $d\equiv1$ (mod $4$).
\item For $d<0$, the group of units in $\mathcal{O}_d$ is generated by $i$ if $d=-1$, by $\frac{1+\sqrt{-3}}{2}$ if $d=-3$, or by $-1$ otherwise.
\item For a principal ideal $\langle\alpha\rangle$, $N(\langle\alpha\rangle)=|N(\alpha)|=|\alpha\bar\alpha|=|x^2-dy^2|$, where $\alpha=x+y\sqrt{d}$.
\end{enumerate}
\end{prop}
For a proof, see \cite{stewtall,quadratic}.
\begin{lemma} \label{disc}
Let $\mathfrak{p}\neq0$ be a prime ideal of the ring of algebraic integers in a quadratic field $K=\mathbb{Q}(\sqrt{d})$. If $\mathfrak{p}=\bar{\mathfrak{p}}$, then either $\mathfrak{p}=\langle p\rangle$ for a rational prime $p$, or $N(\mathfrak{p})=p$ for some rational prime $p$ with either $p\mid d$ or $p=2$. If $N(\mathfrak{p})=p$ and $d\equiv 1$ (mod $4$), then $p\neq2$.
\end{lemma}
For a proof, see Theorem 8.3 and Table 3 of \cite{quadratic}. We remark that a prime ideal $\mathfrak{p}$ is said to be ramified if $\mathfrak{p}^2=\langle p\rangle$ for some prime integer $p$. These are exactly the ideals with $\mathfrak{p}=\bar{\mathfrak{p}}$ and $N(\mathfrak{p})=p$ that occur in the second part of Lemma \ref{disc}. We are now ready to classify exactly which prime ideals can appear in the factorization of $\langle\alpha\rangle$, where $\alpha$ is an algebraic integer with the desired property.
\begin{lemma} \label{whatsbeta}
Let $\langle\beta\rangle=\mathfrak{p}_1\cdots\mathfrak{p}_r$ with $r\geq1$ be a principal ideal in the ring of algebraic integers of an imaginary quadratic field $K=\mathbb{Q}(\sqrt{d})$ where $\mathfrak{p}_1,\dots,\mathfrak{p}_r$ are distinct ramified prime ideals. Then $\beta$ is an associate of $\sqrt{d}$ or, when $d=-1$, an associate of $1+i$.
\end{lemma}
\begin{proof}
Let $\mathcal{O}_d$ be the ring of algebraic integers in the imaginary quadratic field $\mathbb{Q}(\sqrt{d})$. Let $p_i=N(\mathfrak{p}_i)$. Since $\mathfrak{p_i}$ is ramified, $p_i$ is prime and either divides $d$ or equals $2$ by Lemma \ref{disc}. If $d\equiv 1$ (mod $4$), then $p_i\neq2$. Since each prime $p_i=N(\mathfrak{p}_i)=\mathfrak{p}_i\bar{\mathfrak{p_i}}=\mathfrak{p}_i^2$ and $\mathfrak{p}_i\neq\mathfrak{p}_j$ when $i\neq j$, unique factorization gives $p_i\neq p_j$.
Because the norm is multiplicative, $N(\beta)=N(\mathfrak{p}_1\cdots\mathfrak{p}_r)=p_1\cdots p_r$. In particular, by the above, the prime factors of $N(\beta)$ are contained in the prime factors of $d$ and do not repeat. Therefore, $N(\beta)$ is at most $2|d|$, or $|d|$ in the case that $d\equiv1$ (mod $4$).
When $d\not\equiv1$ (mod $4$), we have $\beta=m+n\sqrt{d}$ for some integers $m$ and $n$. Then $N(\beta)=m^2+|d|n^2=p_1\cdots p_r$. Note that $n\ne 0$ since otherwise $m^2$ would be a nonempty product of distinct primes, which is impossible. So $|d|\leq N(\beta)\leq2|d|$. Because the prime factors of $N(\beta)$ are contained in the prime factors of $d$ and $2$, $N(\beta)$ is either $|d|$ or $2|d|$. If $N(\beta)=d$, we must have $m=0$, so $\langle\beta\rangle=\langle\sqrt{d}\rangle$. For $N(\beta)=2|d|$, we must have $n^2=1$ (otherwise $N(\beta)$ is too large). Then $m^2+|d|=2|d|$ implies that $|d|=m^2$. Since $d$ is square-free, $d=-1$. Then $\langle\beta\rangle=\langle1+i\rangle$.
In the case $d\equiv1$ (mod $4$), a similar analysis may be carried out, but with $\beta=m+n\frac{1+\sqrt{d}}{2}$. Again, $n\neq0$, so $N(\beta)=(m+n/2)^2+|d|n^2/4\geq(1+|d|)/4$, since either $|n|\geq2$ or $|n|=1$ and $|m+n/2|\geq1/2$. The only odd prime less than $4$ is $3$, so, since $(1+|d|)/4\leq N(\beta)\leq |d|$, we have $N(\beta)=|d|$ or $N(\beta)=|d|/3$. If $N(\beta)=|d|$, we know from size considerations that $|n|$ is at most $2$. If $n=\pm2$, we must have $m=\mp1$, so we find $\langle\beta\rangle=\langle\sqrt{d}\rangle$. If $n=\pm1$, let $k=2m+n=2m\pm1$. Then $N(\beta)=(k^2+|d|)/4=|d|$, so $k^2=3|d|$. Since $d$ is square-free, we must have $d=-3$ and $k=\pm3$, meaning $\langle\beta\rangle=\left\langle\frac{\pm3\pm\sqrt{-3}}{2}\right\rangle=\langle\sqrt{-3}\rangle$. If $N(\beta)=|d|/3$, we must have $n^2=1$ (again, because otherwise $N(\beta)$ is too large). Let $k=2m+n=2m\pm1$. Then $N(\beta)=(k^2+|d|)/4=|d|/3$, meaning $|d|=3k^2$. Since $d$ is square-free, we have $d=-3$, in which case the corresponding ideal $\left\langle\frac{1+\sqrt{-3}}{2}\right\rangle=\mathcal{O}_{-3}$ is the entire ring, and is therefore not a nonempty product of prime ideals.
\end{proof}
Thus we have found that there is exactly one principal ideal $\langle\beta\rangle$ in each imaginary quadratic ring $\mathcal{O}_d$ satisfying the hypotheses of Lemma \ref{whatsbeta}. Figures \ref{Zipicture}, \ref{Z3picture}, and \ref{Z2picture} illustrate this ideal for a few values of $d$. In each diagram, the ring of algebraic integers for $\mathbb{Q}(\sqrt{d})$ is represented by points in the complex plane. The ideal $\langle\beta\rangle$ is shown with blue \textcolor{blue}{+} symbols, with the generators as green \textcolor{green}{$*$} symbols. The units of the ring are shown with magenta \textcolor{magenta}{$\times$} symbols.
\begin{figure}[h]
\begin{minipage}{.5\textwidth}
\begin{center}
\begin{tikzpicture}
\foreach \x in {-3,...,3}
\foreach \y in {-3,...,3}{
\pgfmathsetmacro\norm{\x*\x+\y*\y};
\ifodd\norm
\ifnum1=\norm
\node at (\x,\y) {\color{magenta}$\times$};
\else
\node at (\x,\y) {\tiny\color{gray}\textbullet};
\fi
\else
\ifnum2=\norm
\node at (\x,\y) {\color{green}$*$};
\else
\node at (\x,\y) {\color{blue}+};
\fi
\fi}
\draw (-3,0) -- (3,0);
\draw (0,3) -- (0,-3);
\draw (-3,-3) -- (3,3);
\draw (-3,3) -- (3,-3);
\end{tikzpicture}
\caption{$\mathbb{Z}[i]$} \label{Zipicture}
\end{center}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\begin{center}
\begin{tikzpicture}
\foreach \y in {-3,...,3}{
\pgfmathsetmacro\xlow{
\ifodd\y-2.5
\else-3
\fi
}
\foreach \x in {\xlow,...,3}{
\pgfmathsetmacro\norm{\x*\x+3*\y*\y/4};
\pgfmathsetmacro\normmodthree{Mod(\norm,3)}
\ifnum0=\normmodthree
\ifnum3=\norm
\node at (\x,\y*0.866) {\color{green}$*$};
\else
\node at (\x,\y*0.866) {\color{blue}+};
\fi
\else
\ifnum1=\norm
\node at (\x,\y*0.866) {\color{magenta}$\times$};
\else
\node at (\x,\y*0.866) {\tiny\color{gray}\textbullet};
\fi
\fi
}
}
\draw (-3,0) -- (3,0);
\draw (0,3) -- (0,-3);
\draw (-3,-1.732) -- (3,1.732);
\draw (-3,1.732) -- (3,-1.732);
\draw (-1.732,-3) -- (1.732,3);
\draw (-1.732,3) -- (1.732,-3);
\end{tikzpicture}
\caption{$\mathbb{Z}\left[\frac{1+\sqrt{-3}}{2}\right]$} \label{Z3picture}
\end{center}
\end{minipage}
\end{figure}
\begin{figure}[h] \label{Z2picture}
\begin{center}
\begin{tikzpicture}
\foreach \x in {-3,...,3}
\foreach \y in {-2,...,2}{
\pgfmathsetmacro\norm{\x*\x+2*\y*\y};
\ifodd\norm
\ifnum1=\norm
\node at (\x,\y*1.414) {\color{magenta}$\times$};
\else
\node at (\x,\y*1.414) {\tiny\color{gray}\textbullet};
\fi
\else
\ifnum2=\norm
\node at (\x,\y*1.414) {\color{green}$*$};
\else
\node at (\x,\y*1.414) {\color{blue}+};
\fi
\fi}
\draw (-3,0) -- (3,0);
\draw (0,3) -- (0,-3);
\end{tikzpicture}
\caption{$\mathbb{Z}[\sqrt{-2}]$}
\end{center}
\end{figure}
The two exceptional cases, $\mathbb{Z}[i]$ and $\mathbb{Z}\left[\tfrac{1+\sqrt{-3}}{2}\right]$, are shown, along with the ring $\mathbb{Z}[\sqrt{-2}]$, which is intended to represent the general case.
\begin{thm} \label{general}
Let $\alpha\neq0$ be an element of a quadratic field $K=\mathbb{Q}(\sqrt{d})$ such that there exists $n\in\mathbb{Z}^+$ and $c\in\mathbb{Q}$ with $\alpha^n=c$. Then $\alpha$ is a rational multiple of one of $1$, $i$, $1\pm i$, $\frac{1\pm\sqrt{-3}}{2}$, $\tfrac{3\pm\sqrt{-3}}{2}$, or $\sqrt{d}$.
\end{thm}
\begin{proof}
In the case of real quadratic fields, the theorem follows from Proposition \ref{real}. For imaginary quadratic fields, it suffices to show that the theorem is true for algebraic integers, since every element of a quadratic field is a rational multiple of an algebraic integer. In this case, since $c$ is a power of an algebraic integer, it is an algebraic integer. It is also rational, so $c\in\mathbb{Z}$.
Let $\mathcal{O}_d$ be the ring of algebraic integers in the imaginary quadratic field $K=\mathbb{Q}(\sqrt{d})$ in which $\alpha$ is an element. Let $a$ be the largest integer factor of $\alpha$ and let $\beta=\alpha/a$. If $\beta$ is a unit, we are done, since the units of $\beta$ are given by Proposition \ref{funfacts}. Otherwise, by Lemma \ref{pispbar}, we know that $\langle\beta\rangle$ factors as $\mathfrak{p}_1\cdots\mathfrak{p}_r$, where each $\mathfrak{p}_i$ is a distinct prime ideal satisfying $\mathfrak{p}_i=\bar{\mathfrak{p}}_i$. Since $a$ is the largest integer factor of $\alpha$, $\mathfrak{p}_i$ cannot be a principal ideal generated by a rational prime and is therefore ramified. Thus $\langle\beta\rangle$ satisfies the conditions of Lemma \ref{whatsbeta}, so $\beta$ is an associate of $\sqrt{d}$ or, in the case that $d=-1$, an associate of $1+i$.
In summary, $\langle\alpha\rangle$ must factor as either $\langle a\rangle$, $\langle a\rangle\langle\sqrt{d}\rangle$, or $\langle a\rangle\langle1+i\rangle$, with $a$ an integer. Thus, $\alpha/a$ is a unit times $1$, $\sqrt{d}$, or $1+i$. The units of $\mathcal{O}_d$ are $\pm1$, $\pm i$ for $d=-1$, and $\frac{\pm1\pm\sqrt{-3}}{2}$ for $d=-3$. The theorem follows (note that $\frac{3\pm\sqrt{-3}}{2}$ is an associate of $\sqrt{-3}$).
\end{proof}
In Figures \ref{Zipicture}, \ref{Z3picture}, and \ref{Z2picture}, the points $\alpha$ lying along a black line are exactly the points that satisfy $\alpha^n=c$ for some $n\in\mathbb{Z}^+$ and $c\in\mathbb{Z}$.
\begin{thm}[Generalized Niven's theorem]
Let $\theta\in\pi\mathbb{Q}$. If $\tan^2\theta$ is rational, then $\theta$ is an integer multiple of $\pi/6$ or $\pi/4$. The same result holds for $\sin^2\theta$ and $\cos^2\theta$.
\end{thm}
\begin{proof}
Suppose $\tan^2\theta$ is rational, where $\theta=\pi m/n$ is a rational multiple of $\pi$. Then $\tan\theta=b\sqrt{d}/a$, with $a,b,d\in\mathbb{Z}$ and $d>0$ square-free. Let $\alpha=a+ib\sqrt{d}$. We have $\alpha=\pm re^{i\pi m/n}$ where $r=\sqrt{a^2+db^2}$, so $\alpha^n=(\pm r)^ne^{i\pi m}=(-1)^m(\pm r)^n$. Then $\alpha^n$ is a real number and is in $\mathcal{O}_{-d}$ and is therefore an integer. By Theorem \ref{general}, $\alpha$ is a rational number times one of $1$, $1\pm i$, $1\pm\sqrt{-3}$, or $3\pm\sqrt{-3}$. Thus $\theta$ is an integer multiple of $\pi/6$ or $\pi/4$.
This result can be extended to $\sin$ and $\cos$ using the identity $\tan^2\theta+1=\sec^2\theta$. Suppose $\cos^2\theta$ is rational with $\theta\in\pi\mathbb{Q}$. Then $\tan^2\theta=1-1/\cos^2\theta$ is rational, so $\theta$ is an integer multiple of $\pi/6$ or $\pi/4$. (Note that this argument does not work for $\theta$ that are odd multiples of $\pi/2$; however, $\cos(\pi/2)=0$ is rational.) The result holds for $\sin$ since $\sin(\pi/2-\theta)=\cos\theta$.
\end{proof}
\section{Combinatorial Identities}\label{sec:comb}
We end with a discussion of certain combinatorial identities that may be derived from our result. Specifically, the equations
\begin{align*}
(1+i)^4&=-4,\\
\left(1+\sqrt{-3}\right)^3&=-8,\\
\left(3+\sqrt{-3}\right)^6&=-1728,
\end{align*}
together with the binomial theorem (taking real and imaginary parts of the resulting sum) provide the following six combinatorial identities:
\begin{center}
\begin{tabular}{c|c|c}
$\displaystyle(1+i)^{4n}$&$\displaystyle\sum_{k=0}^{2n}\binom{4n}{2k}(-1)^k=(-4)^n$&$\displaystyle\sum_{k=0}^{2n-1}\binom{4n}{2k+1}(-1)^k=0$\\
\hline
$\displaystyle\left(1+\sqrt{-3}\right)^{3n}$&$\displaystyle\sum_{k=0}^{\lfloor3n/2\rfloor}\binom{3n}{2k}(-3)^k=(-8)^n$&$\displaystyle\sum_{k=0}^{\lceil3n/2\rceil-1}\binom{3n}{2k+1}(-3)^k=0$\\
\hline
$\displaystyle\left(3+\sqrt{-3}\right)^{6n}$&$\displaystyle\sum_{k=0}^{3n}\binom{6n}{2k}(-1)^k3^{6n-k}=(-1728)^n$&$\displaystyle\sum_{k=0}^{3n-1}\binom{6n}{2k+1}(-1)^k3^{6n-k-1}=0$
\end{tabular}
\end{center}
This suggests a general method of deriving combinatorial identities from complex identities; however, Theorem \ref{general} shows that these are essentially the only examples.
\begin{thebibliography}{1}
\bibitem{bcg}
Curtis~D. Bennett, A.~M.~W. Glass, and G{\'a}bor~J. Sz{\'e}kely.
\newblock Fermat's last theorem for rational exponents.
\newblock {\em American Mathematical Monthly}, 111(4):322--329, 2004.
\newblock \url{https://www.jstor.org/stable/4145241}.
\bibitem{quadratic}
Keith Conrad.
\newblock Factoring in quadratic fields.
\newblock
\url{https://kconrad.math.uconn.edu/blurbs/gradnumthy/quadraticgrad.pdf}.
\bibitem{jahnel}
J{\"o}rg Jahnel.
\newblock When is the (co)sine of a rational angle equal to a rational number?
\newblock 2010.
\newblock \url{https://arxiv.org/abs/1006.2938}.
\bibitem{kraftwash}
James~S. Kraft and Lawrence~C. Washington.
\newblock {\em An Introduction to Number Theory with Cryptography}.
\newblock CRC Press, 2nd edition, 2018.
\bibitem{lehmer}
D.~H. Lehmer.
\newblock A note on trigonometric algebraic numbers.
\newblock {\em American Mathematical Monthly}, 40(3):165--166, 1933.
\newblock \url{https://www.jstor.org/stable/2301023}.
\bibitem{niven}
Ivan Niven.
\newblock {\em Irrational Numbers}.
\newblock The Mathematical Association of America, 1956.
\bibitem{olmsted}
J.~M.~H. Olmsted.
\newblock Rational values of trigonometric functions.
\newblock {\em American Mathematical Monthly}, 52(9):507--508, 1945.
\newblock \url{https://www.jstor.org/stable/2301023}.
\bibitem{schaumberger}
Norman Schaumberger.
\newblock A classroom theorem on trigonomtric irrationalities.
\newblock {\em Two-Year College Mathematics Journal.}, 5(1):73--76, 1974.
\newblock \url{https://www.jstor.org/stable/3026991}.
\bibitem{stewtall}
Ian Stewart and David Tall.
\newblock {\em Algebraic Number Theory and Fermat's Last Theorem}.
\newblock AK Peters, Ltd., 3rd edition, 2002.
\end{thebibliography}
\end{document}