# Infinite product formulae for generating functions for sequences of squares

Christian Krattenthaler† Universität Wien, Fakultät für Mathematik, Oskar-
Morgenstern-Platz 1, A-1090 Vienna, Austria. WWW:
https://www.mat.univie.ac.at/~kratt.  ,  Mircea Merca  Department of
Mathematics, University of Craiova, Craiova, Romania; Academy of Romanian
Scientists, Bucharest, Romania  and  Cristian-Silviu Radu† Research Institute
for Symbolic Computation
J. Kepler University Linz, A-4040 Linz, Austria. WWW:
https://risc.jku.at/m/cristian-silviu-radu/

###### Abstract.

We state and prove product formulae for several generating functions for
sequences $(a_{n})_{n\geq 0}$ that are defined by the property that
$Pa_{n}+b^{2}$ is a square, where $P$ and $b$ are given integers. In
particular, we prove corresponding conjectures of the second author. We show
that, by means of the Jacobi triple product identity, all these generating
functions can be reduced to a linear combination of theta function products.
The proof of our formulae then consists in simplifying these linear
combinations of theta products into single products. We do this in two ways:
(1) by the use of modular function theory, and (2) by applying the Weierstraß
addition formula for theta products.

###### Key words and phrases:

Jacobi triple product identity, Jacobi theta functions, Weierstraß relation
for theta products, modular functions

###### 2010 Mathematics Subject Classification:

Primary 11B65; Secondary 05A30, 11F27, 33D05

†Supported by the Austrian Science Foundation FWF (grant S50-N15) in the
framework of the Special Research Program “Algorithmic and Enumerative
Combinatorics”.

##  1\. Introduction

In [3, Ids. 5.1–5.6, Ids. 6.1–6.14], the second author listed several
empirically found closed form product formulae for (signed) generating
functions for certain sequences of squares. A typical example (cf. [3, Id.
6.1] and Theorem 7 below) is the following statement:

Let $(a_{n})_{n\geq 0}=(0,4,7,10,21,26,33,59,61,95,108,\dots)$ be the sequence
of non-negative integers $m$ such that $240m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q,q^{7},q^{8};q^{8})_{\infty}\,(q^{6},q^{10};q^{16})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(1.1)

Here, and in the following, $q$ is a complex number with
$|q|<1$,111Alternatively, all definitions and identities may be understood in
the sense of formal power series in $q$. and the symbol $(a;q)_{\infty}$
denotes the infinite product

$(a;q)_{\infty}:=\prod_{i=0}^{\infty}(1-aq^{i}),$

Moreover, we use the short notation

$(a_{1},a_{2},\dots,a_{m};q):=\prod_{j=1}^{m}(a_{j};q)_{\infty}.$

This paper started by the observation that, by the use of Jacobi’s triple
product identity, the proofs of all these conjectured formulae can be reduced
to the verification of certain identities between (specialised) Jacobi theta
functions. Now, it is a folklore fact that, since these theta functions are
modular functions (for certain subgroups of
$\operatorname{SL}_{2}(\mathbb{Z})$), such identities are routinely
verifiable. This is what we did, first. Subsequently, however, we wanted to
have a conceptual understanding of the established formulae. Moreover, we were
interested in whether there is more than just these, first empirically found,
formulae from [3]. Indeed, further computer experiments led us to discover
many more such formulae, but still of sporadic nature. Nevertheless,
altogether, they helped us to come up with two parametric theorems that
subsume several of the earlier empirically found formulae under one roof.
Obviously, parametric theorems cannot be routinely verified anymore. Rather we
found that Weierstraß’ three-term relation between theta products is the
“magic” identity that is behind all of our formulae. More precisely, (aside
from four formulae that are direct consequences of the Jacobi triple product
identity) for one class of formulae the verification consists in a single
application of Weierstraß’ relation which reduces the sum of two theta
products to a single theta product, while for a second class of formulae the
verification requires first a double application of the triple product
identity to reduce the sum of four theta products to the sum of two theta
products, and then another application to reduce the latter to a single theta
product. Our parametric theorems belong both to the first class. At this point
in time, we are not able to offer a conceptual understanding for our proofs
for the second class of formulae in the sense that we were not able to embed
these into parametric families of formulae. Rather, we performed some computer
assisted searches for more formulae in the second class that remained
unsuccessful, suggesting that there may not be parametric families in the
second class but only these sporadic formulae.

Our paper is structured as follows. In the next section we collect the
empirically found identities from [3]. (We have slightly altered the order in
which they are presented in order to provide a more systematic listing.) They
become theorems by the proofs in Sections 7 and 9. Section 3 lists the
additional identities that we found by our computer experiments subsequent to
the publication of [3]. The first step in all our proofs is to apply Jacobi’s
triple product identity that converts the left-hand sides of our identities
into a linear combination of products of theta functions. We recall Jacobi’s
identity in Section 4, where we also derive two (well-known) corollaries that
we need in some of the proofs. There follows another section of preparatory
character, namely Section 5, in which facts from the theory of modular
functions are collected that are relevant in our context. Based on them, we
explain in Section 6 how to routinely verify identities between theta
products. In the subsequent section, Section 7, we apply this methodology to
prove all the theorems from Sections 2 and 3 (with the exception of the
theorems that are special cases of parametric families). We provide full
details for Theorem 1, while for all other theorems proofs are given in a
stenographic fashion since the pattern is always the same. Section 8 is again
preparatory. There, we recall the earlier mentioned Weierstraß’ addition
formula, and two of its corollaries that we shall use particularly frequently.
Then, in Section 9, we present our proofs of all theorems from Sections 2 and
3 (again with the exception of the theorems that are special cases of
parametric families) by the use of the Weierstraß relation. Again, we give
full details for the proof of Theorem 1, while for all other theorems proofs
are presented only in an abridged fashion. The contents of Section 10 are two
parametric families of formulae of the type as in (1.1); one of them consists
in Theorem 34 and Corollary 35 (although these contain different statements,
their proofs are the same), and the other in Theorem 36 and Corollary 37
(again, these contain different statements, but their proofs are the same).
Finally, in Theorem 38 we unify the statements of Theorems 31 and 32, and we
provide a uniform proof. We close the article by mentioning some consequences
and open problems in Section 11.

##  2\. Generating functions for sequences of squares

Here, we list the empirically found formulae for generating functions for
sequences of squares from [3]. They become theorems by the proofs in Sections
7 and 9, respectively.

######  Theorem 1 (conjectured in [3, Id. 5.1]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$840m+361$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q,q^{6},q^{7};q^{7})_{\infty}}{(q,q^{4};q^{5})_{\infty}},$
(2.1)

where

$t(n)=\begin{cases}0,&\text{if }n\equiv 0,1,3,5,10,12,14,15\ (\text{\em mod
}16),\\\ 1,&\text{otherwise.}\end{cases}$

######  Theorem 2 (conjectured in [3, Id. 5.2]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$840m+529$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q,q^{6},q^{7};q^{7})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}},$
(2.2)

where

$t(n)=\begin{cases}0,&\text{if }n\equiv 0,2,3,6,9,12,13,15\ (\text{\em mod
}16),\\\ 1,&\text{otherwise.}\end{cases}$

######  Theorem 3 (conjectured in [3, Id. 5.3, corrected]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$840m+121$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+4)/8\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{5},q^{7};q^{7})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.3)

######  Theorem 4 (conjectured in [3, Id. 5.4]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$840m+289$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q^{2},q^{5},q^{7};q^{7})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}},$
(2.4)

where

$t(n)=\begin{cases}0,&\text{if }n\equiv 0,1,3,5,10,12,14,15\ (\text{\em mod
}16),\\\ 1,&\text{otherwise.}\end{cases}$

######  Theorem 5 (conjectured in [3, Id. 5.5, corrected]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$840m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+4)/8\right\rfloor}q^{a_{n}}=\frac{(q^{3},q^{4},q^{7};q^{7})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.5)

######  Theorem 6 (conjectured in [3, Id. 5.6]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$840m+169$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q^{3},q^{4},q^{7};q^{7})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}},$
(2.6)

where

$t(n)=\begin{cases}0,&\text{if }n\equiv 0,1,2,4,11,13,14,15\ (\text{\em mod
}16),\\\ 1,&\text{otherwise.}\end{cases}$

######  Theorem 7 (conjectured in [3, Id. 6.1, corrected]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$240m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q,q^{7},q^{8};q^{8})_{\infty}\,(q^{6},q^{10};q^{16})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.7)

######  Theorem 8 (conjectured in [3, Id. 6.2]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$240m+49$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q,q^{7},q^{8};q^{8})_{\infty}\,(q^{6},q^{10};q^{16})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(2.8)

######  Theorem 9 (conjectured in [3, Id. 6.5, corrected]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$240m+121$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{3},q^{5},q^{8};q^{8})_{\infty}\,(q^{2},q^{14};q^{16})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.9)

######  Theorem 10 (conjectured in [3, Id. 6.6]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$240m+169$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q^{3},q^{5},q^{8};q^{8})_{\infty}\,(q^{2},q^{14};q^{16})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(2.10)

######  Theorem 11 (conjectured in [3, Id. 6.3, corrected]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$15m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{6},q^{8};q^{8})_{\infty}\,(q^{4},q^{12};q^{16})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.11)

######  Theorem 12 (conjectured in [3, Id. 6.4, corrected]).

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$15m+4$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{6},q^{8};q^{8})_{\infty}\,(q^{4},q^{12};q^{16})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(2.12)

######  Theorem 13 (conjectured in [3, Id. 6.7]).

We have

$\sum_{n=-\infty}^{\infty}q^{n(5n+1)}=\frac{(q,q^{9},q^{10};q^{10})_{\infty}\,(q^{8},q^{12};q^{20})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.13)

######  Theorem 14 (conjectured in [3, Id. 6.8]).

We have

$\sum_{n=0}^{\infty}\big{(}q^{n(n+1)}-q^{5n(n+1)+1}\big{)}=\frac{(q,q^{9},q^{10};q^{10})_{\infty}\,(q^{8},q^{12};q^{20})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(2.14)

######  Theorem 15 (conjectured in [3, Id. 6.9]).

We have

$1+\sum_{n=1}^{\infty}\big{(}q^{n^{2}}+q^{5n^{2}}\big{)}=\frac{(q^{2},q^{8},q^{10};q^{10})_{\infty}\,(q^{6},q^{14};q^{20})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.15)

######  Theorem 16 (conjectured in [3, Id. 6.10]).

We have

$\sum_{n=-\infty}^{\infty}q^{n(5n+2)}=\frac{(q^{2},q^{8},q^{10};q^{10})_{\infty}\,(q^{6},q^{14};q^{20})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(2.16)

######  Theorem 17 (conjectured in [3, Id. 6.11]).

We have

$\sum_{n=0}^{\infty}\big{(}q^{n(n+1)}+q^{5n(n+1)+1}\big{)}=\frac{(q^{3},q^{7},q^{10};q^{10})_{\infty}\,(q^{4},q^{16};q^{20})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.17)

######  Theorem 18 (conjectured in [3, Id. 6.12]).

We have

$\sum_{n=-\infty}^{\infty}q^{n(5n+3)}=\frac{(q^{3},q^{7},q^{10};q^{10})_{\infty}\,(q^{4},q^{16};q^{20})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(2.18)

######  Theorem 19 (conjectured in [3, Id. 6.13]).

We have

$\sum_{n=-\infty}^{\infty}q^{n(5n+4)}=\frac{(q^{4},q^{6},q^{10};q^{10})_{\infty}\,(q^{2},q^{18};q^{20})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(2.19)

######  Theorem 20 (conjectured in [3, Id. 6.14]).

We have

$\sum_{n=1}^{\infty}\big{(}q^{n^{2}-1}-q^{5n^{2}-1}\big{)}=\frac{(q^{4},q^{6},q^{10};q^{10})_{\infty}\,(q^{2},q^{18};q^{20})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(2.20)

##  3\. More generating functions for sequences of squares

In this section, we collect the additional formulae for generating functions
for sequences of squares that we found when we started our work on this kind
of identities. Also these become theorems by the proofs in Sections 7 and 9,
respectively.

######  Theorem 21.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$120m+49$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q,q^{4},q^{5};q^{5})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$
(3.1)

######  Theorem 22.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$120m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{3},q^{5};q^{5})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$
(3.2)

######  Theorem 23.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$168m+121$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q,q^{6},q^{7};q^{7})_{\infty}}{(q^{3},q^{4};q^{7})_{\infty}}.$
(3.3)

######  Theorem 24.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$168m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{5},q^{7};q^{7})_{\infty}}{(q,q^{6};q^{7})_{\infty}}.$
(3.4)

######  Theorem 25.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$168m+25$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{3},q^{4},q^{7};q^{7})_{\infty}}{(q^{2},q^{5};q^{7})_{\infty}}.$
(3.5)

######  Theorem 26.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$48m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{6},q^{8};q^{8})_{\infty}}{(q,q^{7};q^{8})_{\infty}}.$
(3.6)

######  Theorem 27.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$48m+25$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{6},q^{8};q^{8})_{\infty}}{(q^{3},q^{5};q^{8})_{\infty}}.$
(3.7)

######  Theorem 28.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$21m+1$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q,q^{6},q^{7};q^{7})_{\infty}(q^{5},q^{9};q^{14})_{\infty}}{(q,q^{3};q^{4})_{\infty}}.$
(3.8)

######  Theorem 29.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$21m+4$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{2},q^{5},q^{7};q^{7})_{\infty}(q^{3},q^{11};q^{14})_{\infty}}{(q,q^{3};q^{4})_{\infty}}.$
(3.9)

######  Theorem 30.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$21m+16$ is a square. Then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q^{3},q^{4},q^{7};q^{7})_{\infty}(q,q^{13};q^{14})_{\infty}}{(q,q^{3};q^{4})_{\infty}}.$
(3.10)

######  Theorem 31.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$16m+1$ is a square. Then

$\sum_{n=0}^{\infty}q^{a_{n}}=\frac{(q,q^{7},q^{8};q^{8})_{\infty}(q^{6},q^{10};q^{16})_{\infty}}{(q,q^{3};q^{4})_{\infty}}.$
(3.11)

######  Theorem 32.

Let $(a_{n})_{n\geq 0}$ be the sequence of non-negative integers $m$ such that
$16m+9$ is a square. Then

$\sum_{n=0}^{\infty}q^{a_{n}}=\frac{(q^{3},q^{5},q^{8};q^{8})_{\infty}(q^{2},q^{14};q^{16})_{\infty}}{(q,q^{3};q^{4})_{\infty}}.$
(3.12)

##  4\. The Jacobi triple product identity and two of its consequences

The Jacobi triple product identity says that (cf. [2, Eq. (1.6.1)])

$\sum_{n=-\infty}^{\infty}(-1)^{n}q^{\binom{n}{2}}z^{n}=(q,z,q/z;q)_{\infty}.$
(4.1)

Letting $q\to q^{2}$ and setting $z=-q$ in (4.1), we obtain

$\sum_{n=-\infty}^{\infty}q^{n^{2}}=(q^{2},-q,-q;q^{2})_{\infty}.$

Since we have

$\sum_{n=1}^{\infty}q^{n^{2}}=\sum_{n=-\infty}^{-1}q^{n^{2}},$

the previous identity implies

$\sum_{n=1}^{\infty}q^{n^{2}}=\frac{1}{2}\big{(}(q^{2},-q,-q;q^{2})_{\infty}-1\big{)}.$
(4.2)

On the other hand, letting $q\to q^{2}$ and setting $z=-q^{2}$ in (4.1), we
obtain

$\sum_{n=-\infty}^{\infty}q^{n^{2}+n}=2\,(q^{2},-q^{2},-q^{2};q^{2})_{\infty}$

Since we have

$\sum_{n=0}^{\infty}q^{n^{2}+n}=\sum_{n=-\infty}^{-1}q^{n^{2}+n},$

the previous identity implies

$\sum_{n=0}^{\infty}q^{n^{2}+n}=(q^{2},-q^{2},-q^{2};q^{2})_{\infty}.$ (4.3)

##  5\. Background on modular functions

In this section, we give a brief introduction to modular functions, tailored
to our purposes. Let $\mathbb{H}:=\\{x\in\mathbb{C}:\mbox{Im}(x)>0\\}$ denote
the upper half plane. Roughly speaking, modular functions are (certain)
meromorphic functions on $\mathbb{H}$ that are invariant under the action of a
subgroup $\Gamma$ of $\operatorname{SL}_{2}(\mathbb{Z})$. In our setting,
$\Gamma=\Gamma_{1}(N)$ and $N>2$, where

$\Gamma_{1}(N):=\left\\{\begin{pmatrix}a&b\\\
c&d\end{pmatrix}\in\operatorname{SL}_{2}(\mathbb{Z}):a,d\equiv 1~{}(\text{mod
}N)\text{ and }c\equiv 0~{}(\text{mod }N)\right\\}.$

The crucial fact on which we base the “methodology” explained in the next
section, is the following proposition (cf. [4, Prop. 4.12]).

######  Proposition 33.

Let $f$ be a non-constant meromorphic function on a compact Riemann surface
$X$. Then

$\sum_{p\in X}\operatorname{ord}_{p}(f)=0,$

where $\operatorname{ord}_{p}(f)$ is the order of the Laurent series expansion
of $f$ about the point $p$.

For $\gamma=\left(\begin{smallmatrix}a&b\\\ c&d\end{smallmatrix}\right)$ and
$\tau\in\mathbb{H}$ we define $\gamma\tau:=\frac{a\tau+b}{c\tau+d}$. For a
subgroup $\Gamma$ of $\operatorname{SL}_{2}(\mathbb{Z})$, we let

$A(\Gamma):=\\{\text{$f$ meromorphic on $\mathbb{H}$}:\text{
$f(\gamma\tau)=f(\tau)$ for all $\gamma\in\Gamma$ and
$\tau\in\mathbb{H}$}\\}.$

A function $f\in A(\Gamma_{1}(N))$ can be viewed as a meromorphic function
$\tilde{f}$ on the Riemann surface
$\mathbb{H}/\Gamma_{1}(N):=\\{[\tau]:\tau\in\mathbb{H}\\}$. Here,
$[\tau]:=\\{\gamma\tau:\gamma\in\Gamma_{1}(N)\\}$ denotes the orbit of
$\tau\in\mathbb{H}$ under the action of the group $\Gamma_{1}(N)$, and
$\tilde{f}([\tau]):=f(\tau)$. One equips $\mathbb{H}/\Gamma_{1}(N)$ with the
quotient topology so that it is a topological space. To make
$\mathbb{H}/\Gamma_{1}(N)$ into a Riemann surface, we follow the recipe in [5,
Sec. 1.8] (cf. also [6]). Then $\tilde{f}$ becomes a meromorphic function on
$\mathbb{H}/\Gamma_{1}(N)$. However, as we shall explain in Section 6, we want
to use Proposition 33, which is an assertion on meromorphic functions on a
compact Riemann surface. In other words, we would need
$\mathbb{H}/\Gamma_{1}(N)$ to be compact, which it is not. So we need to add
some points in order to make it compact. In order to achieve this, we define
$\mathbb{H}^{*}:=\mathbb{H}\cup\mathbb{Q}\cup\\{i\infty\\}$. We extend the
action of $\gamma=\left(\begin{smallmatrix}a&b\\\ c&d\end{smallmatrix}\right)$
to $\mathbb{H}^{*}$ as follows. For $\frac{s}{t}\in\mathbb{Q}$, we let
$\gamma\frac{s}{t}:=\frac{a(s/t)+b}{c(s/t)+d}$ if $c(s/t)+d\neq 0$ and
$\gamma\frac{s}{t}:=i\infty$ otherwise. Moreover, we let
$\gamma(i\infty)=\frac{a}{c}$ if $c\neq 0$ and $\gamma(i\infty):=i\infty$
otherwise. Then
$\mathbb{H}^{*}/\Gamma_{1}(N):=\\{[\tau]:\tau\in\mathbb{H}^{*}\\}$ is a
compact topological space when equipped with the quotient topology. More
precisely, the topology of $\mathbb{H}^{*}$ is generated by the topology of
$\mathbb{H}$ (which inherits the standard topology in $\mathbb{C}$) and the
sets $U_{M}:=\\{x\in\mathbb{H}:\mbox{Im}(x)>M\\}\cup\\{i\infty\\}$, and the
sets $\gamma U_{M}$ for all $\gamma\in\operatorname{SL}_{2}(\mathbb{Z})$,
where $M$ is a positive real number.

In particular $X_{1}(N):=\mathbb{H}^{*}/\Gamma_{1}(N)$ is made into a Riemann
surface following the recipe given in [5, Sec. 1.8] (cf. also [6]). Again,
this creates a problem: for a function $f\in A(\Gamma_{1}(N)$, the
corresponding function $\tilde{f}$ on the quotient space is not necessarily
meromorphic on $X_{1}(N)$. The problematic points are the cusps
$\\{[s/t]:s/t\in\mathbb{Q}\cup\\{i\infty\\}\\}$. Given a function $f\in
A(\Gamma_{1}(N))$, in order for $\tilde{f}$ to be meromorphic on $X_{1}(N)$,
we need that, for each reduced fraction $\frac{a}{c}\in\mathbb{Q}$, $f$ can be
expressed as a Laurent series with finite principal part in powers of
$e^{\frac{2\pi i\gamma^{-1}\tau}{h_{c}}}$. Here, $h_{c}:=N/\gcd(c,N)$ is
called the width of the cusps $a/c$. When these additional conditions are
satisfied we say that $f$ is a modular function for the group $\Gamma_{1}(N)$,
and we write $f\in M(\Gamma_{1}(N))$. In particular, $f\in M(\Gamma_{1}(N))$
implies that $\tilde{f}$ is meromorphic on $X_{1}(N)$. Furthermore,
$\operatorname{ord}_{[a/c]}\tilde{f}$ equals the order of the Laurent series
of $f$ in powers of $e^{\frac{2\pi i\gamma^{-1}\tau}{h_{c}}}$. For an
arbitrary function $f\in M(\Gamma_{1}(N))$, the order of $\tilde{f}$ at a
point $[\tau_{0}]$ for $\tau_{0}\in\mathbb{H}$ is $t$, where $t$ is the order
of $f$ when expanded in powers of $\tau-\tau_{0}$.

##  6\. How to “mechanically” prove theta function identities

Let us fix a positive modulus $N>2$. For $g\in\\{0,\dots,N-1\\}$ define

$E_{g}=E_{g}(q;N):=q^{NB_{2}(g/N)/2}(q^{g},q^{N-g};q^{N})_{\infty},$ (6.1)

where $B_{2}(x)=x^{2}-x+\frac{1}{6}$ is the second Bernoulli polynomial. The
function $E_{g}$ is essentially a (specialised) Jacobi theta function, the
“essentially” referring to the missing factor $(q^{N};q^{N})_{\infty}$. In the
following we explain how identities of the form

$\sum_{j=1}^{r}c_{j}\prod_{g}E_{g}^{a_{g}^{(j)}}=0,$ (6.2)

where the $c_{j}$’s are complex numbers and the $a_{g}^{(j)}$’s are integers,
can be routinely verified if each summand in the sum above is a modular
function for the group $\Gamma_{1}(N)$. It should be noted that the left-hand
side of (6.2) is a linear combination of theta products.

Now, to verify the identity (6.2), the following steps have to be performed.
For convenience, in the following we write LHS for the left-hand side of
(6.2).

Step 1. According to [8, Prop. 3], $\prod_{g}E_{g}^{a_{g}}(q;N)$ is a modular
function in $\tau$ for the group $\Gamma_{1}(N)$, where $q=e^{2\pi i\tau}$,
that is, $\prod_{g}E_{g}^{a_{g}}$ is an element of $M(\Gamma_{1}(N))$ if

$\sum_{g}a_{g}\equiv 0\pmod{12}\quad\text{ and }\quad\sum_{g}g^{2}a_{g}\equiv
0\pmod{y(N)},$ (6.3)

where $y(N)=2N$ if $N$ is even, and $y(N)=N$ if $N$ is odd. We use this
criterion in LHS for each summand in order to check that each summand is a
modular function for $\Gamma_{1}(N)$.

Step 2. Representatives of the cusps for the group $\Gamma_{1}(N)$ are
computed. (There are only finitely many.) The computer algebra programme Magma
provides an implementation in form of the function Cusps(Gamma1($N$)).

Step 3. For each (representative of a) cusp — except $i\infty$, $c$ say, and
$j=1,2,\dots,r$, the order of the function $\prod_{g}E_{g}^{a_{g}^{(j)}}$ at
$c$ has to be computed. According to [8, Prop. 4], the order
$\operatorname{ord}(E_{g};c,N)$ of the function $E_{g}$ at the cusp $c$ of the
group $\Gamma_{1}(N)$ is given by

$\operatorname{ord}(E_{g};c,N)=\frac{1}{2}\gcd(D_{c},N)B_{2}(\\{N_{c}g/\gcd(D_{c},N)\\}),$
(6.4)

where $D_{c}$ is the denominator of $c$ and $N_{c}$ is the numerator of $c$,
while $\\{\alpha\\}$ denotes the fractional part of the rational number
$\alpha$. The order of $\prod_{g}E_{g}^{a_{g}^{(j)}}$ at $c$ then is

$\sum_{g}a_{g}^{(j)}\operatorname{ord}(E_{g};c,N).$

Step 4. We obtain a lower bound on the order of LHS at $c$ by taking the
minimum of the orders of the individual summands of the sum in LHS.

Step 5. By Proposition 33, if $LHS$ is not identically zero, then the sum of
all the orders equals zero. Hence, (again assuming that $LHS$ is not
identically zero) for the function $\widetilde{LHS}$ on the compact Riemann
surface $X_{1}(N)$, we have

$0=\operatorname{ord}_{[i\infty]}(\widetilde{LHS})+\sum_{\text{$[c]$, $c$ a
cusp,
$[c]\neq[i\infty]$}}\operatorname{ord}_{[c]}(\widetilde{LHS})+\sum_{\text{$[p]$,
$p$ not a cusp}}\operatorname{ord}_{[p]}(\widetilde{LHS}).$

If we sum all the lower bounds that we found in Step 4 over all the cusps
different from $i\infty$, then we obtain a lower bound, $-U$ say, on the first
sum in the above expression. Furthermore, from the definition of the function
$E_{g}$ it is obvious that it cannot have a singularity at a point
$p\in\mathbb{H}$, and thus the order of $E_{g}$ at $p$ is non-negative. This
implies directly that the orders $\operatorname{ord}_{[p]}(\widetilde{LHS})$
are non-negative, yielding the lower bound $0$ on the second sum. Everything
combined, we see that $\operatorname{ord}_{[i\infty]}(\widetilde{LHS})\leq U$.

Step 6. We now verify by direct computation that LHS has the power series
expansion $0+0q+\dots+0q^{U}+\cdots$. This says that
$\operatorname{ord}_{[i\infty]}(\widetilde{LHS})>U$ (the reader should recall
that, under the relation $q=e^{2\pi i\tau}$, the point $\tau=i\infty$
corresponds to $q=0$), a contradiction to our finding in Step 5 under the
assumption that $LHS$ is not identically zero. Consequently, LHS must be the
zero function.

##  7\. “Mechanical” proofs

This section is devoted to the presentation of the proofs of the theorems in
Sections 2 and 3 that are based on the procedure outlined in the previous
section. We provide full details for the proof of Theorem 1, while we remain
brief for the proofs of the other theorems, all of them being completely
analogous. For the theorems which are specialisations of the parametric
theorems in Section 10, we refer to the proofs given there.

###### Proof of Theorem 1.

Step 0. We write the sum on the left-hand side of (2.1) explicitly, and then
apply the Jacobi triple product identity to obtain an expression that is a
linear combination of products of theta functions.

In order to accomplish this, we first observe that squares that are congruent
to $361$ modulo $840$ are of the form $S^{2}$, where $S\equiv
19,61,79,89,121,131,149,191$ $(\text{mod}~{}210)$. Consequently, taking the
definition of $t(n)$ into account, we have

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+19)^{2}-361)}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+61)^{2}-361)}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+79)^{2}-361)}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+89)^{2}-361)}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+121)^{2}-361)}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+131)^{2}-361)}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+149)^{2}-361)}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{840}((210k+191)^{2}-361)}\\\
=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{19k}{2}}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{61k}{2}+4}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{79k}{2}+7}\kern
56.9055pt\\\
+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{89k}{2}+9}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{121k}{2}+17}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{131k}{2}+20}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{149k}{2}+26}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{191k}{2}+43}.$
(7.1)

By performing the replacement $k\to-k-1$, we see that the last sum on the
right-hand side of (7.1) can be rewritten as

$\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{191k}{2}+43}=\sum_{k=-\infty}^{-1}(-1)^{k+1}q^{\frac{105k^{2}}{2}+\frac{19k}{2}}.$

Thus, it can be combined with the first sum on the right-hand side of (7.1).
This is similar for the other sums. As a result, they can be paired so that
one obtains four sums over all integers $k$:

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{19k}{2}}+\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{61k}{2}+4}\\\
-\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{79k}{2}+7}+\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{105k^{2}}{2}+\frac{89k}{2}+9}.$

Now, as announced, to each of these sums we apply the Jacobi triple product
identity (4.1) to get

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=(q^{105},q^{62},q^{43};q^{105})_{\infty}+q^{4}\,(q^{105},q^{83},q^{22};q^{105})_{\infty}\\\
-q^{7}\,(q^{105},q^{92},q^{13};q^{105})_{\infty}+q^{9}\,(q^{105},q^{97},q^{8};q^{105})_{\infty}.$
(7.2)

Thus, we have to prove the identity

$0=(q^{105},q^{62},q^{43};q^{105})_{\infty}+q^{4}\,(q^{105},q^{83},q^{22};q^{105})_{\infty}\\\
-q^{7}\,(q^{105},q^{92},q^{13};q^{105})_{\infty}+q^{9}\,(q^{105},q^{97},q^{8};q^{105})_{\infty}-\frac{(q,q^{6},q^{7};q^{7})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$

We divide both sides of the identity by the first term on the right-hand side
and obtain

$0=1+q^{4}\frac{(q^{105},q^{83},q^{22};q^{105})_{\infty}}{(q^{105},q^{62},q^{43};q^{105})_{\infty}}-q^{7}\frac{(q^{105},q^{92},q^{13};q^{105})_{\infty}}{(q^{105},q^{62},q^{43};q^{105})_{\infty}}\\\
+q^{9}\frac{(q^{105},q^{97},q^{8};q^{105})_{\infty}}{(q^{105},q^{62},q^{43};q^{105})_{\infty}}-\frac{(q,q^{6},q^{7};q^{7})_{\infty}}{(q,q^{4};q^{5})_{\infty}\,(q^{105},q^{62},q^{43};q^{105})_{\infty}}.$

Now we fix $N:=105$. With the notation (6.1), our identity can be written as

$0=1+\frac{E_{22}}{E_{43}}-\frac{E_{13}}{E_{43}}+\frac{E_{8}}{E_{43}}-\frac{E_{7}E_{8}E_{13}E_{15}E_{20}E_{22}E_{27}E_{28}E_{35}E_{42}E_{48}E_{50}}{E_{4}E_{9}E_{11}E_{16}E_{19}E_{24}E_{26}E_{31}E_{39}E_{44}E_{46}E_{51}}.$
(7.3)

In order to rewrite the last term we used that

$(q^{7};q^{7})=(q^{7},q^{14},q^{21},\dots,q^{105};q^{105}),$

and similar “blow-ups” for other terms.

Step 1. We use the criterion (6.3) to see that all summands on the right-hand
side of (7.3) are modular functions for $\Gamma_{1}(105)$. Indeed, for $N=105$
and $\frac{E_{22}}{E_{43}}$, we have $1-1\equiv 0\pmod{12}$ and
$22^{2}-43^{2}\equiv 0\pmod{105}$. This shows that $\frac{E_{22}}{E_{43}}$ is
a modular function for the group $\Gamma_{1}(105)$. Similarly, we observe that
$\frac{E_{13}}{E_{43}}$, $\frac{E_{8}}{E_{43}}$ and
$\frac{E_{7}E_{8}E_{13}E_{15}E_{20}E_{22}E_{27}E_{28}E_{35}E_{42}E_{48}E_{50}}{E_{4}E_{9}E_{11}E_{16}E_{19}E_{24}E_{26}E_{31}E_{39}E_{44}E_{46}E_{51}}$
are modular functions for the group $\Gamma_{1}(105)$. Consequently,

$f:=1+\frac{E_{22}}{E_{43}}-\frac{E_{13}}{E_{43}}+\frac{E_{8}}{E_{43}}-\frac{E_{7}E_{8}E_{13}E_{15}E_{20}E_{22}E_{27}E_{28}E_{35}E_{42}E_{48}E_{50}}{E_{4}E_{9}E_{11}E_{16}E_{19}E_{24}E_{26}E_{31}E_{39}E_{44}E_{46}E_{51}}$

is a modular function for the group $\Gamma_{1}(105)$.

Step 2. We use the computer algebra Magma to compute representatives of the
cusps for the group $\Gamma_{1}(105)$. This is done by using the command
Cusps(Gamma1(105)). The output is

    [oo,0,1/13,1/12,2/23,1/11,3/32,2/21,1/10,3/29,5/48,2/19,3/28,4/37,1/9,\
    5/44,4/35,3/26,8/69,5/43,2/17,3/25,4/33,1/8,6/47,5/39,9/70,4/31,11/84,\
    13/99,5/38,7/53,2/15,13/96,8/59,3/22,7/51,1/7,5/34,4/27,29/195,18/121,\
    3/20,48/319,79/525,5/33,16/105,7/45,18/115,8/51,4/25,17/105,1/6,6/35,\
    11/63,18/103,7/40,8/45,23/129,5/28,7/39,9/50,11/60,9/49,12/65,5/27,\
    19/102,30/161,13/69,17/90,4/21,1/5,109/525,27/130,19/91,23/110,22/105,\
    47/222,18/85,33/155,3/14,14/65,68/315,13/60,41/189,64/295,29/133,\
    19/87,26/119,23/105,9/41,20/91,11/50,11/49,9/40,71/315,23/102,30/133,\
    17/75,27/119,8/35,13/56,44/189,7/30,13/55,5/21,6/25,9/35,11/42,59/225,\
    37/140,23/87,53/200,13/49,4/15,62/231,51/190,47/175,32/119,368/1365,\
    17/63,13/48,29/105,31/112,46/165,41/147,59/210,69/245,2/7,13/45,\
    17/63,71/245,7/24,92/315,45/154,43/147,31/105,34/115,29/98,52/175,\
    25/84,94/315,19/63,32/105,13/42,24/77,11/35,16/45,113/315,48/133,\
    38/105,23/63,11/30,31/84,13/35,37/98,8/21,67/175,523/1365,29/75,\
    64/165,41/105,124/315,2/5,43/105,41/100,26/63,31/75,44/105,103/245,\
    47/105,16/35,7/15,8/15,19/35,39/70,137/245,47/84,17/30,4/7,97/168,\
    41/70,37/63,13/21,152/245,87/140,22/35,19/30,24/35,46/63,11/15,\
    23/30,27/35]}.

Step 3. We now compute the order of each summand of LHS at each cusp except
$i\infty$. To do this, we have to use (6.4). Assume for example that we want
to compute the order at the cusp $27/35$ of the function
$\frac{E_{22}}{E_{43}}$. It is convenient to implement the following two
functions in Maple:

    B:=proc(x)
    x^2-x+1/6
    end proc:

    orderCusp1:=proc(x,N,g)
    local a,c;
    a:=numer(x);
    c:=denom(x);
    igcd(c,N)*B(frac(a*g/igcd(c,N)))/2
    end proc:

Now, in order to achieve our task we enter in Maple:

    orderCusp1(27/35,105,22)-orderCusp1(27/35,105,43);
    2

The output means that $\frac{E_{22}}{E_{43}}$ has a zero of order $2$ at the
cusp $\frac{27}{35}$.

Step 4. We want to compute a lower bound on the order of $f$ at the cusp
$27/35$. In order to do this, we do the above computation for each term in $f$
and take the minimum of all orders. This computation can be simplified by the
function

      orderCuspGroup:=proc(x,N,g)
      local ii,order;
      order:=0;
      for ii from 1 to nops(g) do
      order:=order+orderCusp1(x,N,g[ii][1])*g[ii][2];
      od;
      order
      end proc:

This function takes as input the cusp representative $x$, the $N$ — which in
our case is $105$ —, and the index $g$ from $E_{g}$. The product
$\frac{E_{22}}{E_{43}}$ is expressed as

    f1:=[[22,1],[43,-1]];

Then we can compute the order of $\frac{E_{22}}{E_{43}}$ at the cusp $27/35$
by typing

    orderCuspGroup(27/35,105,f1);
    2

We define the other terms by

    f2:=[[8,1],[43,-1]];
    f3:=[[13,1],[43,-1]];
    f4:=[[7,1],[8,1],[13,1],[15,1],[20,1],[22,1],[27,1],[28,1],
    [35,1],[42,1],[48,1],[50,1],[4,-1],[9,-1],[11,-1],[16,-1],
    [19,-1],[24,-1],[26,-1],[31,-1],[39,-1],[44,-1],[46,-1],[51,-1]];

Now we can get a lower bound on the order of $f$ at the cusp $27/35$ by
writing

     min(orderCuspGroup(27/35,105,f1),orderCuspGroup(27/35,105,f2),
     orderCuspGroup(27/35,105,f3),orderCuspGroup(27/35,105,f4));
     0

Hence, our lower bound is $0$.

Step 5. We sum up the lower bounds on the orders at all cusps except
$i\infty$. Thus, we obtain an upper bound on the order of $\tilde{f}$ at
$[i\infty]$. This is done as follows:

    cusps:=[0,1/13,1/12,2/23,1/11,3/32,2/21,1/10,3/29,5/48,...];
    cnt:=0;
    for ii in cusps do
     mn:=min(orderCuspGroup(ii,105,f1),orderCuspGroup(ii,105,f2),
     orderCuspGroup(ii,105,f3),orderCuspGroup(ii,105,f4)); cnt:=cnt+mn; od;
    print(cnt);
    -148

This means that the order of $\tilde{f}$ at $i\infty$ is at most $148$, under
the assumption that $f$ is not identically zero.

Step 6. It is routine to verify that $f=0+0q+\dots+0q^{148}+\cdots$. This
implies that $\operatorname{ord}_{[i\infty]}(\tilde{f})>148$. Hence, $f$ must
be the zero function. ∎

###### Proof of Theorem 2.

It is elementary to see that squares that are congruent to $529$ modulo $840$
are of the form $S^{2}$, where $S\equiv 23,37,47,103,107,163,173,187$
$(\text{mod}~{}210)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=(q^{105},q^{64},q^{41};q^{105})_{\infty}-q\,(q^{105},q^{71},q^{34};q^{105})_{\infty}\\\
+q^{2}\,(q^{105},q^{76},q^{29};q^{105})_{\infty}+q^{12}\,(q^{105},q^{104},q;q^{105})_{\infty}.$
(7.4)

Continuing as in the previous proof, we observe that the assertion of the
theorem is equivalent to

$0=1-\frac{E_{34}}{E_{41}}+\frac{E_{29}}{E_{41}}+\frac{E_{1}}{E_{41}}-\frac{E_{1}E_{6}E_{15}E_{20}E_{29}E_{34}E_{36}E_{50}E_{14}E_{21}E_{35}E_{49}}{E_{2}E_{3}E_{12}E_{17}E_{18}E_{23}E_{32}E_{33}E_{37}E_{38}E_{47}E_{52}},$

where we used the notation (6.1) with $N=105$. Using (6.3), we see that the
right-hand side is a modular function for the group $\Gamma_{1}(105)$. We
estimate the sum of the orders of the right-hand side at the cusps using the
same programmes as in the previous proof with modifications of the parameters.
The upper bound on the order of the right-hand side at $i\infty$ is also
$148$, so it suffices to check that the first $148$ coefficients of the right-
hand side are zero in order to prove the identity, which we checked using a
computer. ∎

###### Proof of Theorem 3.

It is elementary to see that squares that are congruent to $121$ modulo $840$
are of the form $S^{2}$, where $S\equiv 11,31,59,101,109,151,179,199$
$(\text{mod}~{}210)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+4)/8\right\rfloor}q^{a_{n}}=(q^{105},q^{47},q^{58};q^{105})_{\infty}+q\,(q^{105},q^{37},q^{68};q^{105})_{\infty}\\\
+q^{4}\,(q^{105},q^{23},q^{82};q^{105})_{\infty}+q^{12}\,(q^{105},q^{2},q^{103};q^{105})_{\infty}.$
(7.5)

Next, we observe that, using the notation (6.1) with $N=105$, the assertion of
the theorem is equivalent to

$0=1+\frac{E_{37}}{E_{47}}+\frac{E_{23}}{E_{47}}+\frac{E_{2}}{E_{47}}-\frac{E_{2}E_{5}E_{7}E_{12}E_{23}E_{28}E_{30}E_{33}E_{35}E_{37}E_{40}E_{42}}{E_{1}E_{4}E_{6}E_{11}E_{24}E_{29}E_{31}E_{34}E_{36}E_{39}E_{41}E_{46}}.$

Using (6.3), we see that the right-hand side is a modular function for the
group $\Gamma_{1}(105)$. We estimate the sum of the orders of the right-hand
side at the cusps using the same programmes as before with modifications of
the parameters. The upper bound on the order of the right-hand side at
$i\infty$ is also $148$, so it suffices to check that the first $148$
coefficients of the right-hand side are zero in order to prove the identity,
which we checked using a computer. ∎

###### Proof of Theorem 4.

It is elementary to see that squares that are congruent to $289$ modulo $840$
are of the form $S^{2}$, where $S\equiv 17,53,67,73,137,143,157,193$
$(\text{mod}~{}210)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=(q^{105},q^{44},q^{61};q^{105})_{\infty}+q^{3}\,(q^{105},q^{26},q^{79};q^{105})_{\infty}\\\
-q^{5}\,(q^{105},q^{19},q^{86};q^{105})_{\infty}+q^{6}\,(q^{105},q^{16},q^{89};q^{105})_{\infty}.$
(7.6)

Next, we observe that, using the notation (6.1) with $N=105$, the assertion of
the theorem is equivalent to

$0=1+\frac{E_{26}}{E_{44}}-\frac{E_{19}}{E_{44}}+\frac{E_{16}}{E_{44}}-\frac{E_{5}E_{9}E_{14}E_{16}E_{19}E_{21}E_{26}E_{30}E_{35}E_{40}E_{49}E_{51}}{E_{3}E_{8}E_{13}E_{17}E_{18}E_{22}E_{27}E_{32}E_{38}E_{43}E_{48}E_{52}}.$

Using (6.3), we see that the right-hand side is a modular function for the
group $\Gamma_{1}(105)$. We estimate the sum of the orders of the right-hand
side at the cusps using the same programmes as before with modifications of
the parameters. The upper bound on the order of the right-hand side at
$i\infty$ is also $148$, so it suffices to check that the first $148$
coefficients of the right-hand side are zero in order to prove the identity,
which we checked using a computer. ∎

###### Proof of Theorem 5.

It is elementary to see that squares that are congruent to $1$ modulo $840$
are of the form $S^{2}$, where $S\equiv 1,29,41,71,139,169,181,209$
$(\text{mod}~{}210)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+4)/8\right\rfloor}q^{a_{n}}=(q^{105},q^{52},q^{53};q^{105})_{\infty}+q\,(q^{105},q^{38},q^{67};q^{105})_{\infty}\\\
+q^{2}\,(q^{105},q^{32},q^{73};q^{105})_{\infty}+q^{6}\,(q^{105},q^{17},q^{88};q^{105})_{\infty}.$
(7.7)

Next, we observe that, using the notation (6.1) with $N=105$, the assertion of
the theorem is equivalent to

$0=1+\frac{E_{38}}{E_{52}}+\frac{E_{32}}{E_{52}}+\frac{E_{17}}{E_{52}}-\frac{E_{3}E_{7}E_{10}E_{17}E_{18}E_{25}E_{28}E_{32}E_{35}E_{38}E_{42}E_{45}}{E_{1}E_{6}E_{9}E_{16}E_{19}E_{26}E_{29}E_{34}E_{36}E_{41}E_{44}E_{51}}.$

Using (6.3), we see that the right-hand side is a modular function for the
group $\Gamma_{1}(105)$. We estimate the sum of the orders of the right-hand
side at the cusps using the same programmes as before with modifications of
the parameters. The upper bound on the order of the right-hand side at
$i\infty$ is also $148$, so it suffices to check that the first $148$
coefficients of the right-hand side are zero in order to prove the identity,
which we checked using a computer. ∎

###### Proof of Theorem 6.

It is elementary to see that squares that are congruent to $169$ modulo $840$
are of the form $S^{2}$, where $S\equiv 13,43,83,97,113,127,167,197$
$(\text{mod}~{}210)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=(q^{105},q^{46},q^{59};q^{105})_{\infty}+q^{2}\,(q^{105},q^{31},q^{74};q^{105})_{\infty}\\\
+q^{8}\,(q^{105},q^{11},q^{94};q^{105})_{\infty}-q^{11}\,(q^{105},q^{4},q^{101};q^{105})_{\infty}.$
(7.8)

Next, we observe that, using the notation (6.1) with $N=105$, the assertion of
the theorem is equivalent to

$0=1+\frac{E_{31}}{E_{46}}+\frac{E_{11}}{E_{46}}-\frac{E_{4}}{E_{46}}-\frac{E_{4}E_{10}E_{11}E_{14}E_{21}E_{24}E_{25}E_{31}E_{35}E_{39}E_{45}E_{49}}{E_{2}E_{8}E_{12}E_{13}E_{22}E_{23}E_{27}E_{33}E_{37}E_{43}E_{47}E_{48}}.$

Using (6.3), we see that the right-hand side is a modular function for the
group $\Gamma_{1}(105)$. We estimate the sum of the orders of the right-hand
side at the cusps using the same programmes as before with modifications of
the parameters. The upper bound on the order of the right-hand side at
$i\infty$ is also $148$, so it suffices to check that the first $148$
coefficients of the right-hand side are zero in order to prove the identity,
which we checked using a computer. ∎

###### Proof of Theorem 7.

It is elementary to see that squares that are congruent to $1$ modulo $240$
are of the form $S^{2}$, where $S\equiv 1,31,41,49,71,79,89,119$
$(\text{mod}~{}120)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=(q^{120},-q^{59},-q^{61};q^{120})_{\infty}+q^{4}\,(q^{120},-q^{29},-q^{91};q^{120})_{\infty}\\\
-q^{7}\,(q^{120},-q^{19},-q^{101};q^{120})_{\infty}-q^{10}\,(q^{120},-q^{11},-q^{109};q^{120})_{\infty}.$
(7.9)

Rewriting this expression, we see that the assertion of the theorem is
equivalent to

$0=\frac{(q^{120};q^{120})_{\infty}(q^{118},q^{122};q^{240})_{\infty}}{(q^{59},q^{61};q^{120})_{\infty}}+q^{4}\frac{(q^{120};q^{120})_{\infty}(q^{58},q^{182};q^{240})_{\infty}}{(q^{29},q^{91};q^{120})_{\infty}}\\\
-q^{7}\frac{(q^{120};q^{120})_{\infty}(q^{22},q^{218};q^{240})_{\infty}}{(q^{11},q^{109};q^{120})_{\infty}}-q^{10}\frac{(q^{120};q^{120})_{\infty}(q^{22},q^{218};q^{240})_{\infty}}{(q^{11},q^{109};q^{120})_{\infty}}\\\
-\frac{(q,q^{7},q^{8};q^{8})_{\infty}(q^{6},q^{10};q^{16})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$

By dividing both sides of the identity by the first term on the right-hand
side and using the notation (6.1) with $N=240$, we obtain

$0=1+\frac{E_{58}E_{59}E_{61}}{E_{29}E_{91}E_{118}}-\frac{E_{38}E_{59}E_{61}}{E_{19}E_{101}E_{118}}-\frac{E_{22}E_{59}E_{61}}{E_{11}E_{109}E_{118}}\\\
-\frac{E_{7}E_{8}E_{10}E_{15}E_{17}E_{22}E_{23}E_{25}E_{32}E_{33}E_{38}E_{40}E_{42}E_{47}E_{48}E_{55}E_{57}E_{58}}{E_{4}E_{11}E_{14}E_{19}E_{21}E_{29}E_{34}E_{36}E_{44}E_{46}E_{51}}\\\
\times\frac{E_{63}E_{65}E_{70}E_{72}E_{73}E_{80}E_{87}E_{88}E_{90}E_{95}E_{97}E_{102}E_{103}E_{105}E_{112}E_{113}}{E_{66}E_{69}E_{76}E_{84}E_{91}E_{94}E_{99}E_{101}E_{109}E_{114}E_{116}}.$

Each term on the right-hand side is a modular function for the group
$\Gamma_{1}(240)$. As before, using Magma we compute a list of all the cusps.
Here we have $448$ cusps. Again, we can give an upper bound on the order of
the right-hand side at $i\infty$. Running our programme, we obtain $592$. We
need to verify that the right-hand side has the form
$0+0q+\dots+0q^{592}+\cdots$, which can be routinely done. This proves the
identity. ∎

###### Proof of Theorem 8.

It is elementary to see that squares that are congruent to $49$ modulo $240$
are of the form $S^{2}$, where $S\equiv 7,17,23,47,73,97,103,113$
$(\text{mod}~{}120)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=(q^{120},-q^{53},-q^{67};q^{120})_{\infty}-q\,(q^{120},-q^{43},-q^{77};q^{120})_{\infty}\\\
+q^{2}\,(q^{120},-q^{37},-q^{83};q^{120})_{\infty}-q^{9}\,(q^{120},-q^{13},-q^{107};q^{120})_{\infty}\\\
=\frac{(q^{120};q^{120})_{\infty}(q^{106},q^{134};q^{240})_{\infty}}{(q^{53},q^{67};q^{120})_{\infty}}-q\frac{(q^{120};q^{120})_{\infty}(q^{86},q^{154};q^{240})_{\infty}}{(q^{43},q^{77};q^{120})_{\infty}}\\\
+q^{2}\frac{(q^{120};q^{120})_{\infty}(q^{74},q^{166};q^{240})_{\infty}}{(q^{37},q^{83};q^{120})_{\infty}}-q^{9}\frac{(q^{120};q^{120})_{\infty}(q^{26},q^{214};q^{240})_{\infty}}{(q^{13},q^{107};q^{120})_{\infty}}$
(7.10)

Next, we observe that, using the notation (6.1) with $N=240$, the assertion of
the theorem is equivalent to

$0=1-\frac{E_{53}E_{67}E_{86}}{E_{43}E_{77}E_{106}}+\frac{E_{53}E_{67}E_{74}}{E_{37}E_{83}E_{106}}-\frac{E_{26}E_{53}E_{67}}{E_{13}E_{106}E_{107}}\\\
-\frac{E_{1}E_{6}E_{9}E_{10}E_{15}E_{16}E_{24}E_{25}E_{26}E_{31}E_{39}E_{40}E_{41}E_{49}E_{54}E_{55}E_{56}}{E_{2}E_{3}E_{12}E_{13}E_{18}E_{27}E_{28}E_{37}E_{43}E_{52}}\\\
\times\frac{E_{64}E_{65}E_{70}E_{71}E_{74}E_{79}E_{80}E_{81}E_{86}E_{89}E_{90}E_{95}E_{96}E_{104}E_{105}E_{111}E_{119}}{E_{62}E_{68}E_{77}E_{78}E_{82}E_{83}E_{92}E_{93}E_{98}E_{107}E_{108}E_{117}}.$

As before, each term is a modular function for the group $\Gamma_{1}(240)$.
The upper bound on the order of the right-hand side at $i\infty$ is 592. We
verified that the right-hand side has the form $0+0q+\dots+0q^{592}+\cdots$.
This proves the theorem. ∎

###### Proof of Theorem 9.

It is elementary to see that squares that are congruent to $121$ modulo $240$
are of the form $S^{2}$, where $S\equiv 11,19,29,59,61,91,101,109$
$(\text{mod}~{}120)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=(q^{120},-q^{49},-q^{71};q^{120})_{\infty}+q\,(q^{120},-q^{41},-q^{79};q^{120})_{\infty}\\\
-q^{3}\,(q^{120},-q^{31},-q^{89};q^{120})_{\infty}-q^{14}\,(q^{120},-q,-q^{119};q^{120})_{\infty}\\\
=\frac{(q^{120};q^{120})_{\infty}(q^{98},q^{142};q^{240})_{\infty}}{(q^{49},q^{71};q^{120})_{\infty}}+q\frac{(q^{120};q^{120})_{\infty}(q^{82},q^{158};q^{240})_{\infty}}{(q^{41},q^{79};q^{120})_{\infty}}\\\
-q^{3}\frac{(q^{120};q^{120})_{\infty}(q^{62},q^{178};q^{240})_{\infty}}{(q^{31},q^{89};q^{120})_{\infty}}-q^{14}\frac{(q^{120};q^{120})_{\infty}(q^{2},q^{238};q^{240})_{\infty}}{(q^{1},q^{119};q^{120})_{\infty}}.$
(7.11)

Next, we observe that, using the notation (6.1) with $N=240$, the assertion of
the theorem is equivalent to

$0=1+\frac{E_{49}E_{71}E_{82}}{E_{41}E_{79}E_{98}}-\frac{E_{49}E_{62}E_{71}}{E_{31}E_{89}E_{98}}-\frac{E_{2}E_{49}E_{71}}{E_{1}E_{98}E_{119}}\\\
-\frac{E_{2}E_{3}E_{5}E_{8}E_{13}E_{18}E_{27}E_{30}E_{32}E_{35}E_{37}E_{40}E_{43}E_{45}E_{48}E_{50}E_{53}}{E_{1}E_{4}E_{6}E_{9}E_{26}E_{31}E_{36}E_{39}E_{41}E_{44}E_{54}}\\\
\times\frac{E_{62}E_{67}E_{72}E_{75}E_{77}E_{78}E_{80}E_{82}E_{83}E_{85}E_{88}E_{93}E_{107}E_{110}E_{112}E_{115}E_{117}}{E_{74}E_{76}E_{79}E_{81}E_{84}E_{86}E_{89}E_{106}E_{111}E_{116}E_{119}}.$

As before, each term is a modular function for the group $\Gamma_{1}(240)$.
The upper bound on the order of the right-hand side at $i\infty$ is 592. We
verified that the right-hand side has the form $0+0q+\dots+0q^{592}+\cdots$.
This proves the theorem. ∎

###### Proof of Theorem 10.

It is elementary to see that squares that are congruent to $169$ modulo $240$
are of the form $S^{2}$, where $S\equiv 13,37,43,53,67,77,83,107$
$(\text{mod}~{}120)$. If we now do a computation analogous to the one in the
proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=(q^{120},-q^{47},-q^{73};q^{120})_{\infty}-q^{5}\,(q^{120},-q^{23},-q^{97};q^{120})_{\infty}\\\
+q^{7}\,(q^{120},-q^{17},-q^{103};q^{120})_{\infty}-q^{11}\,(q^{120},-q^{7},-q^{113};q^{120})_{\infty}\\\
=\frac{(q^{120};q^{120})_{\infty}(q^{94},q^{146};q^{240})_{\infty}}{(q^{47},q^{73};q^{120})_{\infty}}-q^{5}\frac{(q^{120};q^{120})_{\infty}(q^{46},q^{194};q^{240})_{\infty}}{(q^{23},q^{97};q^{120})_{\infty}}\\\
+q^{7}\frac{(q^{120};q^{120})_{\infty}(q^{34},q^{206};q^{240})_{\infty}}{(q^{17},q^{103};q^{120})_{\infty}}-q^{11}\frac{(q^{120};q^{120})_{\infty}(q^{14},q^{226};q^{240})_{\infty}}{(q^{7},q^{113};q^{120})_{\infty}}.$
(7.12)

Next, we observe that, using the notation (6.1) with $N=240$, the assertion of
the theorem is equivalent to

$0=1-\frac{E_{46}E_{47}E_{73}}{E_{23}E_{94}E_{97}}+\frac{E_{34}E_{47}E_{73}}{E_{17}E_{94}E_{103}}-\frac{E_{14}E_{47}E_{73}}{E_{7}E_{94}E_{113}}\\\
-\frac{E_{5}E_{11}E_{14}E_{16}E_{19}E_{21}E_{24}E_{29}E_{30}E_{34}E_{35}E_{40}E_{45}E_{46}E_{50}E_{51}E_{56}E_{59}}{E_{7}E_{12}E_{17}E_{22}E_{23}E_{28}E_{33}E_{38}E_{42}E_{52}E_{57}E_{58}}\\\
\times\frac{E_{61}E_{64}E_{66}E_{69}E_{75}E_{80}E_{85}E_{91}E_{96}E_{99}E_{101}E_{104}E_{109}E_{110}E_{114}E_{115}}{E_{63}E_{68}E_{87}E_{92}E_{97}E_{102}E_{103}E_{108}E_{113}E_{118}}.$

As before, each term is a modular function for the group $\Gamma_{1}(240)$.
The upper bound on the order of the right-hand side at $i\infty$ is 592. We
verified that the right-hand side has the form $0+0q+\dots+0q^{592}+\cdots$.
This proves the theorem. ∎

###### Proof of Theorem 11.

This is a special case of Theorem 36. ∎

###### Proof of Theorem 12.

This is a special case of Theorem 36. ∎

###### Proof of Theorem 13.

This is a direct consequence of the Jacobi triple product identity (4.1): one
replaces $q$ by $q^{10}$ and then chooses $z=-q^{6}$ there. ∎

###### Proof of Theorem 14.

Using (4.3), we obtain

$\sum_{n=0}^{\infty}\big{(}q^{n(n+1)}-q^{5n(n+1)+1}\big{)}=(q^{2};q^{2})_{\infty}\,(-q^{2};q^{2})_{\infty}^{2}-q\,(q^{10};q^{10})_{\infty}\,(-q^{10};q^{10})_{\infty}^{2}.$
(7.13)

Hence, the assertion of the theorem is equivalent to

$0=\frac{(q^{4};q^{4})_{\infty}^{2}}{(q^{2};q^{2})_{\infty}}-q\frac{(q^{20};q^{20})_{\infty}^{2}}{(q^{10};q^{10})_{\infty}}-\frac{(q,q^{9},q^{10};q^{10})_{\infty}\,(q^{8},q^{12};q^{20})_{\infty}}{(q^{2},q^{3};q^{5})_{\infty}}.$

Using the notation (6.1) with $N=20$, we see that this is equivalent to

$0=1-\frac{E_{2}E_{6}}{E_{4}E_{8}}-\frac{E_{1}E_{6}E_{9}E_{10}}{E_{3}E_{4}E_{7}E_{8}}.$

The right-hand side is a modular function for the group $\Gamma_{1}(20)$. The
cusps for this group are computed as usual using Magma:

$\\{\infty,0,\frac{1}{7},\frac{3}{20},\frac{1}{6},\frac{2}{11},\frac{1}{5},\frac{1}{4},\frac{3}{10},\frac{1}{3},\frac{7}{20},\frac{11}{30},\frac{3}{8},\frac{2}{5},\frac{9}{20},\frac{1}{2},\frac{7}{12},\frac{3}{5},\frac{3}{4},\frac{4}{5}\\}.$

There are in total $20$ cusps. Estimating the order of the right-hand side at
$i\infty$, one obtains an upper bound of $4$. Hence it is sufficient to show
that the right-hand side has the form $0+0q+0q^{2}+0q^{3}+0q^{4}+\cdots$,
which can be done routinely. ∎

###### Proof of Theorem 15.

Using (4.2), we obtain

$1+\sum_{n=1}^{\infty}\big{(}q^{n^{2}}+q^{5n^{2}}\big{)}=\frac{1}{2}\big{(}(q^{2};q^{2})_{\infty}\,(-q;q^{2})_{\infty}^{2}+(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}\big{)}.$
(7.14)

Hence, the assertion of the theorem is equivalent to

$0=\frac{1}{2}\frac{(q^{2};q^{2})_{\infty}(q^{2};q^{4})_{\infty}^{2}}{(q;q^{2})^{2}_{\infty}}+\frac{1}{2}\frac{(q^{10};q^{10})_{\infty}(q^{10};q^{20})^{2}_{\infty}}{(q^{5};q^{10})^{2}_{\infty}}-\frac{(q^{2},q^{8},q^{10};q^{10})_{\infty}\,(q^{6},q^{14};q^{20})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$

Using the notation (6.1) with $N=20$, we see that this is equivalent to

$0=\frac{1}{2}+\frac{1}{2}\frac{E_{1}^{2}E_{3}^{2}E_{7}^{2}E_{9}^{2}}{E_{2}^{3}E_{4}E_{6}^{3}E_{8}}-\frac{E_{1}E_{3}^{2}E_{5}^{2}E_{7}^{2}E_{9}}{E_{2}^{2}E_{4}^{2}E_{6}^{3}E_{10}}.$

The right-hand side is a modular function for the group $\Gamma_{1}(20)$.
There are in total the $20$ cusps exhibited in the previous proof. Estimating
the order of the right-hand side at $i\infty$, one obtains an upper bound of
$4$. Hence it is sufficient to show that the right-hand side has the form
$0+0q+0q^{2}+0q^{3}+0q^{4}+\cdots$, which can be done routinely. ∎

###### Proof of Theorem 16.

This is a direct consequence of the Jacobi triple product identity (4.1): one
replaces $q$ by $q^{10}$ and then chooses $z=-q^{7}$ there. ∎

###### Proof of Theorem 17.

Using (4.3), we obtain

$\sum_{n=0}^{\infty}\big{(}q^{n(n+1)}+q^{5n(n+1)+1}\big{)}=(q^{2};q^{2})_{\infty}\,(-q^{2};q^{2})_{\infty}^{2}+q\,(q^{10};q^{10})_{\infty}\,(-q^{10};q^{10})_{\infty}^{2}.$
(7.15)

Hence, the assertion of the theorem is equivalent to

$0=\frac{(q^{4};q^{4})_{\infty}^{2}}{(q^{2};q^{2})_{\infty}}+q\frac{(q^{20};q^{20})_{\infty}^{2}}{(q^{10};q^{10})_{\infty}}-\frac{(q^{3},q^{7},q^{10};q^{10})_{\infty}(q^{4},q^{16};q^{20})_{\infty}}{(q,q^{4};q^{5})_{\infty}}.$

Using the notation (6.1) with $N=20$, we see that this is equivalent to

$0=1+\frac{E_{2}E_{6}}{E_{4}E_{8}}-\frac{E_{2}E_{3}E_{7}E_{10}}{E_{1}E_{4}E_{8}E_{9}}.$

The right-hand side is a modular function for the group $\Gamma_{1}(20)$.
There are in total the $20$ cusps exhibited in the proof of Theorem 15.
Estimating the order of the right-hand side at $i\infty$, one obtains an upper
bound of $4$. Hence it is sufficient to show that the right-hand side has the
form $0+0q+0q^{2}+0q^{3}+0q^{4}+\cdots$, which can be done routinely. ∎

###### Proof of Theorem 18.

This is a direct consequence of the Jacobi triple product identity (4.1): one
replaces $q$ by $q^{10}$ and then chooses $z=-q^{8}$ there. ∎

###### Proof of Theorem 19.

This is a direct consequence of the Jacobi triple product identity (4.1): one
replaces $q$ by $q^{10}$ and then chooses $z=-q^{9}$ there. ∎

###### Proof of Theorem 20.

Using (4.2), we obtain

$\sum_{n=1}^{\infty}\big{(}q^{n^{2}-1}-q^{5n^{2}-1}\big{)}=\frac{1}{2q}\big{(}(q^{2};q^{2})_{\infty}\,(-q;q^{2})_{\infty}^{2}-(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}\big{)}.$
(7.16)

Hence, the assertion of the theorem is equivalent to

$0=\frac{1}{2q}\frac{(q^{2};q^{2})_{\infty}(q^{2};q^{4})_{\infty}^{2}}{(q;q^{2})^{2}_{\infty}}-\frac{1}{2q}\frac{(q^{10};q^{10})_{\infty}(q^{10};q^{20})_{\infty}^{2}}{(q^{5};q^{10})_{\infty}^{2}}-\frac{(q^{4},q^{6},q^{10};q^{10})_{\infty}(q^{2},q^{18};q^{20})_{\infty}}{(q^{2};q^{3};q^{5})_{\infty}}.$

Using the notation (6.1) with $N=20$, we see that this is equivalent to

$0=\frac{1}{2}-\frac{1}{2}\frac{E_{1}^{2}E_{3}^{2}E_{7}^{2}E_{9}^{2}}{E_{2}^{3}E_{4}E_{6}^{3}E_{8}}-\frac{E_{1}^{2}E_{3}E_{5}^{2}E_{7}E_{9}^{2}}{E_{2}^{3}E_{6}^{2}E_{8}^{2}E_{10}}.$

The right-hand side is a modular function for the group $\Gamma_{1}(20)$.
There are in total the $20$ cusps exhibited in the proof of Theorem 15.
Estimating the order of the right-hand side at $i\infty$, one obtains an upper
bound of $4$. Hence it is sufficient to show that the right-hand side has the
form $0+0q+0q^{2}+0q^{3}+0q^{4}+\cdots$, which can be done routinely. ∎

###### Proof of Theorem 21.

This is a special case of Corollary 35. ∎

###### Proof of Theorem 22.

This is a special case of Theorem 34. ∎

###### Proof of Theorem 23.

This is a special case of Corollary 35. ∎

###### Proof of Theorem 24.

This is a special case of Theorem 34. ∎

###### Proof of Theorem 25.

This is a special case of Theorem 34. ∎

###### Proof of Theorem 26.

It is elementary to see that squares that are congruent to $1$ modulo $48$ are
of the form $N^{2}$, where $N\equiv 1,7,17,23$ $(\text{mod}~{}24)$. If we now
do a computation analogous to the one in the proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=(q^{24},q^{13},q^{11};q^{24})_{\infty}+q(q^{24},q^{19},q^{5};q^{24})_{\infty}.$
(7.17)

Next, we observe that, using the notation (6.1) with $N=24$, the assertion of
the theorem is equivalent to

$0=1+\frac{E_{5}}{E_{11}}-\frac{E_{2}E_{6}E_{8}E_{10}}{E_{1}E_{7}E_{9}E_{11}}.$

The right-hand side is a modular function for the group $\Gamma_{1}(24)$. The
cusps for this group are computed as usual using Magma:

$\\{\infty,0,\frac{1}{8},\frac{1}{7},\frac{1}{6},\frac{2}{11},\frac{1}{5},\frac{5}{24},\frac{3}{14},\frac{2}{9},\frac{1}{4},\frac{7}{24},\frac{11}{36},\frac{1}{3},\frac{3}{8},\frac{7}{18},\frac{5}{12},\frac{4}{9},\frac{11}{24},\frac{1}{2},\frac{9}{16},\frac{5}{8},\frac{2}{3},\frac{3}{4}\\}.$

There are in total $24$ cusps. Estimating the order of the right-hand side at
$i\infty$, one obtains an upper bound of $4$. Hence it is sufficient to show
that the right-hand side has the form $0+0q+0q^{2}+0q^{3}+0q^{4}+\cdots$,
which can be done routinely. ∎

###### Proof of Theorem 27.

It is elementary to see that squares that are congruent to $25$ modulo $48$
are of the form $S^{2}$, where $S\equiv 5,11,13,19$ $(\text{mod}~{}24)$. If we
now do a computation analogous to the one in the proof of Theorem 1, we obtain

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=(q^{24},q^{17},q^{7};q^{24})_{\infty}-q^{2}(q^{24},q^{23},q;q^{24})_{\infty}.$
(7.18)

Next, we observe that, using the notation (6.1) with $N=24$, the assertion of
the theorem is equivalent to

$0=1-\frac{E_{1}}{E_{7}}-\frac{E_{2}E_{6}E_{8}E_{10}}{E_{3}E_{5}E_{7}E_{11}}.$

The right-hand side is a modular function for the group $\Gamma_{1}(24)$.
There are in total the $24$ cusps exhibited in the previous proof. Estimating
the order of the right-hand side at $i\infty$, one obtains an upper bound of
$4$. Hence it is sufficient to show that the right-hand side has the form
$0+0q+0q^{2}+0q^{3}+0q^{4}+\cdots$, which can be done routinely. ∎

###### Proof of Theorem 28.

This is a special case of Theorem 36. ∎

###### Proof of Theorem 29.

This is a special case of Theorem 36. ∎

###### Proof of Theorem 30.

This theorem is a special case of Corollary 37. ∎

###### Proof of Theorem 31.

This is a special case of Theorem 38. ∎

###### Proof of Theorem 32.

This is a special case of Theorem 38. ∎

##  8\. Theta function identities

In this section and the following ones, we use a different notation for the
theta functions that appear in our context, namely

$\theta(\alpha;q):=(\alpha,q/\alpha;q)_{\infty}.$

It should be noted that, up to a power of $q$, the function $E_{g}(q;N)$ that
we used in Sections 6 and 7 can be expressed as $\theta(q^{g};q^{N})$.

Our proofs in Sections 9 and 10 are based on Weierstraß’ addition formula (cf.
[7, p. 451, Example 5])

$\theta(xy;q)\,\theta(x/y;q)\,\theta(uv;q)\,\theta(u/v;q)-\theta(xv;q)\,\theta(x/v;q)\,\theta(uy;q)\,\theta(u/y;q)\\\
=\frac{u}{y}\,\theta(yv;q)\,\theta(y/v;q)\,\theta(xu;q)\,\theta(x/u;q).$ (8.1)

Two specialisations of this formula are of particular importance in our
context. If, in (8.1), we replace $q$ by $q^{3N}$ and specialise $x=q^{N}$,
$y=u^{2}/q^{N}$, and $v=q^{N}/u$, then we obtain the relation

$\theta(u^{2};q^{3N})\,\theta(q^{2N}/u^{2};q^{3N})\,\theta(q^{N};q^{3N})\,\theta(u^{2}/q^{N};q^{3N})\\\
-\theta(q^{2N}/u;q^{3N})\,\theta(u;q^{3N})\,\theta(u^{3}/q^{N};q^{3N})\,\theta(q^{N}/u;q^{3N})\\\
=\frac{q^{N}}{u}\theta(u;q^{3N})\,\theta(u^{3}/q^{2N};q^{3N})\,\theta(q^{N}u;q^{3N})\,\theta(q^{N}/u;q^{3N}),$

or, equivalently,

$\theta(u^{3}/q^{N};q^{3N})+\frac{q^{N}}{u}\,\theta(u^{3}/q^{2N};q^{3N})\\\
=\frac{\theta(u^{2};q^{3N})\,\theta(q^{2N}/u^{2};q^{3N})\,\theta(q^{N};q^{3N})\,\theta(u^{2}/q^{N};q^{3N})}{\theta(u;q^{3N})\,\theta(q^{N}/u;q^{3N})\,\theta(q^{N}u;q^{3N})}.$

Written in alternative notation, this is

$(u^{3}/q^{N},q^{4N}/u^{3},q^{3N};q^{3N})_{\infty}+\frac{q^{N}}{u}\,(u^{3}/q^{2N},q^{5N}/u^{3},q^{3N};q^{3N})_{\infty}\\\
=\frac{(u^{2}/q^{N},q^{2N}/u^{2},q^{N};q^{N})_{\infty}}{(u,q^{N}/u;q^{N})_{\infty}}.$
(8.2)

Similarly, if in (8.1) we replace $q$ by $q^{3N}$ and specialise $x=q^{2N}$,
$y=u^{2}/q^{2N}$, and $v=q^{2N}/u$, then we obtain the relation

$\theta(u^{2};q^{3N})\,\theta(q^{4N}/u^{2};q^{3N})\,\theta(q^{2N};q^{3N})\,\theta(u^{2}/q^{2N};q^{3N})\\\
-\theta(q^{4N}/u;q^{3N})\,\theta(u;q^{3N})\,\theta(u^{3}/q^{2N};q^{3N})\,\theta(q^{2N}/u;q^{3N})\\\
=\frac{q^{2N}}{u}\theta(u;q^{3N})\,\theta(u^{3}/q^{4N};q^{3N})\,\theta(q^{2N}u;q^{3N})\,\theta(q^{2N}/u;q^{3N}),$

or, equivalently,

$\theta(u^{3}/q^{2N};q^{3N})-\frac{q^{3N}}{u^{2}}\theta(u^{3}/q^{4N};q^{3N})\\\
=\frac{\theta(u^{2};q^{3N})\,\theta(q^{4N}/u^{2};q^{3N})\,\theta(q^{2N};q^{3N})\,\theta(u^{2}/q^{2N};q^{3N})}{\theta(u;q^{3N})\,\theta(q^{2N}/u;q^{3N})\,\theta(u/q^{N};q^{3N})}.$

Written in alternative notation, this is

$(u^{3}/q^{2N},q^{5N}/u^{3},q^{3N};q^{3N})_{\infty}-\frac{q^{3N}}{u^{2}}\,(u^{3}/q^{4N},q^{7N}/u^{3},q^{3N};q^{3N})_{\infty}\\\
=\frac{(u^{2}/q^{2N},q^{3N}/u^{2},q^{N};q^{N})_{\infty}}{(u/q^{N},q^{2N}/u;q^{N})_{\infty}}.$
(8.3)

##  9\. Proofs by using the Weierstraß relation

In this section, we provide proofs of the theorems in Sections 2 and 3 that
utilise the Weierstraß relation (8.1). Again, for the theorems which are
specialisations of the parametric theorems in Section 10, we refer to the
proofs given there (which also make use the Weierstraß relation).

###### Proof of Theorem 1.

Our point of departure is (7.2). By (8.2) with $N=35$ and $u=q^{26}$,
respectively with $N=35$ and $u=q^{19}$, we get

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q^{17},q^{18},q^{35};q^{35})_{\infty}}{(q^{26},q^{9};q^{35})_{\infty}}+q^{4}\frac{(q^{3},q^{32},q^{35};q^{35})_{\infty}}{(q^{19},q^{16};q^{35})_{\infty}}.$

If we now replace $q$ by $q^{35}$ and choose $u=q^{10}$, $v=q^{3}$,
$x=q^{14}$, and $y=q^{6}$ in (8.1), we obtain222In case the reader wonders how
we came up with these choices of $u,v,x,y$ (and the choices in subsequent
proofs): after a lot of trial and error which produced some useful choices in
certain cases, but did not lead to the recognition of any underlying patterns
(we doubt in fact that there are), we decided to write a Maple programme that
goes through all possible choices of $u,v,x,y$ in non-negative powers of $q$
and outputs choices that are appropriate to establish our identities.

$\theta(q^{17};q^{35})\,\theta(q^{11};q^{35})\,\theta(q^{16};q^{35})\,\theta(q^{4};q^{35})+q^{4}\theta(q^{9};q^{35})\,\theta(q^{3};q^{35})\,\theta(q^{24};q^{35})\,\theta(q^{4};q^{35})\\\
=\theta(q^{20};q^{35})\,\theta(q^{8};q^{35})\,\theta(q^{13};q^{35})\,\theta(q^{7};q^{35}),$

and thus the above right-hand side becomes

$\frac{\theta(q^{20};q^{35})\,\theta(q^{8};q^{35})\,\theta(q^{13};q^{35})\,\theta(q^{7};q^{35})\,(q^{35};q^{35})_{\infty}}{\theta(q^{16};q^{35})\,\theta(q^{9};q^{35})\,\theta(q^{11};q^{35})\,\theta(q^{4};q^{35})},$

which is equivalent to the right-hand side of (2.1). ∎

###### Proof of Theorem 2.

Our point of departure is (7.4). By (8.2) with $N=35$ and $u=q^{33}$,
respectively with $N=35$ and $u=q^{23}$, we get

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q^{31},q^{4},q^{35};q^{35})_{\infty}}{(q^{33},q^{2};q^{35})_{\infty}}-q\frac{(q^{11},q^{24},q^{35};q^{35})_{\infty}}{(q^{23},q^{12};q^{35})_{\infty}}.$

If we now replace $q$ by $q^{35}$ and choose $u=q^{15}$, $v=q^{3}$,
$x=q^{17}$, and $y=q^{14}$ in (8.1), we obtain

$\theta(q^{31};q^{35})\,\theta(q^{3};q^{35})\,\theta(q^{18};q^{35})\,\theta(q^{12};q^{35})-\theta(q^{20};q^{35})\,\theta(q^{14};q^{35})\,\theta(q^{29};q^{35})\,\theta(q;q^{35})\\\
=q\theta(q^{17};q^{35})\,\theta(q^{11};q^{35})\,\theta(q^{32};q^{35})\,\theta(q^{2};q^{35}),$

and thus the above right-hand side becomes

$\frac{\theta(q^{20};q^{35})\,\theta(q^{14};q^{35})\,\theta(q^{29};q^{35})\,\theta(q;q^{35})\,(q^{35};q^{35})_{\infty}}{\theta(q^{17};q^{35})\,\theta(q^{12};q^{35})\,\theta(q^{32};q^{35})\,\theta(q^{2};q^{35})},$

which is equivalent to the right-hand side of (2.2). ∎

###### Proof of Theorem 3.

Our point of departure is (7.5). By (8.2) with $N=35$ and $u=q^{31}$,
respectively with $N=35$ and $u=q^{24}$, we get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+4)/8\right\rfloor}q^{a_{n}}=\frac{(q^{27},q^{8},q^{35};q^{35})_{\infty}}{(q^{31},q^{4};q^{35})_{\infty}}+q\frac{(q^{13},q^{22},q^{35};q^{35})_{\infty}}{(q^{24},q^{11};q^{35})_{\infty}}.$

If we now replace $q$ by $q^{35}$ and choose $u=q^{14}$, $v=q^{9}$,
$x=q^{15}$, and $y=q^{13}$ in (8.1), we obtain

$\theta(q^{28};q^{35})\,\theta(q^{2};q^{35})\,\theta(q^{23};q^{35})\,\theta(q^{5};q^{35})-\theta(q^{24};q^{35})\,\theta(q^{6};q^{35})\,\theta(q^{27};q^{35})\,\theta(q;q^{35})\\\
=q\theta(q^{2};q^{35})\,\theta(q^{4};q^{35})\,\theta(q^{29};q^{35})\,\theta(q;q^{35}),$

and thus the above right-hand side becomes

$\frac{\theta(q^{28};q^{35})\,\theta(q^{2};q^{35})\,\theta(q^{23};q^{35})\,\theta(q^{5};q^{35})(q^{35};q^{35})_{\infty}}{\theta(q^{4};q^{35})\,\theta(q^{11};q^{35})\,\theta(q^{6};q^{35})\,\theta(q;q^{35})},$

which is equivalent to the right-hand side of (2.3). ∎

###### Proof of Theorem 4.

Our point of departure is (7.6). By (8.2) with $N=35$ and $u=q^{32}$,
respectively with $N=35$ and $u=q^{18}$, we get

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q^{29},q^{6},q^{35};q^{35})_{\infty}}{(q^{32},q^{3};q^{35})_{\infty}}-q^{5}\frac{(q,q^{34},q^{35};q^{35})_{\infty}}{(q^{18},q^{17};q^{35})_{\infty}}.$

If we now replace $q$ by $q^{35}$ and choose $u=q^{7}$, $v=q^{15}$, $x=q$, and
$y=q^{2}$ in (8.1), we obtain

$\theta(q^{17};q^{35})\,\theta(q^{8};q^{35})\,\theta(q^{6};q^{35})\,\theta(q^{13};q^{35})-\theta(q^{9};q^{35})\,\theta(q^{16};q^{35})\,\theta(q^{14};q^{35})\,\theta(q^{5};q^{35})\\\
=q^{5}\theta(q;q^{35})\,\theta(q^{8};q^{35})\,\theta(q^{22};q^{35})\,\theta(q^{3};q^{35})$

after little manipulation. Thus, the above right-hand side becomes

$\frac{\theta(q^{9};q^{35})\,\theta(q^{16};q^{35})\,\theta(q^{14};q^{35})\,\theta(q^{5};q^{35})(q^{35};q^{35})_{\infty}}{\theta(q^{17};q^{35})\,\theta(q^{3};q^{35})\,\theta(q^{13};q^{35})\,\theta(q^{8};q^{35})},$

which is equivalent to the right-hand side of (2.4). ∎

###### Proof of Theorem 5.

Our point of departure is (7.7). By (8.2) with $N=35$ and $u=q^{29}$,
respectively with $N=35$ and $u=q^{34}$, we get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+4)/8\right\rfloor}q^{a_{n}}=\frac{(q^{23},q^{12},q^{35};q^{35})_{\infty}}{(q^{29},q^{6};q^{35})_{\infty}}+q\frac{(q^{33},q^{2},q^{35};q^{35})_{\infty}}{(q^{34},q;q^{35})_{\infty}}.$

If we now replace $q$ by $q^{35}$ and choose $u=q^{5}$, $v=q^{14}$, $x=q^{2}$,
and $y=q^{4}$ in (8.1), we obtain

$\theta(q^{18};q^{35})\,\theta(q^{3};q^{35})\,\theta(q^{10};q^{35})\,\theta(q^{7};q^{35})-\theta(q^{12};q^{35})\,\theta(q^{9};q^{35})\,\theta(q^{16};q^{35})\,\theta(q;q^{35})\\\
=q\theta(q^{9};q^{35})\,\theta(q^{6};q^{35})\,\theta(q^{19};q^{35})\,\theta(q^{2};q^{35})$

after little manipulation. Thus, the above right-hand side becomes

$\frac{\theta(q^{18};q^{35})\,\theta(q^{3};q^{35})\,\theta(q^{10};q^{35})\,\theta(q^{7};q^{35})(q^{35};q^{35})_{\infty}}{\theta(q^{6};q^{35})\,\theta(q;q^{35})\,\theta(q^{16};q^{35})\,\theta(q^{9};q^{35})},$

which is equivalent to the right-hand side of (2.5). ∎

###### Proof of Theorem 6.

Our point of departure is (7.8). By (8.2) with $N=35$ and $u=q^{27}$,
respectively with $N=35$ and $u=q^{22}$, we get

$\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}=\frac{(q^{19},q^{16},q^{35};q^{35})_{\infty}}{(q^{27},q^{8};q^{35})_{\infty}}+q^{2}\frac{(q^{9},q^{26},q^{35};q^{35})_{\infty}}{(q^{22},q^{13};q^{35})_{\infty}}.$

If we now replace $q$ by $q^{35}$ and choose $u=q^{7}$, $v=q^{16}$, $x=q^{3}$,
and $y=q^{5}$ in (8.1), we obtain

$\theta(q^{21};q^{35})\,\theta(q^{4};q^{35})\,\theta(q^{11};q^{35})\,\theta(q^{10};q^{35})-\theta(q^{13};q^{35})\,\theta(q^{12};q^{35})\,\theta(q^{19};q^{35})\,\theta(q^{2};q^{35})\\\
=q^{2}\theta(q^{9};q^{35})\,\theta(q^{8};q^{35})\,\theta(q^{23};q^{35})\,\theta(q^{2};q^{35})$

after little manipulation. Thus, the above right-hand side becomes

$\frac{\theta(q^{21};q^{35})\,\theta(q^{4};q^{35})\,\theta(q^{11};q^{35})\,\theta(q^{10};q^{35})(q^{35};q^{35})_{\infty}}{\theta(q^{8};q^{35})\,\theta(q^{13};q^{35})\,\theta(q^{12};q^{35})\,\theta(q^{2};q^{35})},$

which is equivalent to the right-hand side of (2.6). ∎

###### Proof of Theorem 7.

Our point of departure is (7.9). By (8.2) with $N=40$ and $u=-q^{33}$,
respectively with $N=40$ and $u=-q^{23}$, we get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{26},q^{14},q^{40};q^{40})_{\infty}}{(-q^{33},-q^{7};q^{40})_{\infty}}+q^{4}\frac{(q^{6},q^{34},q^{40};q^{40})_{\infty}}{(-q^{23},-q^{17};q^{40})_{\infty}}.$

If we now replace $q$ by $q^{40}$ and choose $u=-q^{9}$, $v=q^{16}$, $x=-q$,
and $y=-q^{5}$ in (8.1), we obtain

$\theta(-q^{21};q^{40})\,\theta(q^{8};q^{40})\,\theta(q^{10};q^{40})\,\theta(-q^{11};q^{40})\\\
-\theta(q^{14};q^{40})\,\theta(-q^{15};q^{40})\,\theta(-q^{17};q^{40})\,\theta(q^{4};q^{40})\\\
=q^{4}\theta(q^{6};q^{40})\,\theta(-q^{7};q^{40})\,\theta(-q^{25};q^{40})\,\theta(q^{4};q^{40})$

after little manipulation. Thus, the above right-hand side becomes

$\frac{\theta(-q^{21};q^{40})\,\theta(q^{8};q^{40})\,\theta(q^{10};q^{40})\,\theta(-q^{11};q^{40})\theta(q;q^{40})\,(q^{40};q^{40})_{\infty}}{\theta(-q^{17};q^{40})\,\theta(-q^{7};q^{40})\,\theta(-q^{15};q^{40})\,\theta(q^{4};q^{40})},$

which is equivalent to the right-hand side of (2.7). ∎

###### Proof of Theorem 8.

Our point of departure is the first two lines in (7.10). By (8.2) with $N=40$
and $u=-q^{31}$, respectively with $N=40$ and $u=-q^{39}$, we get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q^{22},q^{18},q^{40};q^{40})_{\infty}}{(-q^{31},-q^{9};q^{40})_{\infty}}-q\frac{(q^{38},q^{2},q^{40};q^{40})_{\infty}}{(-q^{39},-q;q^{40})_{\infty}}.$

If we now replace $q$ by $q^{40}$ and choose $u=-q^{8}$, $v=q^{5}$,
$x=q^{17}$, and $y=q^{7}$ in (8.1), we obtain

$\theta(q^{24};q^{40})\,\theta(q^{10};q^{40})\,\theta(-q^{13};q^{40})\,\theta(-q^{3};q^{40})\\\
-\theta(q^{22};q^{40})\,\theta(q^{12};q^{40})\,\theta(-q^{15};q^{40})\,\theta(-q;q^{40})\\\
=-q\theta(q^{12};q^{40})\,\theta(q^{2};q^{40})\,\theta(-q^{25};q^{40})\,\theta(-q^{9};q^{40}),$

and thus the above right-hand side becomes

$\frac{\theta(q^{24};q^{40})\,\theta(q^{10};q^{40})\,\theta(-q^{13};q^{40})\,\theta(-q^{3};q^{40})(q^{40};q^{40})_{\infty}}{\theta(-q;q^{40})\,\theta(-q^{9};q^{40})\,\theta(q^{12};q^{40})\,\theta(-q^{15};q^{40})},$

which is equivalent to the right-hand side of (2.8). ∎

###### Proof of Theorem 9.

The point of departure is the first two lines in (7.11). By (8.2) with $N=40$
and $u=-q^{37}$, respectively with $N=40$ and $u=-q^{27}$, we get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{34},q^{6},q^{40};q^{40})_{\infty}}{(-q^{37},-q^{3};q^{40})_{\infty}}+q\frac{(q^{14},q^{26},q^{40};q^{40})_{\infty}}{(-q^{27},-q^{13};q^{40})_{\infty}}.$

By (8.1) with $N=40$, $u=-q^{16}$, $v=q^{11}$, $y=q^{15}$, and $x=q^{19}$, we
get

$\theta(q^{34};q^{40})\,\theta(q^{4};q^{40})\,\theta(-q^{27};q^{40})\,\theta(-q^{5};q^{40})-\theta(q^{30};q^{40})\,\theta(q^{8};q^{40})\,\theta(-q^{31};q^{40})\,\theta(-q;q^{40})\\\
=-q\,\theta(q^{26};q^{40})\,\theta(q^{4};q^{40})\,\theta(-q^{35};q^{40})\,\theta(-q^{3};q^{40}),$

and thus the above right-hand side becomes

$\frac{\theta(q^{30};q^{40})\,\theta(q^{8};q^{40})\,\theta(-q^{31};q^{40})\,\theta(-q;q^{40})\,(q^{40};q^{40})_{\infty}}{\theta(-q^{27};q^{40})\,\theta(-q^{37};q^{40})\,\theta(q^{4};q^{40})\,\theta(-q^{5};q^{40})},$

which is equivalent to the right-hand side of (2.9). ∎

###### Proof of Theorem 10.

Our point of departure is the first two lines in (7.12). By (8.2) with $N=40$
and $u=-q^{29}$, respectively by (8.3) with $N=40$ and $u=-q^{59}$, we get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q^{18},q^{22},q^{40};q^{40})_{\infty}}{(-q^{29},-q^{11};q^{40})_{\infty}}-q^{5}\frac{(q^{38},q^{2},q^{40};q^{40})_{\infty}}{(-q^{19},-q^{21};q^{40})_{\infty}}.$

If we now replace $q$ by $q^{40}$ and choose $u=-q^{13}$, $v=-q^{15}$,
$x=-q^{3}$, and $y=q^{8}$ in (8.1), we obtain

$\theta(-q^{23};q^{40})\,\theta(q^{10};q^{40})\,\theta(q^{16};q^{40})\,\theta(-q^{7};q^{40})\\\
-\theta(-q^{21};q^{40})\,\theta(q^{12};q^{40})\,\theta(q^{18};q^{40})\,\theta(-q^{5};q^{40})\\\
=-q^{5}\theta(-q^{11};q^{40})\,\theta(q^{2};q^{40})\,\theta(q^{28};q^{40})\,\theta(-q^{5};q^{40})$

after little manipulation. Thus, the above right-hand side becomes

$\frac{\theta(-q^{23};q^{40})\,\theta(q^{10};q^{40})\,\theta(q^{16};q^{40})\,\theta(-q^{7};q^{40})(q^{40};q^{40})_{\infty}}{\theta(-q^{11};q^{40})\,\theta(-q^{19};q^{40})\,\theta(q^{12};q^{40})\,\theta(-q^{5};q^{40})},$

which is equivalent to the right-hand side of (2.10). ∎

###### Proof of Theorem 11.

This is a special case of Theorem 36. ∎

###### Proof of Theorem 12.

This is a special case of Theorem 36. ∎

###### Proof of Theorem 13.

As we already said, this is a direct consequence of the Jacobi triple product
identity (4.1): one replaces $q$ by $q^{10}$ and then chooses $z=-q^{6}$
there. ∎

###### Proof of Theorem 14.

We start again with (cf. (7.13))

$\sum_{n=0}^{\infty}\big{(}q^{n(n+1)}-q^{5n(n+1)+1}\big{)}=(q^{2};q^{2})_{\infty}\,(-q^{2};q^{2})_{\infty}^{2}-q\,(q^{10};q^{10})_{\infty}\,(-q^{10};q^{10})_{\infty}^{2}.$

The right-hand side can be rewritten as

$\frac{(q^{4};q^{4})_{\infty}^{2}}{(q^{2};q^{2})_{\infty}}-q\frac{(q^{20};q^{20})_{\infty}^{2}}{q^{10};q^{10})_{\infty}}=\frac{(q^{20};q^{20})_{\infty}^{2}}{q^{10};q^{10})_{\infty}}\left(\frac{\theta(q^{4};q^{20})\,\theta(q^{8};q^{20})\,}{\theta(q^{2};q^{20})\,\theta(q^{6};q^{20})\,}-q\right).$
(9.1)

If in (8.1) we choose $u=q^{5}$, $v=q^{2}$, $x=q^{12}$, and $y=q^{4}$, then we
obtain

$\theta(q^{16};q^{20})\,\theta(q^{8};q^{20})\,\theta(q^{7};q^{20})\,\theta(q^{3};q^{20})-\theta(q^{14};q^{20})\,\theta(q^{10};q^{20})\,\theta(q^{9};q^{20})\,\theta(q;q^{20})\\\
=q\,\theta(q^{6};q^{20})\,\theta(q^{2};q^{20})\,\theta(q^{17};q^{20})\,\theta(q^{7};q^{20}).$

If this is used in (9.1), then we obtain the right-hand side of (2.14) after
little manipulation. ∎

###### Proof of Theorem 15.

We start again with (cf. (7.14))

$1+\sum_{n=1}^{\infty}\big{(}q^{n^{2}}+q^{5n^{2}}\big{)}=\frac{1}{2}\big{(}(q^{2};q^{2})_{\infty}\,(-q;q^{2})_{\infty}^{2}+(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}\big{)}.$
(9.2)

Now, we have the relation333In combinatorial terms, this is Euler’s theorem
that the number of partitions of $n$ into odd parts equals the number of
partitions of $n$ into distinct parts. (cf. [2, Eq. (8.10.9)])

$(q;q^{2})_{\infty}^{-1}=(-q;q)_{\infty}.$ (9.3)

Upon replacement of $q$ by $-q$, we obtain the variant

$(-q;q^{2})_{\infty}^{-1}=(q;q^{2})_{\infty}\,(-q^{2};q^{2})_{\infty}.$ (9.4)

We use the latter identity in (9.2) and get

$1+\sum_{n=1}^{\infty}\big{(}q^{n^{2}}+q^{5n^{2}}\big{)}=\frac{1}{2}\left(\frac{(q^{2};q^{2})_{\infty}\,(-q;q^{2})_{\infty}}{(q;q^{2})_{\infty}\,(-q^{2};q^{2})_{\infty}}+(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}\right)\\\
=\frac{1}{2}\left(\frac{\theta(q^{2};q^{10})\,\theta(q^{4};q^{10})\,(q^{10};q^{10})_{\infty}\,\theta(-q;q^{10})\,\theta(-q^{3};q^{10})\,(-q^{5};q^{10})_{\infty}}{\theta(q;q^{10})\,\theta(q^{3};q^{10})\,(q^{5};q^{10})_{\infty}\,\theta(-q^{2};q^{2})\,\theta(-q^{4};q^{2})\,(-q^{10};q^{10})_{\infty}}\right.\\\
\left.\vphantom{\frac{\theta(s)}{\theta(s)}}+(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}\right).$

If, in the first expression within parentheses we use (9.4) with $q$ replaced
by $q^{5}$, then the above becomes

$1+\sum_{n=1}^{\infty}\big{(}q^{n^{2}}+q^{5n^{2}}\big{)}=\frac{(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}}{2\,\theta(q;q^{10})\,\theta(q^{3};q^{10})\,\theta(-q^{2};q^{2})\,\theta(-q^{4};q^{2})}\\\
\times\left(\theta(q^{2};q^{10})\,\theta(q^{4};q^{10})\,\theta(-q;q^{10})\,\theta(-q^{3};q^{10})\right.\\\
\left.\vphantom{\frac{\theta(s)}{\theta(s)}}+\theta(q;q^{10})\,\theta(q^{3};q^{10})\,\theta(-q^{2};q^{2})\,\theta(-q^{4};q^{2})\right).$

We now choose $u=-q^{3}$, $v=q$, $x=q^{4}$, and $y=q^{3}$ in (8.1). This gives
the relation

$\theta(q^{2};q^{10})\,\theta(q^{4};q^{10})\,\theta(-q;q^{10})\,\theta(-q^{3};q^{10})+\theta(q;q^{10})\,\theta(q^{3};q^{10})\,\theta(-q^{2};q^{10})\,\theta(-q^{4};q^{10})\\\
=\theta(q^{3};q^{10})\,\theta(-q^{4};q^{10})\,\theta(q^{5};q^{10})\,\theta(-1;q^{10}).$

If this is used in the above expression, then we obtain (2.15) after some
manipulation, where (9.4) is again used with $q$ replaced by $q^{5}$. ∎

###### Proof of Theorem 16.

As we already said, this is a direct consequence of the Jacobi triple product
identity (4.1): one replaces $q$ by $q^{10}$ and then chooses $z=-q^{7}$
there. ∎

###### Proof of Theorem 17.

We start again with (cf. (7.15))

$\sum_{n=0}^{\infty}\big{(}q^{n(n+1)}+q^{5n(n+1)+1}=(q^{2};q^{2})_{\infty}\,(-q^{2};q^{2})_{\infty}^{2}+q\,(q^{10};q^{10})_{\infty}\,(-q^{10};q^{10})_{\infty}^{2}.$

The right-hand side can be rewritten as

$\frac{(q^{4};q^{4})_{\infty}^{2}}{(q^{2};q^{2})_{\infty}}+q\frac{(q^{20};q^{20})_{\infty}^{2}}{q^{10};q^{10})_{\infty}}=\frac{(q^{20};q^{20})_{\infty}^{2}}{q^{10};q^{10})_{\infty}}\left(\frac{\theta(q^{4};q^{20})\,\theta(q^{8};q^{20})\,}{\theta(q^{2};q^{20})\,\theta(q^{6};q^{20})\,}+q\right).$
(9.5)

If in (8.1) we choose $u=q^{5}$, $v=q^{2}$, $x=q^{6}$, and $y=q^{4}$, then we
obtain

$\theta(q^{10};q^{20})\,\theta(q^{2};q^{20})\,\theta(q^{7};q^{20})\,\theta(q^{3};q^{20})-\theta(q^{8};q^{20})\,\theta(q^{4};q^{20})\,\theta(q^{9};q^{20})\,\theta(q;q^{20})\\\
=q\,\theta(q^{6};q^{20})\,\theta(q^{2};q^{20})\,\theta(q^{11};q^{20})\,\theta(q;q^{20}).$

If this is used in (9.5), then we obtain the right-hand side of (2.17) after
little manipulation. ∎

###### Proof of Theorem 18.

As we already said, this is a direct consequence of the Jacobi triple product
identity (4.1): one replaces $q$ by $q^{10}$ and then chooses $z=-q^{8}$
there. ∎

###### Proof of Theorem 19.

As we already said, this is a direct consequence of the Jacobi triple product
identity (4.1): one replaces $q$ by $q^{10}$ and then chooses $z=-q^{9}$
there. ∎

###### Proof of Theorem 20.

We start again with (cf. (7.16))

$\sum_{n=1}^{\infty}\big{(}q^{n^{2}-1}-q^{5n^{2}-1}\big{)}=\frac{1}{2q}\big{(}(q^{2};q^{2})_{\infty}\,(-q;q^{2})_{\infty}^{2}-(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}\big{)}.$
(9.6)

The right-hand side is almost the same expression as the one on the right-hand
side of (9.2), except for a multiplicative factor of $1/2$ and a changed sign.
Hence, by proceeding as in the alternative proof of Theorem 15, we arrive at

$\sum_{n=1}^{\infty}\big{(}q^{n^{2}-1}-q^{5n^{2}-1}\big{)}=\frac{(q^{10};q^{10})_{\infty}\,(-q^{5};q^{10})_{\infty}^{2}}{2q\,\theta(q;q^{10})\,\theta(q^{3};q^{10})\,\theta(-q^{2};q^{2})\,\theta(-q^{4};q^{2})}\\\
\times\left(\theta(q^{2};q^{10})\,\theta(q^{4};q^{10})\,\theta(-q;q^{10})\,\theta(-q^{3};q^{10})\right.\\\
\left.\vphantom{\frac{\theta(s)}{\theta(s)}}-\theta(q;q^{10})\,\theta(q^{3};q^{10})\,\theta(-q^{2};q^{2})\,\theta(-q^{4};q^{2})\right).$

We now choose $u=-q^{3}$, $v=q$, $x=q^{4}$, and $y=q^{3}$ in (8.1). This gives
the relation

$\theta(q^{4};q^{10})\,\theta(q^{2};q^{10})\,\theta(-q^{3};q^{10})\,\theta(-q;q^{10})-\theta(-q^{4};q^{10})\,\theta(-q^{2};q^{10})\,\theta(q^{3};q^{10})\,\theta(q;q^{10})\\\
=q\,\theta(-q^{2};q^{10})\,\theta(-1;q^{10})\,\theta(q^{5};q^{10})\,\theta(q;q^{10}).$

If this is used in the above expression, then we obtain (2.20) after some
manipulation, where (9.4) is again used with $q$ replaced by $q^{5}$. ∎

###### Proof of Theorem 21.

This is a special case of Corollary 35. ∎

###### Proof of Theorem 22.

This theorem is a special case of Theorem 34. ∎

###### Proof of Theorem 23.

This is a special case of Corollary 35. ∎

###### Proof of Theorem 24.

This theorem is a special case of Theorem 34. ∎

###### Proof of Theorem 25.

This theorem is a special case of Theorem 34. ∎

###### Proof of Theorem 26.

Using (8.2) with $N=8$ and $u=q^{7}$, the right-hand side of (7.17) can be
simplified into one product. This gives the claimed result. ∎

###### Proof of Theorem 27.

Using (8.3) with $N=8$ and $u=q^{11}$, the right-hand side of (7.18) can be
simplified into one product. This gives the claimed result. ∎

###### Proof of Theorem 28.

This theorem is a special case of Theorem 36. ∎

###### Proof of Theorem 29.

This theorem is a special case of Theorem 36. ∎

###### Proof of Theorem 30.

This theorem is a special case of Corollary 37. ∎

###### Proof of Theorem 31.

This is a special case of Theorem 38. ∎

###### Proof of Theorem 32.

This is a special case of Theorem 38. ∎

##  10\. Parametric families of generating functions for sequences of squares

Here we present two results on generating functions for sequences of squares
that contain parameters. The first of these results consists in Theorem 34 and
Corollary 35, while the second consists in in Theorem 36 and Corollary 37. For
each theorem-corollary pair the proof is the same, but the theorem covers a
parameter range that is different from that of the corollary. We conclude the
section by stating, and proving, a uniform version of Theorems 31 and 32.

The following theorem covers Theorems 22, 24 and 25.

######  Theorem 34.

Let $P$ be an odd prime power and let $a$ be an odd positive integer
relatively prime to $P$ and less than $P$. Let $(a_{n})_{n\geq 0}$ be the
sequence of non-negative integers $m$ such that $24Pm+a^{2}$ is a square.

  1. (1)

If $a\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{(P-a)/3},q^{(2P+a)/3},q^{P};q^{P})_{\infty}}{(q^{(P-a)/6},q^{(5P+a)/6};q^{P})_{\infty}}.$
(10.1)

  2. (2)

If $a\not\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{(P+a)/3},q^{(2P-a)/3},q^{P};q^{P})_{\infty}}{(q^{(P+a)/6},q^{(5P-a)/6};q^{P})_{\infty}}.$
(10.2)

###### Proof.

We have to find all $S$ such that

$S^{2}\equiv a^{2}\pmod{24P}.$ (10.3)

We claim that there are the following two cases:

  1. (C1)

If $a\equiv P$ (mod $3$), then $S\equiv a,2P-a,4P+a,6P-a$ $(\text{mod}~{}6P)$.

  2. (C2)

If $a\not\equiv P$ (mod $3$), then $S\equiv a,2P+a,4P-a,6P-a$
$(\text{mod}~{}6P)$.

It should be noted that the condition $a<P$ guarantees that, in both cases,
the congruence classes above are listed in increasing order.

By assumption, $a$ is odd. Hence, also $S$ must be odd and automatically
$S^{2}\equiv a^{2}\equiv 1$ (mod $8$). Consequently, the congruence (10.3) can
be reduced to

$(S-a)(S+a)\equiv 0\pmod{6P}.$

Two solutions are immediate, namely $S\equiv a$ (mod $6P$) and $S\equiv-a$
(mod $6P$). There are two further possibilities:

$S\equiv a~{}(\text{mod }6)\quad\text{and}\quad S\equiv-a~{}(\text{mod }P),$
(10.4)

and

$S\equiv-a~{}(\text{mod }6)\quad\text{and}\quad S\equiv a~{}(\text{mod }P).$
(10.5)

Under our assumption that $a$ is relatively prime to $P$, there are no other
possibilities. For, writing $P=p^{e}$ with $p$ an odd prime number, the
simultaneous congruences

$S\equiv a~{}(\text{mod }p^{\alpha})\quad\text{and}\quad
S\equiv-a~{}(\text{mod }p^{\beta})$

with $\alpha+\beta=e$ and both $\alpha$ and $\beta$ positive would imply that
$2a$ is divisible by $p$, a contradiction to our assumptions.

It is straightforward to see that, depending on whether $a\equiv P$ (mod $3$)
or not, the solutions to (10.4) respectively to (10.5) are given by the second
and third option in (C1) and (C2) above.

We now discuss Case (C1). Here, we have

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+a)^{2}-a^{2})}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+2P-a)^{2}-a^{2})}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+4P+a)^{2}-a^{2})}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+6P-a)^{2}-a^{2})}\\\
=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+ak)}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(2P-a)k)+\frac{1}{6}(P-a)}\kern
85.35826pt\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(4P+a)k)+\frac{1}{3}(2P+a)}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(6P-a)k)+\frac{1}{2}(3P-a)}.$

Again, sums can be put together in pairs, so that one obtains two sums over
all integers $k$:

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+ak)}+\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(2P-a)k)+\frac{1}{6}(P-a)}.$

Now, to each of these sums we apply the Jacobi triple product identity (4.1)
to get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=(q^{3P},q^{(3P+a)/2},q^{(3P-a)/2};q^{3P})_{\infty}\\\
+q^{(P-a)/6}\,(q^{3P},q^{(5P-a)/2},q^{(P+a)/2};q^{3P})_{\infty}.$

The sum of these two products simplifies to the single product on the right-
hand side of (10.1) as is seen by applying (8.2) with $N=P$ and
$u=q^{(5P+a)/6}$.

On the other hand, if we are in Case (C2), then we have

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+a)^{2}-a^{2})}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+2P+a)^{2}-a^{2})}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+4P-a)^{2}-a^{2})}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{24P}((6Pk+6P-a)^{2}-a^{2})}\\\
=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+ak)}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(2P+a)k)+\frac{1}{6}(P+a)}\kern
85.35826pt\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(4P-a)k)+\frac{1}{3}(2P-a)}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(6P-a)k)+\frac{1}{2}(3P-a)}.$

Again, sums can be put together in pairs, so that one obtains two sums over
all integers $k$:

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+ak)}+\sum_{k=-\infty}^{\infty}(-1)^{k}q^{\frac{1}{2}(3Pk^{2}+(2P+a)k)+\frac{1}{6}(P+a)}.$

Now, to each of these sums we apply the Jacobi triple product identity (4.1)
to get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=(q^{3P},q^{(3P+a)/2},q^{(3P-a)/2};q^{3P})_{\infty}\\\
+q^{(P+a)/6}\,(q^{3P},q^{(5P+a)/2},q^{(P-a)/2};q^{3P})_{\infty}.$

The sum of these two products simplifies to the single product on the right-
hand side of (10.2) as is seen by applying (8.2) with $N=P$ and
$u=q^{(5P-a)/6}$. ∎

The following corollary covers Theorems 21 and 23.

######  Corollary 35.

Let $P$ be an odd prime power and let $a$ be an odd positive integer
relatively prime to $P$ with $P<a<2P$. Let $(a_{n})_{n\geq 0}$ be the sequence
of non-negative integers $m$ such that $24Pm+a^{2}$ is a square.

  1. (1)

If $a\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{(P-a)/3},q^{(2P+a)/3},q^{P};q^{P})_{\infty}}{(q^{(P-a)/6},q^{(5P+a)/6};q^{P})_{\infty}}.$
(10.6)

  2. (2)

If $a\not\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q^{(P+a)/3},q^{(2P-a)/3},q^{P};q^{P})_{\infty}}{(q^{(P+a)/6},q^{(5P-a)/6};q^{P})_{\infty}}.$
(10.7)

###### Proof.

If one looks through the arguments of the proof of Theorem 34, then one sees
that everything can be copied verbatim, until it comes to the description of
the two cases to be considered: we have to adapt the order of the congruence
classes, as shown below.

  1. (C1’)

If $a\equiv P$ (mod $3$), then $S\equiv 2P-a,a,6P-a,4P+a$ $(\text{mod}~{}6P)$.

  2. (C2’)

If $a\not\equiv P$ (mod $3$), then $S\equiv a,4P-a,2P+a,6P-a$
$(\text{mod}~{}6P)$.

While in Case (C1’), the rest of the proof can be copied, in Case (C2’) this
requires a change in sign in the original sum from
$(-1)^{\left\lfloor(n+2)/4\right\rfloor}$ to $(-1)^{\left\lfloor
5n/4\right\rfloor}$. ∎

The following theorem covers Theorems 11, 12, 28 and 29.

######  Theorem 36.

Let $P$ be an odd prime power and let $a$ be a positive integer relatively
prime to $P$ and less than $P/2$. Let $(a_{n})_{n\geq 0}$ be the sequence of
non-negative integers $m$ such that $3Pm+a^{2}$ is a square.

  1. (1)

If $a\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{(4P-4a)/3},q^{(2P+4a)/3},q^{2P};q^{2P})_{\infty}}{(q^{(5P-2a)/3},q^{(P+2a)/3};q^{2P})_{\infty}}.$
(10.8)

  2. (2)

If $a\not\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{(4P+4a)/3},q^{(2P-4a)/3},q^{2P};q^{2P})_{\infty}}{(q^{(5P+2a)/3},q^{(P-2a)/3};q^{2P})_{\infty}}.$
(10.9)

###### Proof.

We have to find all $S$ such that

$S^{2}\equiv a^{2}\pmod{3P}.$

As before, there are two cases:

  1. (C1)

If $a\equiv P$ (mod $3$), then $S\equiv a,P+a,2P-a,3P-a$ $(\text{mod}~{}3P)$.

  2. (C2)

If $a\not\equiv P$ (mod $3$), then $S\equiv a,P-a,2P+a,3P-a$
$(\text{mod}~{}3P)$.

We now discuss Case (C1). Here, we have

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+a)^{2}-a^{2})}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+P+a)^{2}-a^{2})}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+2P-a)^{2}-a^{2})}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+3P-a)^{2}-a^{2})}\\\
=\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2ak}+\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2(P+a)k+\frac{1}{3}(P+2a)}\kern
85.35826pt\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2(2P-a)k+\frac{4}{3}(P-a)}-\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2(3P-a)k+3P-2a}.$

Again, sums can be put together in pairs, so that one obtains two sums over
all integers $k$:

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=-\infty}^{\infty}(-1)^{k}q^{3Pk^{2}+2ak}+\sum_{k=-\infty}^{\infty}(-1)^{k}q^{3Pk^{2}+2(P+a)k+\frac{1}{3}(P+2a)}.$

Now, to each of these sums we apply the Jacobi triple product identity (4.1)
to get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=(q^{6P},q^{3P+2a},q^{3P-2a};q^{6P})_{\infty}\\\
+q^{(P+2a)/3}\,(q^{6P},q^{5P+2a},q^{P-2a};q^{6P})_{\infty}.$

The sum of these two products simplifies to the single product on the right-
hand side of (10.8) as is seen by applying (8.2) with $N=2P$ and
$u=q^{(5P-2a)/3}$.

On the other hand, if we are in Case (C2), then we have

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+a)^{2}-a^{2})}+\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+P-a)^{2}-a^{2})}\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+2P+a)^{2}-a^{2})}-\sum_{k=0}^{\infty}(-1)^{k}q^{\frac{1}{3P}((3Pk+3P-a)^{2}-a^{2})}\\\
=\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2ak}+\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2(P-a)k+\frac{1}{3}(P-2a)}\kern
85.35826pt\\\
-\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2(2P+a)k+\frac{4}{3}(P+a)}-\sum_{k=0}^{\infty}(-1)^{k}q^{3Pk^{2}+2(3P-a)k+3P-2a}.$

Again, sums can be put together in pairs, so that one obtains two sums over
all integers $k$:

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\sum_{k=-\infty}^{\infty}(-1)^{k}q^{3Pk^{2}+2ak}+\sum_{k=-\infty}^{\infty}(-1)^{k}q^{3Pk^{2}+2(P-a)k+\frac{1}{3}(P-2a)}.$

Now, to each of these sums we apply the Jacobi triple product identity (4.1)
to get

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=(q^{6P},q^{3P+2a},q^{3P-2a};q^{6P})_{\infty}\\\
+q^{(P-2a)/3}\,(q^{3P},q^{5P-2a},q^{P+2a};q^{6P})_{\infty}.$

The sum of these two products simplifies to the single product on the right-
hand side of (10.8) as is seen by applying (8.2) with $N=2P$ and
$u=q^{(5P+2a)/3}$. ∎

The following corollary covers Theorem 30.

######  Corollary 37.

Let $P$ be an odd prime power and let $a$ be a positive integer relatively
prime to $P$ with $P/2<a<P$. Let $(a_{n})_{n\geq 0}$ be the sequence of non-
negative integers $m$ such that $3Pm+a^{2}$ is a square.

  1. (1)

If $a\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor
5n/4\right\rfloor}q^{a_{n}}=\frac{(q^{(4P-4a)/3},q^{(2P+4a)/3},q^{2P};q^{2P})_{\infty}}{(q^{(5P-2a)/3},q^{(P+2a)/3};q^{2P})_{\infty}}.$
(10.10)

  2. (2)

If $a\not\equiv P$ (mod $3$), then

$\sum_{n=0}^{\infty}(-1)^{\left\lfloor(n+2)/4\right\rfloor}q^{a_{n}}=\frac{(q^{(4P+4a)/3},q^{(2P-4a)/3},q^{2P};q^{2P})_{\infty}}{(q^{(5P+2a)/3},q^{(P-2a)/3};q^{2P})_{\infty}}.$
(10.11)

###### Proof.

Here, one goes through the proof of Theorem 36. Everything can be copied,
except that the description of the two cases to be considered now reads as
shown below, and that this requires a modification of the sign in Case (C1’).

  1. (C1’)

If $a\equiv P$ (mod $3$), then $S\equiv a,2P-a,P+a,3P-a$ $(\text{mod}~{}3P)$.

  2. (C2’)

If $a\not\equiv P$ (mod $3$), then $S\equiv P-a,a,3P-a,2P+a$
$(\text{mod}~{}3P)$.∎

The following theorem covers Theorems 31 and 32.

######  Theorem 38.

Let $a$ be $1$ or $3$. Furthermore, let $(a_{n})_{n\geq 0}$ be the sequence of
non-negative integers $m$ such that $16m+a^{2}$ is a square. Then

$\sum_{n=0}^{\infty}q^{a_{n}}=(q^{8};q^{8})_{\infty}\,(-q^{4+a};q^{8})_{\infty}\,(-q^{4-a};q^{8})_{\infty}.$
(10.12)

###### Proof.

We have to find all $S$ such that

$S^{2}\equiv a^{2}\pmod{16},$

or, equivalently,

$(S-a)(S+a)\equiv 0\pmod{16}.$

Since $a$ is odd, only one of the factors $N-a$ and $N+a$ can be divisible by
$4$. Hence, either $S\equiv a$ $(\text{mod}~{}8)$ or $S\equiv-a$
$(\text{mod}~{}8)$. Consequently, we have

$\displaystyle\sum_{n=0}^{\infty}q^{a_{n}}$
$\displaystyle=\sum_{k=0}^{\infty}q^{\frac{1}{16}((8k+a)^{2}-a^{2})}+\sum_{k=1}^{\infty}q^{\frac{1}{16}((8k-a)^{2}-a^{2})}$
$\displaystyle=\sum_{k=0}^{\infty}q^{4k^{2}+ak}+\sum_{k=1}^{\infty}q^{4k^{2}-ak}=\sum_{k=-\infty}^{\infty}q^{4k^{2}+ak}.$

The proof is completed by applying the Jacobi triple product identity (4.1). ∎

##  11\. Consequences and open problems

In this section, we record a consequence of Theorem 1 that is inspired by
earlier work of the Andrews and the second author [1]. Furthermore, we end by
reminding the reader of a conjecture from [3] related to Theorems 1–6.

In [1], the function $M_{k}(n)$ is defined as the number of partitions of $n$
in which $k$ is the least positive integer that is not a part and there are
more parts $>k$ than there are parts $<k$. For example, if $n=18$ and $k=3$
then we have $M_{3}(18)=3$ because the three partitions in question are

$5+5+5+2+1,\quad 6+5+4+2+1,\quad\text{and}\quad 7+4+4+2+1.$

Let $A(n)$ be the number of the partitions of $n$ into parts not congruent to
$0$, $7$, $8$, $13$, $15$, $20$, $22$, $27$, $28\pmod{35}$ and the parts
congruent to $4$, $9$, $11$, $16$, $19$, $24$, $26$, $31\pmod{35}$ have two
colors.

We have the following corollary of Theorem 1.

######  Corollary 39.

Let $k$ and $n$ be positive integers. With $a_{n}$ and $t(n)$ as in Theorem 1,
we have

$(-1)^{k-1}\left(\sum_{j=-(k-1)}^{k}(-1)^{j}A\big{(}n-j(3j-1)/2\big{)}-\delta(n)\right)=\sum_{j=0}^{n}(-1)^{t(j)}M_{k}(n-a_{j}),$

where

$\delta(n)=\begin{cases}(-1)^{t(m)},&\text{if $n=a_{m}$,}\\\
0,&\text{otherwise.}\end{cases}$

###### Proof.

Elementary generating function calculus gives

$\sum_{n=0}^{\infty}A(n)q^{n}=\frac{1}{(q,q^{4};q^{5})_{\infty}\,(q^{2},q^{3},q^{4},q^{5};q^{7})_{\infty}}.$
(11.1)

Similarly, it is not difficult to see that the generating function for the
numbers $M_{k}(n)$ is given by

$\sum_{n=0}^{\infty}M_{k}(n)q^{n}=\sum_{n=k}^{\infty}\frac{q^{{\binom{k}{2}}+(k+1)n}}{(q;q)_{n}}\begin{bmatrix}n-1\\\
k-1\end{bmatrix},$ (11.2)

where

$\begin{bmatrix}n\\\
k\end{bmatrix}=\begin{cases}\dfrac{(1-q)(1-q^{2})\cdots(1-q^{n})}{(1-q)(1-q^{2})\cdots(1-q^{k})\,(1-q)(1-q^{2})\cdots(1-q^{n-k})},&\text{if
$0\leqslant k\leqslant n$},\\\ 0,&\text{otherwise,}\end{cases}$

is the usual $q$-binomial coefficient.

Euler’s pentagonal number theorem

$\sum_{n=-\infty}^{\infty}(-1)^{n}q^{n(3n-1)/2}=(q;q)_{\infty}$ (11.3)

arises from Jacobi’s triple product identity (4.1) by replacing $q$ by $q^{3}$
and putting $z=q$. Andrews and the second author [1] proved the following
truncated form of Euler’s identity:

$\frac{(-1)^{k-1}}{(q;q)_{\infty}}\sum_{n=-(k-1)}^{k}(-1)^{n}q^{n(3n-1)/2}=(-1)^{k-1}+\sum_{n=k}^{\infty}\frac{q^{{\binom{k}{2}}+(k+1)n}}{(q;q)_{n}}\begin{bmatrix}n-1\\\
k-1\end{bmatrix}.$ (11.4)

Multiplying both sides of (11.4) by (11.1), and using Theorem 1 and (11.2), we
obtain

$(-1)^{k-1}\left(\bigg{(}\sum_{n=1}^{\infty}A(n)q^{n}\bigg{)}\bigg{(}\sum_{n=-(k-1)}^{k}(-1)^{n}q^{n(3n-1)/2}\bigg{)}-\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}\right)\\\
=\left(\sum_{n=0}^{\infty}(-1)^{t(n)}q^{a_{n}}\right)\left(\sum_{n=0}^{\infty}M_{k}(n)q^{n}\right),$

The assertion of the corollary now follows by comparing coefficients of
$q^{n}$ on both sides of this equation. ∎

According to (11.4), for $k>0$, the coefficients of $q^{n}$ in the series

$(-1)^{k-1}\left(\frac{1}{(q;q)_{\infty}}\sum_{j=-(k-1)}^{k}(-1)^{j}q^{j(3j-1)/2}-1\right)$

are all zero for $0\leqslant n<k(3k+1)/2$, and for $n\geqslant k(3k+1)/2$ all
the coefficients are positive. Related to this result on truncated pentagonal
number series, we remark that there is substantial numerical evidence that
there is in fact a stronger result.

######  Conjecture 40.

For $k>0$, the coefficients of $q^{n}$ in the series

$(-1)^{k-1}\left(\frac{1}{(q;q)_{\infty}}\sum_{j=-(k-1)}^{k}(-1)^{j}q^{j(3j-1)/2}-1\right)(q,q^{6},q^{7};q^{7})_{\infty}\\\
=\frac{(-1)^{k}}{(q^{2},q^{3},q^{4},q^{5};q^{7})_{\infty}}\sum_{j=k}^{\infty}(-1)^{j}q^{j(3j+1)/2}\left(1-q^{2j+1}\right)$

are all zero for $0\leqslant n<k(3k+1)/2$ and $n=k(3k+1)/2+1$. For
$n=k(3k+1)/2$ and $n\geqslant k(3k+1)/2+2$ all the coefficients are positive.

######  Remark.

The equality above follows easily from (11.3) and little manipulation.

If we assume Conjecture 40, then we immediately deduce that the partition
functions $A(n)$ satisfies the following infinite families of linear
inequalities.

######  Conjecture 41.

For $k>0$, we have

$(-1)^{k-1}\left(\sum_{j=-(k-1)}^{k}(-1)^{j}A\big{(}n-j(3j-1)/2\big{)}-\delta(n)\right)\geqslant
0,$

with strict inequalities if $n=k(3k+1)/2$ or $n\geqslant k(3k+1)/2+2$.

To conclude the article, we want to recall a conjecture from [3] that is very
similar in appearance to Conjecture 40 and is related (again via (11.3)) to
Theorems 1–6.

######  Conjecture 42.

For $k>0$ and $S\in\\{1,2,3,4,5,6\\}$, the coefficients of $q^{n}$ in the
series

$\frac{(-1)^{k}}{(q,q^{4};q^{5})_{\infty}}\sum_{j=k}^{\infty}(-1)^{j}q^{7j(j+1)/2-jS}\left(1-q^{(2j+1)S}\right)$

and

$\frac{(-1)^{k}}{(q^{2},q^{3};q^{5})_{\infty}}\sum_{j=k}^{\infty}(-1)^{j}q^{7j(j+1)/2-jS}\left(1-q^{(2j+1)S}\right)$

are non-negative.

## References

  * [1] G. E. Andrews and M. Merca, The truncated pentagonal number theorem, J. Combin. Theory Ser. A 119 (2012), 1639–1643.
  * [2] G. Gasper and M. Rahman, Basic Hypergeometric Series, Encyclopedia of Mathematics And Its Applications 35, Cambridge University Press, Cambridge, 1990.
  * [3] M. Merca, Truncated theta series and Rogers–Ramanujan functions, Exp. Math. (to appear), https://doi.org/10.1080/10586458.2018.1542642.
  * [4] R. Miranda, Algebraic Curves and Riemann Surfaces, Graduate Studies in Mathematics, vol. 5, Amer. Math. Soc., Providence, R.I., 1995\.
  * [5] T. Miyake, Modular Forms, translated from the Japanese by Y. Maeda, Springer–Verlag, Berlin, 1989.
  * [6] P. Paule and C.-S. Radu, Partition analysis, modular functions, and computer algebra, in: Recent Trends in Combinatorics, IMA Vol. Math. Appl., vol. 159, Springer, Cham, 2016, pp. 511–543.
  * [7] E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, reprint of the 4th ed. (1927), Cambridge University Press, Cambridge, 1996.
  * [8] Y. Yang, Defining equations of modular curves, Adv. Math. 204 (2006), 481–508.