\magnification=\magstep1
\input amstex
\documentstyle{amsppt}
\pagewidth{13.8truecm}\hcorrection{0.85cm}
\pageheight{22.5truecm}%\vcorrection{1.83cm}
\TagsOnLeft
\topmatter
\title
Three classical results on representations of a number
\endtitle
\author
  Michael D. Hirschhor
\endauthor
%\date
%November 9, 1998
% \enddate
\endtopmatter
\document


\def\mysec#1{\bigskip\centerline{\bf #1}\message{ * }\nopagebreak\par}
\def\subsec#1{\medskip{\it\noindent #1}\nopagebreak\par}
\def\myref#1{\item"{[{\bf #1}]}"}

\bigskip
{%\openup 1\jot   
\mysec{Introduction}
\medskip
Three classical results concern the number of representations of the positive integer $n$ in the form $x^2+3y^2$ with $x,y\in\Bbb{Z}$, the form $(x^2+x)/2+3(y^2+y)/2$ with $x,y\in\Bbb{Z}^+$ and the form $x^2+xy+y^2$ with $x,y\in\Bbb{Z}$.
\smallskip
\noindent Indeed, if $s(n),\ t(n)$ and $u(n)$ respectively denote the three numbers, then
$$
s(n)=2\Big (d_{1,3}(n)-d_{2,3}(n)\Big )+4\Big (d_{4,12}(n)-d_{8,12}(n)\Big ),\tag{1}
$$
$$
t(n)=d_{1,3}(2n+1)-d_{2,3}(2n+1)\tag{2}
$$
and 
$$
u(n)=6\Big (d_{1,3}(n)-d_{2,3}(n)\Big ).\tag{3}
$$
where $d_{r,m}(n)$ is the number of divisors $d$ of $n$ with $d\equiv r\pmod{m}$.
\smallskip
\noindent(1) is equivalent to the $q$-series identity
$$
\align
\sum_{m,n\in\Bbb{Z}}q^{m^2+3n^2}=1&+2\sum_{n\ge0}\left (\frac{q^{3n+1}}{1-q^{3n+1}}-\frac{q^{3n+2}}{1-q^{3n+2}}\right )\\
&\qquad\qquad\qquad\qquad+4\sum_{n\ge0}\left (\frac{q^{12n+4}}{1-q^{12n+4}}-\frac{q^{12n+8}}{1-q^{12n+8}}\right )\tag{4}
\endalign
$$
or to
$$
\sum_{m,n\in\Bbb{Z}}q^{m^2+3n^2}=1+2\sum_{n\ge0}\left (\frac{q^{3n+1}}{1-(-1)^nq^{3n+1}}-\frac{q^{3n+2}}{1+(-1)^nq^{3n+2}}\right ),\tag{5}
$$
(2) is equivalent to the $q$-series identity
$$
\sum_{m,n\in{\Bbb{Z}}^+}q^{(m^2+m)/2+3(n^2+n)/2}=\sum_{n\ge0}\left (\frac{q^{3n}}{1-q^{6n+1}}-\frac{q^{3n+2}}{1-q^{6n+5}}\right )\tag{6}
$$
and (3) is equivalent to the $q$-series identity
$$
\sum_{m,n\in\Bbb{Z}}q^{m^2+mn+n^2}=1+6\sum_{n\ge0}\left (\frac{q^{3n+1}}{1-q^{3n+1}}-\frac{q^{3n+2}}{1-q^{3n+2}}\right ).\tag{7}
$$
Both (5) and (6) appear in Ramanujan's second Notebook [12, p.239], and Berndt [2, pp.223-224 and p.116] shows how they follow from Ramanujan's $_1\psi_1$ summation [12, p.196], [2, p.32]. (7) appears in Berndt and Rankin [5, p.196] and a proof is given by Berndt [3]. The reader is referred also to [6], [7], [9] and [4] for related developments and generalisations, and to [1] and [10] for applications in statistical mechanics.
\medskip
It seems that Dirichlet (1840) may have known (1), since he gives [8, p.463] the corresponding results for the forms $x^2+y^2$ and $x^2+2y^2$, and continues ``And so on in similar fashion.'' (``Et ainsi de suite.'')
\smallskip
\noindent However, Lorenz (1871) [11, p.420] states both (4) and (1), and in reference to (1) says (my translation)
``From this equation one can deduce a theorem which must be considered new in the theory of numbers because it cannot immediately be deduced from known theorems:
\medskip
If a number $N$ contains prime factors $p_1,p_2,\ \cdots$ of the form $3m+1$ with exponents $a_1,a_2,\ \cdots$ and if the prime factors of the form $3m+2$ appear to nothing but even powers, the number of solutions of the equation $m^2+3n^2=N$ is given by
$$
\rho_N=2(a_1+1)(a_2+1)\ldots
$$
if $N$ is odd and by
$$
\rho_N=6(a_1+1)(a_2+1)\ldots
$$
if $N$ is even. If, on the contrary, $N$ contains a prime factor of the form $3m+2$ to an odd power, one has $\rho_N=0$.''
\smallskip
\noindent Lorenz also [11, p.424] states (7), and a proof is provided by his reviewer/

\noindent translator Valentiner [11, p.430].
\smallskip
\noindent So perhaps credit rests with Lorenz.
\medskip
We shall give proofs of (4), (6) and (7) which demonstrate that all three results are intimately related.
\medskip
\mysec{2. Proof of the result involving $s(n)$}
\medskip
Let $a(q)$ denote the left hand side of (7). Then
$$
a(q)+2a(q^4)=3\sum_{k,l\in\Bbb{Z}}q^{k^2+3l^2}.\tag{8}
$$
For,
$$
\align
a(q)=\sum_{\scriptstyle m\ \text{odd}\atop\scriptstyle n\ \text{even}}q^{m^2+mn+n^2}+\sum_{\scriptstyle m\ \text{odd}\atop\scriptstyle n\ \text{odd}}q^{m^2+mn+n^2}&+\sum_{\scriptstyle m\ \text{even}\atop\scriptstyle n\ \text{odd}}q^{m^2+mn+n^2}\\
&\qquad+\sum_{\scriptstyle m\ \text{even}\atop\scriptstyle n\ \text{even}}q^{m^2+mn+n^2}.\\
\endalign
$$
In the first sum, let $k=m+\displaystyle\frac{n}2,\ l=\displaystyle\frac{n}2$ (and conversely, $m=k-l,\ n=2l$),

\noindent in the second sum, $k=\displaystyle\frac{m-n}2,\ l=\displaystyle\frac{m+n}2$ (conversely $m=k+l,\ n=l-k$),

\noindent in the third sum, $k=\displaystyle\frac{m}2+n,\ l=\displaystyle\frac{m}2$ (conversely $m=2l,\ n=k-l$)

\noindent and in the fourth sum, $k=\displaystyle\frac{m-n}2,\ l=\displaystyle\frac{m+n}2$ (conversely $m=k+l,\ n=l-k$), 

\noindent and we find
$$
a(q)=3\sum_{k\not\equiv l\pmod2}q^{k^2+3l^2}+\sum_{k\equiv l\pmod2}q^{k^2+3l^2}.\tag{9}
$$
Also,
$$
a(q^4)=\sum_{m,n\in\Bbb{Z}}q^{4m^2+4mn+4n^2}=\sum_{m,n\ \text{even}}q^{m^2+mn+n^2}=\sum_{k\equiv l\pmod2}q^{k^2+3l^2},\tag{10}
$$
as with the fourth sum above. (8) follows from (9) and (10). (4) follows from (7) and (8).
\medskip
\mysec{3. Proof of the result involving $t(n)$}
\medskip
We can write (4)
$$
\align
\sum_{k,l\in\Bbb{Z}}q^{k^2+3l^2}=1&+2\sum_{n\ge0}\left (\frac{q^{6n+1}}{1-q^{12n+2}}-\frac{q^{6n+5}}{1-q^{12n+10}}\right )\\
&\qquad\qquad\qquad\qquad+6\sum_{n\ge0}\left (\frac{q^{12n+4}}{1-q^{12n+4}}-\frac{q^{12n+8}}{1-q^{12n+8}}\right ).
\endalign
$$
If we extract the even powers of $q$ we obtain
$$
\sum_{k\equiv l\pmod2}q^{k^2+3l^2}=1+6\sum_{n\ge0}\left (\frac{q^{12n+4}}{1-q^{12n+4}}-\frac{q^{12n+8}}{1-q^{12n+8}}\right ).\tag{11}
$$
(Note, incidentally, that (7) follows from (10) and (11), and that (11) follows from (7) and (10)!)
\smallskip
\noindent From (11) we deduce
$$
\sum_{k,l\in\Bbb{Z}}q^{k^2+3l^2}+4q\sum_{k,l\in{\Bbb{Z}}^+}q^{k^2+k+3l^2+3l}=1+6\sum_{n\ge0}\left (\frac{q^{3n+1}}{1-q^{3n+1}}-\frac{q^{3n+2}}{1-q^{3n+2}}\right ).\tag{12}
$$
\noindent If we subtract (4) from (12) we find
$$
\align
4q\sum_{k,l\in{\Bbb{Z}}^+}q^{k^2+k+3l^2+3l}
&=4\sum_{n\ge0}\left (\frac{q^{3n+1}}{1-q^{3n+1}}-\frac{q^{3n+2}}{1-q^{3n+2}}\right )\tag{13}\\
&\qquad\qquad\qquad\qquad-4\sum_{n\ge0}\left (\frac{q^{12n+4}}{1-q^{12n+4}}-\frac{q^{12n+8}}{1-q^{12n+8}}\right )\\
&=4\sum_{n\ge0}\left (\frac{q^{6n+1}}{1-q^{12n+2}}-\frac{q^{6n+5}}{1-q^{12n+10}}\right ).\\
\\
\endalign
$$
Finally, if we divide (13) by $4q$ and replace $q^2$ by $q$ we obtain (6).
\medskip
\mysec{4. Proof of the result involving $u(n)$}
\medskip
We begin by showing that
$$
\sum_{m,n\in\Bbb{Z}}\omega^{m-n}q^{m^2+mn+n^2}=\frac{(q)_\infty^3}{(q^3)_\infty}\tag{14}
$$
where $\omega^3=1,\ \omega\not=1$.
\smallskip
\noindent Let $\text{\bf {CT}}_a\left\{\sum_{-\infty}^\infty a^nf_n(q)\right\}$ denote $f_0(q)$, the ``{\bf{C}}onstant {\bf {T}}erm'' of the Laurent series in $a$. Then
$$
\allowdisplaybreaks
\align
\sum_{m,n\in\Bbb{Z}}&\omega^{m-n}q^{m^2+mn+n^2}=\sum_{m+n+p=0}\omega^{m-n}q^{(m^2+n^2+p^2)/2}\\
&=\text{\bf {CT}}_a\left\{\sum_{-\infty}^\infty a^m\omega^mq^{m^2/2}\sum_{-\infty}^\infty a^n\omega^{-n}q^{n^2/2}\sum_{-\infty}^\infty a^pq^{p^2/2}\right\}\\
&=\text{\bf {CT}}_a\left\{\prod_{n\ge1}(1+a\omega q^{n-\frac12})(1+a^{-1}\omega^{-1}q^{n-\frac12})(1-q^n).\right.\\
&\qquad\qquad\left..\prod_{n\ge1}(1+a\omega^{-1}q^{n-\frac12})(1+a^{-1}\omega q^{n-\frac12})(1-q^n).\right.\\
&\qquad\qquad\left..\prod_{n\ge1}(1+aq^{n-\frac12})(1+a^{-1}q^{n-\frac12})(1-q^n)\right\}\\
&=\text{\bf{CT}}_a\left\{\prod_{n\ge1}(1+a^3q^{3n-\frac32})(1+a^{-3}q^{3n-\frac32})(1-q^n)^3\right\}\\
&=\frac{(q)_\infty^3}{(q^3)_\infty}.\text{\bf{CT}}_a\left\{\prod_{n\ge1}(1+a^3q^{3n-\frac32})(1+a^{-3}q^{3n-\frac32})(1-q^{3n})\right\}\\
&=\frac{(q)_\infty^3}{(q^3)_\infty}.\text{\bf{CT}}_a\left\{\sum_{-\infty}^\infty a^{3n}q^{3n^2/2}\right\}\\
&=\frac{(q)_\infty^3}{(q^3)_\infty},
\endalign
$$
as claimed.
\smallskip
\noindent Now the left hand side of (14) can be written
$$
\align
\sum_{m-n\equiv0\pmod3}q^{m^2+mn+n^2}&+\omega\sum_{m-n\equiv1\pmod3}q^{m^2+mn+n^2}\\
&\qquad+\omega^{-1}\sum_{m-n\equiv{-1}\pmod3}q^{m^2+mn+n^2}.
\endalign
$$
In the first sum, let $k=\displaystyle\frac{m-n}3,\ l=\displaystyle\frac{m+2n}3$ (conversely $m=2k+l,\ n=l-k$),

\noindent in the second sum, $k=\displaystyle\frac{m-n-1}3,\ l=\displaystyle\frac{m+2n-1}3$ (conversely $m=2k+l+1,\ n=l-k$) and

\noindent in the third sum, $k=\displaystyle\frac{n-m-1}3,\ l=\displaystyle\frac{n+2m-1}3$ ($m=l-k,\ n=2k+l+1$),

\noindent and the left hand side of (14) is seen to be
$$
\allowdisplaybreaks
\align
\sum_{k,l\in\Bbb{Z}}q^{3k^2+3kl+3l^2}&+\omega\sum_{k,l\in\Bbb{Z}}q^{3k^2+3kl+3l^2+3k+3l+1}\\
&\qquad+\omega^{-1}\sum_{k,l\in\Bbb{Z}}q^{3k^2+3kl+3l^3+3k+3l+1}\\
&=a(q^3)-qc(q^3),
\endalign
$$
where 
$$
c(q)=\sum_{m,n\in\Bbb{Z}}q^{m^2+mn+n^2+m+n}.
$$
Thus (14) becomes
$$
a(q^3)-qc(q^3)=\frac{(q)_\infty^3}{(q^3)_\infty}.\tag{15}
$$
Now, it is a celebrated identity of Jacobi that
$$
(q)_\infty^3=\sum_{n\ge0}(-1)^n(2n+1)q^{(n^2+n)/2}.\tag{16}
$$
We split this sum according to the residue modulo 3 of $n$. For $n\equiv0\pmod3$, we write $3n$ ($n\ge0$), for $n\equiv1\pmod3$, we write $3n+1$ ($n\ge0$), and for $n\equiv{-1}\pmod3$ we write $-3n-1$ ($n\le{-1}$), and the right hand side of (16) becomes
$$
\align
\sum_{n\ge0}(-1)^n(6n+1)q^{(9n^2+3n)/2}&-\sum_{n\ge0}(-1)^n(6n+3)q^{(9n^2+9n+2)/2}\\
&-\sum_{n\le{-1}}(-1)^n(-6n-1)q^{(9n^2+3n)/2}\\
&\quad=\sum_{-\infty}^\infty(-1)^n(6n+1)q^{(9n^2+3n)/2}-3q(q^9)_\infty^3.
\endalign
$$
So (15) becomes
$$
a(q^3)-qc(q^3)=\frac1{(q^3)_\infty}\left\{\sum_{-\infty}^\infty(-1)^n(6n+1)q^{3(3n^2+n)/2}-3q(q^9)_\infty^3\right\}.\tag{17}
$$
It follows that
$$
a(q)=\frac1{(q)_\infty}\sum_{-\infty}^\infty(-1)^n(6n+1)q^{(3n^2+n)/2}\tag{18}
$$
and
$$
c(q)=3\frac{(q^3)_\infty^3}{(q)_\infty}.
$$
Now (18) becomes
$$
\allowdisplaybreaks
\align
a(q)&=\frac1{(q)_\infty}\left [\frac{d}{da}\sum_{-\infty}^\infty(-1)^na^{6n+1}q^{(3n^2+n)/2}\right ]_{a=1}\\
&=\frac1{(q)_\infty}\left [\frac{d}{da}\left\{a\prod_{n\ge1}(1-a^6q^{3n-1})(1-a^{-6}q^{3n-2})(1-q^{3n})\right\}\right]_{a=1}\\
&=\frac1{(q)_\infty}\left [\prod_{n\ge1}(1-a^6q^{3n-1})(1-a^{-6}q^{3n-2})(1-q^{3n})\times\right.\\
&\qquad\qquad\left.\times\left\{1+6\sum_{n\ge1}\left (\frac{a^{-6}q^{3n-2}}{1-a^{-6}q^{3n-2}}-\frac{a^6q^{3n-1}}{1-a^6q^{3n-1}}\right )\right\}\right ]_{a=1}\\
&=\frac1{(q)_\infty}(q)_\infty\left\{1+6\sum_{n\ge1}\left (\frac{q^{3n-2}}{1-q^{3n-2}}-\frac{q^{3n-1}}{1-q^{3n-1}}\right )\right\}\\
&=1+6\sum_{n\ge0}\left (\frac{q^{3n+1}}{1-q^{3n+1}}-\frac{q^{3n+2}}{1-q^{3n+2}}\right )
\endalign
$$
which is (7).
\bigskip
\mysec{References}
\medskip
\noindent [1] R. J. Baxter, Some hyperelliptic function identities that occur in the chiral Potts model, J. Phys. A. Math. Gen. 31 (1998), 6806--6818.
\medskip
\noindent [2] B. C. Berndt, Ramanujan's Notebooks, Part III, Springer-Verlag, New York, 1991.
\medskip
\noindent [3] B. C. Berndt, On a certain theta-function in a letter of Ramanujan from Fitzroy House, Ganita 43 (1992), 33--43.
\medskip
\noindent [4] B. C. Berndt, S. Bhargava and F. G. Garvan, Ramanujan's theories of elliptic functions to alternative bases, Trans. Amer. Math. Soc., 347 (1995), 4163--4244.
\medskip
\noindent [5] B. C. Berndt and R. A. Rankin, Ramanujan: Letters and Commentary, History of Mathematics, Vol. 9, Amer. Math. Soc., London Math. Soc., 1995.
\medskip
\noindent [6] J. M. Borwein and P. B. Borwein, A cubic counterpart of Jacobi's identity and the AGM, Trans. Amer. Math. Soc., 323 (1991), 691--701.
\medskip
\noindent [7] J. M. Borwein, P. B. Borwein and F. G. Garvan, Some cubic modular identities of Ramanujan, Trans. Amer. Math. Soc., 343 (1994), 35--47.
\medskip 
\noindent [8]  G. Lejeune Dirichlet, Mathematische Werke, Chelsea, New York, 1969.
\medskip
\noindent [9] M. D. Hirschhorn, F. G. Garvan and J. M. Borwein, Cubic analogues of the Jacobian theta function $\theta(z,q)$, Can. J. Math., 45 (1993), 673--694.
\medskip
\noindent [10] M. D. Hirschhorn, Proofs of some hyperelliptic function identities, Bull. Austral. Math. Soc., 58 (1998), 465--468.
\medskip
\noindent [11] L. Lorenz, Oeuvres Scientifiques, Revues et annot\'ees par H. Valentiner, Tome second, la Fondation Carlsberg, Librarie Lehmann \& Stage, Copenhague, 1904.
\medskip
\noindent [12] S. Ramanujan, Notebooks (2 volumes), Tata Institute of Fundamental Research, Bombay, 1957.

\end
