Partition-Theoretic Results and Recurrence Relations for the Coefficients of
Some Mock Theta Functions

Sabi Biswas and Nipen Saikia∗
Department of Mathematics, Rajiv Gandhi University,
Rono Hills, Doimukh-791112, Arunachal Pradesh, India.
E. Mail(s<EMAIL_ADDRESS><EMAIL_ADDRESS>
∗Corresponding author.

Abstract: In this paper, we give partition-theoretic results for the
coefficients of some mock theta functions and prove their congruence
properties. Some recurrence relations connecting the coefficients of the mock
theta functions with certain restricted partition functions are also
established.

Keywords and phrases: Mock theta function; partition congruences; recurrence
relations. 2020 Mathematical Subject Classification: 11B75; 11P83.

##  1 Introduction

In 1920, Ramanujan introduced $17$ functions in his last letter to G. H. Hardy
[24, p. 534], which he called as mock theta functions. Initially, Ramanujan
divided his list of mock theta functions into odd order as three, five and
seven. After Ramanujan, many new mock theta-functions are defined and studied
by different mathematicians. An account of these can be found in the papers by
Andrews [4], Andrews and Hickerson [6], Gordon and McIntosh [13], K. Hikami
[15] and references therein. In this paper, we are interested in following
mock theta functions of order two, six and eight:

$\displaystyle\mu(q)=\sum_{n=0}^{\infty}\dfrac{(-1)^{n}q^{n^{2}}(q;q^{2})_{n}}{(-q^{2};q^{2})_{n}^{2}},$
(1.1)
$\displaystyle\sigma(q)=\sum_{n=0}^{\infty}\dfrac{q^{(n+1)(n+2)/2}(-q;q)_{n}}{(q;q^{2})_{n+1}},$
(1.2)
$\displaystyle\beta(q)=\sum_{n=0}^{\infty}\dfrac{q^{3n^{2}+3n+1}}{(q;q^{3})_{n+1}(q^{2};q^{3})_{n+1}},$
(1.3)
$\displaystyle\lambda(q)=\sum_{n=0}^{\infty}\dfrac{(-1)^{n}q^{n}(q;q^{2})_{n}}{(-q;q)_{n}},$
(1.4) $\displaystyle
v(q)=\sum_{n=0}^{\infty}\dfrac{q^{(n+1)^{2}}(-q;q^{2})_{n}}{(q;q^{2})_{n+1}},$
(1.5)

where

$(b;q)_{n}:=\prod_{k=0}^{n-1}(1-bq^{k})\quad\text{and}\quad(b;q)_{\infty}:=\prod_{k=0}^{\infty}(1-bq^{k}).$

For brevity, we will write, for any positive integer $k$,

$\ell_{k}:=(q^{k};q^{k})_{\infty}$

and

$(b_{1},b_{2},b_{3},...,b_{k};q)_{\infty}:=(b_{1};q)_{\infty}(b_{2};q)_{\infty}(b_{3};q)_{\infty}....(b_{k};q)_{\infty}.$

The function defined in (1.5) is a eighth order mock theta function defined in
[13, pp. 322-323]. Agarwal and Sood [1] gave combinatorial interpretation of
$v(q)$ using split $(n+t)$-color partitions. Rana and Sareen [26] extended
their results using signed partitions.

The function defined in (1.1) is the second order mock theta function which
appeared in Ramanujan’s lost notebook [24] (see also [4]). Combinatorial
interpretation of $\mu(q)$ was given by Kaur and Rana in [19].

The functions defined in (1.2)-(1.4) are the sixth order mock theta functions.
In 2018, Zhang [29] established some congruences modulo $3$, $5$ and $7$ for
the coefficients of the mock theta fucntion $\beta(q)$. Kaur and Rana [18]
proved some particular and infinite families of congruences for the
coefficients of the mock theta fucntion $\lambda(q)$.

In this paper, we prove partition-theoretic results for the coeffcients of the
mock theta functions defined in (1.2)-(1.5), and establish their congruence
properties. We also prove some recurrence relations connecting the
coefficients of the mock theta functions and certain restricted partition
functions. The results on mock theta functions $v(q)$, $\sigma(q)$, $\beta(q)$
and $\lambda(q)$ are established in Sections 3, 4, 5, and 6. respectively.
Section 2 is devoted to record some preliminary results which will be used in
the subsequent sections.

We end this introduction by defining partition of a positive integer, colour
partition of a positive integer, and their generating functions. A partition
of an positive integer $n$ can be defined as finite sequence of positive
integers $(\delta_{1},\delta_{2},\cdots,\delta_{k})$ such that
$\sum_{j=1}^{k}\delta_{j}=n;\quad\delta_{j}\geq\delta_{j+1},$ where
$\delta_{j}$ are called parts or summands of the partition. The number of
partitions of $n$ is usually denoted by $p(n)$. The generating function for
the partition function $p(n)$ is given by Euler [11] as

$\sum_{n=0}^{\infty}p(n)q^{n}=\frac{1}{(q;q)_{\infty}}=\frac{1}{\ell_{1}},\qquad
p(0)=1.$ (1.6)

Euler [3] provided the following recurrence relation for finding the values of
the partition function $p(n)$:

$\displaystyle p(n)-p(n-1)-p(n-2)+p(n-5)+p(n-7)-p(n-12)-p(n-15)+.....$
$\displaystyle+(-1)^{k}p\Big{(}n-k(3k-1)/2\Big{)}+(-1)^{k}p\Big{(}n-k(3k+1)/2\Big{)}+...=\left\\{\begin{array}[]{cc}1,\quad
if~{}n=0,\\\ \hskip 8.5359pt0,\quad\mbox{otherwise}.\end{array}\right.$

where the numbers of the form $k(3k\pm 1)/2$ are called pentagonal numbers.
For more recurrence relations of different partition functions one can see
[12, 21, 22, 28]. Ramanujan [23] offered following congruences for $p(n)$:

$p(5n+4)\equiv 0\,(\textup{mod}\,5),\quad p(7n+5)\equiv
0\,(\textup{mod}\,7)\quad\mbox{and}\quad p(11n+6)\equiv
0\,(\textup{mod}\,11).$

In a letter to Hardy, Ramanujan [8] introduced general partition function
$p_{r}(n)$ as

$\sum_{n=0}^{\infty}p_{r}(n)q^{n}=\dfrac{1}{(q;q)_{\infty}^{r}}=\frac{1}{\ell_{1}^{r}},$
(1.7)

where $r$ is any non-zero integer. $p_{1}(n)$ is the partition function $p(n)$
defined in (1.6). For $r>1$, $p_{r}(n)$ is the colour partition function of an
integer $n\geq 1$ in which each part in the partitions of $n$ is assumed to
have $r$ different colours and all of them are considered as distinct. For
$r=-1$, $p_{r}(n)$ is the Euler’s pentagonal number theorem and can be
combinatorially interpretated in terms of partition of integers as

$p_{-1}(n)=p(n,e)-p(n,o)=\begin{cases}(-1)^{m}&\text{if}~{}n=m(3m\pm 1)/2\\\
0&\text{otherwise}\end{cases},$ (1.8)

where $p(n,e)$ (resp. $p(n,o)$) is the number of partitions of $n$ with even
(resp. odd) number of distinct parts. For $r<-1$, it is easily seen that

$p_{r}(n)=p_{r}(n,e)-p_{r}(n,o),$ (1.9)

where $p_{r}(n,e)$ (resp. $p_{r}(n,o)$) is the number of partitions of $n$
with even (resp. odd) number of distinct parts and each part has $r$ colours.
It is useful to note here that, for positive integers $r$, $s$ and $t$,

$\dfrac{1}{(q^{t};q^{s})^{r}}$

denotes the generating function of the number of partitions of a positive
integer such that parts are $\equiv t\,(\textup{mod}\,s)$ and each part has
$r$ distinct colours.

To prove recurrence relations, we will also use the restricted partition
functions $\bar{p}_{r}(n)$, $p_{rd}(n)$ and $A_{4}(n)$, where $\bar{p}_{r}(n)$
denotes the number of overpartitions of $n$ with $r$ copies, $p_{rd}(n)$
denotes the number of partition of $n$ into distinct parts with $r$ copies and
$A_{4}(n)$ denotes the number of $4$-regular partitions of $n$ respectively.
The corresponding generating functions are given by

$\displaystyle\sum_{n=0}^{\infty}\bar{p}_{r}(n)q^{n}={\left(\dfrac{\ell_{2}}{\ell_{1}^{2}}\right)}^{r},$
(1.10)
$\displaystyle\sum_{n=0}^{\infty}p_{rd}(n)q^{n}={\left(\dfrac{\ell_{2}}{\ell_{1}}\right)}^{r},$
(1.11)
$\displaystyle\sum_{n=0}^{\infty}A_{4}(n)q^{n}=\dfrac{\ell_{4}}{\ell_{1}}.$
(1.12)

##  2 Preliminaries

Ramanujan defined general theta-function $f(c,d)$ [7, p. 34, (18.1)] as

$f(c,d)=\sum_{m={-}\infty}^{\infty}c^{m(m+1)/2}d^{m(m-1)/2},\quad|cd|<1.$
(2.1)

Three useful special cases [7, p. 35, Entry 18] of $f(c,d)$ are given by

$\phi(q):=f(q,q)=\sum_{m={-}\infty}^{\infty}q^{{m}^{2}}=\frac{\ell_{2}^{5}}{{\ell_{1}^{2}}{\ell_{4}^{2}}},$
(2.2)
$\psi(q):=f(q,q^{3})=\sum_{m=0}^{\infty}q^{m(m+1)/2}=\frac{\ell_{2}^{2}}{\ell_{1}}$
(2.3)

and

$f(-q):=f(-q,-q^{2})=\sum_{m=-\infty}^{\infty}(-1)^{m}{q}^{m(3m-1)/2}=\ell_{1}.$
(2.4)

The product representations in right hand side of (2.2)-(2.4) are the
consequences of the Jacobi’s triple product identity given by

$f(c,d)=(-c;cd)_{\infty}(-d;cd)_{\infty}(cd;cd)_{\infty}.$ (2.5)

By using elementary $q$-operations, it is easily seen that

$\phi(-q)=\frac{(q;q)_{\infty}}{(-q;q)_{\infty}}=\frac{(q;q)_{\infty}^{2}}{(q^{2};q^{2})_{\infty}}=\frac{\ell_{1}^{2}}{\ell_{2}}.$
(2.6)

In some of the proofs, we will also use the Jacobi’s identity [7, p. 39, Entry
24] given by

$\ell_{1}^{3}=\sum_{k=0}^{\infty}(-1)^{k}(2k+1)q^{k(k+1)/2}.$ (2.7)

######  Lemma 2.1 ([10, Theorem 2.1]).

If p is an odd prime, then

$\psi(q)=\sum_{m=0}^{(p-3)/2}q^{(m^{2}+m)/2}f\left(q^{\left(p^{2}+(2m+1)p\right)/2},q^{\left(p^{2}-(2m+1)p\right)/2}\right)+q^{(p^{2}-1)/8}\psi(q^{p^{2}}).$
(2.8)

Furthermore,
$\dfrac{m^{2}+m}{2}\not\equiv\dfrac{p^{2}-1}{8}\,(\textup{mod}\,p)\quad
for\quad 0\leq m\leq\dfrac{p-3}{2}.$

######  Lemma 2.2 ([10, Theorem 2.2]).

If $p\geq 5$ is a prime, then

$\ell_{1}=\sum_{\begin{subarray}{c}t={-(p-1)/2}\\\ t\neq{(\pm
p-1)/6}\end{subarray}}^{(p-1)/2}(-1)^{t}q^{(3t^{2}+t)/2}f\left(-q^{\left(3p^{2}+(6t+1)p\right)/2},-q^{\left(3p^{2}-(6t+1)p\right)/2}\right)\\\
+(-1)^{(\pm p-1)/6}q^{(p^{2}-1)/24}f_{p^{2}},$ (2.9)

where

$\dfrac{\pm p-1}{6}=\left\\{\begin{array}[]{cc}\dfrac{(p-1)}{6}\quad
if~{}p\equiv 1\,(\textup{mod}\,6),\\\ \dfrac{(-p-1)}{6}\quad
if~{}p\equiv-1\,(\textup{mod}\,6).\end{array}\right.$

Furthermore, if $\dfrac{-p-1}{2}\leq t\leq\dfrac{p-1}{2}\quad and\quad
t\neq\dfrac{\pm p-1}{2},\quad
then\quad\dfrac{3t^{2}+t}{2}\not\equiv\dfrac{p^{2}-1}{24}\,(\textup{mod}\,p).$

######  Lemma 2.3 ([2, Lemma 2.3]).

If p is an odd prime, then

$\ell_{1}^{3}=\sum_{\begin{subarray}{c}k=0\\\
k\neq(p-1)/2\end{subarray}}^{(p-1)}(-1)^{k}q^{k(k+1)/2}\sum_{n=0}^{\infty}(-1)^{n}(2pn+2k+1)q^{pn(pn+2k+1)/2}\\\
+p(-1)^{(p-1)/2}q^{(p^{2}-1)/8}f_{p^{2}}^{3}.$ (2.10)

Furthermore, if $k\neq\dfrac{p-1}{2},\quad 0\leq k\leq p-1,\quad
then\quad\dfrac{k^{2}+k}{2}\not\equiv\dfrac{p^{2}-1}{8}\,(\textup{mod}\,p).$

######  Lemma 2.4.

We have

$\displaystyle\dfrac{\ell_{2}}{\ell_{1}^{2}}=\dfrac{\ell_{6}^{4}\ell_{9}^{6}}{\ell_{3}^{8}\ell_{18}^{3}}+2q\dfrac{\ell_{6}^{3}\ell_{9}^{3}}{\ell_{3}^{7}}+4q^{2}\dfrac{\ell_{6}^{2}\ell_{18}^{3}}{\ell_{3}^{6}},$
(2.11)
$\displaystyle\dfrac{1}{\ell_{1}\ell_{2}}=\dfrac{\ell_{9}^{9}}{\ell_{3}^{6}\ell_{6}^{2}\ell_{18}^{3}}+q\dfrac{\ell_{9}^{6}}{\ell_{3}^{5}\ell_{6}^{3}}+3q^{2}\dfrac{\ell_{9}^{3}\ell_{18}^{3}}{\ell_{3}^{4}\ell_{6}^{4}}-2q^{3}\dfrac{\ell_{18}^{6}}{\ell_{3}^{3}\ell_{6}^{5}}+4q^{4}\dfrac{\ell_{18}^{9}}{\ell_{3}^{2}\ell_{6}^{6}\ell_{9}^{3}},$
(2.12)
$\displaystyle\dfrac{\ell_{4}}{\ell_{1}}=\dfrac{\ell_{12}\ell_{18}^{4}}{\ell_{3}^{3}\ell_{36}^{2}}+q\dfrac{\ell_{6}^{2}\ell_{9}^{3}\ell_{36}}{\ell_{3}^{4}\ell_{18}^{2}}+2q^{2}\dfrac{\ell_{6}\ell_{18}\ell_{36}}{\ell_{3}^{3}}.$
(2.13)

The proof of (2.11) can be seen from [17]. The identity (2.12) was obtained by
Chan [9]. The identity (2.13) follows from Equations (33.2.1) and (33.2.5) in
[16].

In addition to above identities, we need the following congruences which are
easy consequences of the binomial theorem: For any prime $p$ and positive
integers $n$ and $t$, we have

$\displaystyle\ell_{n}^{tp}\equiv\ell_{np}^{t}\,(\textup{mod}\,p),$ (2.14)
$\displaystyle\ell_{1}^{2^{t}}\equiv\ell_{2}^{2^{t-1}}\,(\textup{mod}\,2^{t}).$
(2.15)

In order to state our congruences, we will also use Legendre’s symbol which is
defined as follows:

Let $p$ be any odd prime and $\omega$ be any integer relatively prime to $p$,
then the Legendre’s symbol $\left(\dfrac{\omega}{p}\right)$ is defined by

$\left(\dfrac{\omega}{p}\right)=\left\\{\begin{array}[]{cc}1,~{}\text{if
$\omega$ is quadratic residue of $p$},\\\ -1,~{}\text{if $\omega$ is quadratic
non-residue of $p$}.\end{array}\right.$

We will also use the notation, for any real number $x$,

$\lfloor x\rfloor=k,\quad\mbox{where}\quad k\leq x<k+1\quad\mbox{and}\quad
k\quad\mbox{is an integer}.$

##  3 Results on $v(q)$

Throughout the section, we set $\sum_{n=0}^{\infty}P_{v}(n)q^{n}=v(q)$, where
$v(q)$ is defined in (1.5).

######  Theorem 3.1.

We have

$\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}=\dfrac{\ell_{4}^{3}}{\ell_{1}\ell_{2}}.$

###### Proof.

From Ramanujan’s lost notebook [5, p. 280, Entry 12.5.1] and [20, p. 288], we
note that

$\mu(-q^{2})+4v(q)=\dfrac{(q^{4};q^{4})_{\infty}(-q^{2};q^{4})_{\infty}^{3}}{(q^{2};q^{4})_{\infty}^{2}(-q^{4};q^{4})_{\infty}^{2}}+4q\dfrac{(q^{8};q^{8})_{\infty}(-q^{4};q^{4})_{\infty}}{(q^{4};q^{8})_{\infty}(q^{2};q^{4})_{\infty}},$
(3.1)

where $p_{\mu}(q)$ is defined as in (1.1). Simplifying (3.1), we obtain

$4v(q)=-\mu(-q^{2})+\dfrac{(q^{4};q^{4})_{\infty}(-q^{2};q^{4})_{\infty}^{3}}{(q^{2};q^{4})_{\infty}^{2}(-q^{4};q^{4})_{\infty}^{2}}+4q\dfrac{(q^{8};q^{8})_{\infty}(-q^{4};q^{4})_{\infty}}{(q^{4};q^{8})_{\infty}(q^{2};q^{4})_{\infty}}$
(3.2)

Extracting the terms involving $q^{2n+1}$ from (3.2) and dividing by $q$ and
then replacing $q^{2}$ by $q$, we obtain

$\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}=\dfrac{(q^{4};q^{4})_{\infty}(-q^{2};q^{2})_{\infty}}{(q^{2};q^{4})_{\infty}(q;q^{2})_{\infty}}$
(3.3)

Now the desired results easily follows from (3.3). ∎

######  Theorem 3.2.

We have

$P_{v}(2n+1)={P_{v}}_{(d,e)}(n)-{P_{v}}_{(d,0)}(n),$

where ${P_{v}}_{(d,e)}(n)\left(resp.\quad{P_{v}}_{(d,0)}(n)\right)$ denotes
the number of partitions of $n$ such that

  * $(i)$

parts congruent to $1,3\,(\textup{mod}\,4)$ have one colour,

  * $(ii)$

parts congruent to $2\,(\textup{mod}\,4)$ have two colour,

  * $(iii)$

parts congruent to $0\,(\textup{mod}\,4)$ are distinct and have one colour,

  * $(iv)$

number of parts congruent to $0\,(\textup{mod}\,4)$ being even (resp. odd).

###### Proof.

From Theorem 3.1, we have

$\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}=\dfrac{\ell_{4}^{3}}{\ell_{1}\ell_{2}}.$
(3.4)

Changing the bases to $q^{4}$ in (3.4), we obtain

$\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}=\dfrac{(q^{4};q^{4})_{\infty}^{3}}{(q,q^{2},q^{3},q^{4};q^{4})_{\infty}(q^{2},q^{4};q^{4})_{\infty}},$
(3.5)

which implies

$\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}=\dfrac{(q^{4};q^{4})_{\infty}}{(q,q^{3};q^{4})_{\infty}(q^{2};q^{4})_{\infty}^{2}}.$
(3.6)

Now, the result immediately follows from (3.6). ∎

######  Theorem 3.3.

We have

$(i)\quad P_{v}(6n+5)\equiv 0\,(\textup{mod}\,3).$

$(ii)$ Let $p\geq 3$ be any prime such that $\left(\dfrac{-2}{p}\right)=-1$.
Then for any integer $\alpha\geq 0$, we have

$\sum_{n=0}^{\infty}P_{v}\left(2\cdot p^{2\alpha}n+\dfrac{3\cdot
p^{2\alpha}+1}{4}\right)q^{n}\equiv\psi(q)\psi(q^{2})\,(\textup{mod}\,2),$
(3.7) $\hskip 34.14322ptP_{v}\left(2\cdot p^{2\alpha+2}n+2\cdot
p^{2\alpha+1}j+\dfrac{3\cdot p^{2\alpha+2}+1}{4}\right)\equiv
0\,(\textup{mod}\,2),\quad 1\leq j\leq(p-1).$ (3.8)

$(iii)$ Let $p\geq 5$ be any prime such that $\left(\dfrac{-18}{p}\right)=-1$.
Then for integer $\alpha\geq 0$, we have

$\sum_{n=0}^{\infty}P_{v}\left(6\cdot p^{2\alpha}n+\dfrac{19\cdot
p^{2\alpha}+1}{4}\right)q^{n}\equiv 3\ell_{1}\ell_{6}^{3}\,(\textup{mod}\,6).$
(3.9) $\hskip 34.14322ptP_{v}\left(6\cdot p^{2\alpha+2}n+6\cdot
p^{2\alpha+1}j+\dfrac{19\cdot p^{2\alpha+2}+1}{4}\right)\equiv
0\,(\textup{mod}\,6),\quad 1\leq j\leq(p-1).$ (3.10)

###### Proof.

(i) Using (2.13) in (3.4), we obtain

$\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}=\dfrac{\ell_{12}^{2}\ell_{18}^{6}}{\ell_{3}^{3}\ell_{6}\ell_{36}^{3}}+q\dfrac{\ell_{12}\ell_{6}\ell_{9}^{3}}{\ell_{3}^{4}}+3q^{2}\dfrac{\ell_{12}\ell_{18}^{3}}{\ell_{3}^{3}}+q^{3}\dfrac{\ell_{6}^{2}\ell_{9}^{3}\ell_{36}^{3}}{\ell_{3}^{4}\ell_{18}^{3}}+2q^{4}\dfrac{\ell_{6}\ell_{36}^{3}}{\ell_{3}^{3}}.$
(3.11)

Extracting the terms involving $q^{3n+2}$, dividing by $q^{2}$ and replacing
$q^{3}$ by $q$ from (3.11), we obtain

$\sum_{n=0}^{\infty}P_{v}(6n+5)q^{n}=3\dfrac{\ell_{4}\ell_{6}^{3}}{\ell_{1}^{3}}.$
(3.12)

Now (i) follows immediately from (3.12).

(ii) Using (2.14) in (3.4), we obtain

$\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}\equiv\psi(q)\psi(q^{2})\,(\textup{mod}\,2).$
(3.13)

which is the $\alpha=0$ case of (3.7). Assume that (3.7) is true for some
$\alpha\geq 0$. Now, substituting (2.8) in (3.7), we obtain

$\sum_{n=0}^{\infty}P_{v}\left(2\cdot p^{2\alpha}n+\dfrac{3\cdot
p^{2\alpha}+1}{4}\right)q^{n}\\\
\equiv\Big{[}\sum_{m=0}^{(p-3)/2}q^{(m^{2}+m)/2}f\left(q^{\left(p^{2}+(2m+1)p\right)/2},q^{\left(p^{2}-(2m+1)p\right)/2}\right)+q^{(p^{2}-1)/8}\psi(q^{p^{2}})\Big{]}\\\
\times\Big{[}\sum_{k=0}^{(p-3)/2}q^{(k^{2}+k)}f\left(q^{\left(p^{2}+(2k+1)p\right)},q^{\left(p^{2}-(2k+1)p\right)}\right)+q^{(p^{2}-1)/4}\psi(q^{2p^{2}})\Big{]}\,(\textup{mod}\,2).$
(3.14)

Consider the congruence

$\left(\dfrac{m^{2}+m}{2}\right)+\left({k^{2}+k}\right)\equiv
3\left(\dfrac{p^{2}-1}{8}\right)\,(\textup{mod}\,p),$ (3.15)

which is equivalent to

$(2m+1)^{2}+2(2k+1)^{2}\equiv 0\,(\textup{mod}\,p).$ (3.16)

For $\left(\dfrac{-2}{p}\right)=-1$, the congruence (3.16) has only solution
$m=k=\dfrac{(p-1)}{2}$. Therefore, extracting the terms involving
$q^{pn+3(p^{2}-1)/8}$, divding by $q^{3(p^{2}-1)/8}$ and replacing $q^{p}$ by
$q$ from (3.14), we obtain

$\sum_{n=0}^{\infty}P_{v}\left(2\cdot p^{2\alpha+1}n+\dfrac{3\cdot
p^{2\alpha+2}+1}{4}\right)q^{n}\equiv\psi(q^{p})\psi(q^{2p})\,(\textup{mod}\,2).$
(3.17)

Extracting the terms involving $q^{pn}$ and replacing $q^{p}$ by $q$ from
(3.17), we obtain

$\sum_{n=0}^{\infty}P_{v}\left(2\cdot p^{2\alpha+2}n+\dfrac{3\cdot
p^{2\alpha+2}+1}{4}\right)q^{n}\equiv\psi(q)\psi(q^{2})\,(\textup{mod}\,2),$

which is the $\alpha+1$ case of (3.7). Hence, by the method of induction we
complete the proof of (3.7). Again, extracting the terms involving $q^{pn+j}$,
$1\leq j\leq(p-1)$ from (3.17), we arrive at (3.8).

(iii) Using (2.15) in (3.12), we obtain

$\sum_{n=0}^{\infty}P_{v}(6n+5)q^{n}\equiv
3\ell_{1}\ell_{6}^{3}\,(\textup{mod}\,6).$ (3.18)

which is the $\alpha=0$ case of (3.9). Assume that (3.9) is true for some
$\alpha\geq 0$. Now, substituting (2.9) and (2.10) in (3.9), we obtain

$\sum_{n=0}^{\infty}P_{v}\left(6\cdot p^{2\alpha}n+\dfrac{19\cdot
p^{2\alpha}+1}{4}\right)q^{n}\\\ \hskip 5.69046pt\equiv
3\Big{[}\sum_{\begin{subarray}{c}t={-(p-1)/2}\\\ t\neq{(\pm
p-1)/6}\end{subarray}}^{(p-1)/2}(-1)^{t}q^{(3t^{2}+t)/2}f\left(-q^{3p^{2}+(6t+1)p/2},-q^{3p^{2}-(6t+1)p/2}\right)+(-1)^{(\pm
p-1)/6}q^{(p^{2}-1)/24}f_{p^{2}}\Big{]}\\\
\times\Big{[}\sum_{\begin{subarray}{c}k=0\\\
k\neq(p-1)/2\end{subarray}}^{(p-1)}(-1)^{k}q^{3k(k+1)}\sum_{n=0}^{\infty}(-1)^{n}(2pn+2k+1)q^{6pn(pn+2k+1)/2}\\\
+p(-1)^{(p-1)/2}q^{6(p^{2}-1)/8}f_{6p^{2}}^{3}\Big{]}\,(\textup{mod}\,6).$
(3.19)

Consider the congruence

$\left(\dfrac{3t^{2}+t}{2}\right)+(3k^{2}+3k)\equiv
19\left(\dfrac{p^{2}-1}{24}\right)\,(\textup{mod}\,p),$ (3.20)

which is equivalent to

$(6t+1)^{2}+18(2k+1)^{2}\equiv 0\,(\textup{mod}\,p).$ (3.21)

For $\left(\dfrac{-18}{p}\right)=-1$, the congruence (3.21) has only solution
$t=\dfrac{(\pm p-1)}{6}$ and $k=\dfrac{(p-1)}{2}$. Therefore, extracting the
terms involving $q^{pn+19(p^{2}-1)/24}$, divding by $q^{19(p^{2}-1)/24}$ and
replacing $q^{p}$ by $q$ from (3.19), we obtain

$\sum_{n=0}^{\infty}P_{v}\left(6\cdot p^{2\alpha+1}n+\dfrac{19\cdot
p^{2\alpha+2}+1}{4}\right)q^{n}\equiv
3\ell_{p}\ell_{6p}^{3}\,(\textup{mod}\,6).$ (3.22)

Extracting the terms involving $q^{pn}$ and replacing $q^{p}$ by $q$ from
(3.22), we obtain

$\sum_{n=0}^{\infty}P_{v}\left(6\cdot p^{2\alpha+2}n+\dfrac{19\cdot
p^{2\alpha+2}+1}{4}\right)q^{n}\equiv
3\ell_{1}\ell_{6}^{3}\,(\textup{mod}\,6),$

which is the $\alpha+1$ case of (3.9). Hence, by the method of induction we
complete the proof of (3.9). Now, extracting the terms involving $q^{pn+j}$,
$1\leq j\leq(p-1)$ from (3.22), we arrive at (3.10). ∎

######  Theorem 3.4.

We have

$P_{v}(2n+1)=A_{4}(n)+A_{4}(n-2)+A_{4}(n-6)+A_{4}(n-12)+...+A_{4}\Big{(}n-k(k+1)\Big{)}+...$

###### Proof.

From (3.4), we have

$\displaystyle\sum_{n=0}^{\infty}P_{v}(2n+1)q^{n}$
$\displaystyle=\dfrac{\ell_{4}}{\ell_{1}}\cdot\dfrac{\ell_{4}^{2}}{\ell_{2}}$
$\displaystyle=\left(\sum_{n=0}^{\infty}A_{4}(n)q^{n}\right)\psi(q^{2})$
$\displaystyle=\left(\sum_{n=0}^{\infty}A_{4}(n)q^{n}\right)\left(\sum_{k=0}^{\infty}q^{k(k+1)}\right)$
$\displaystyle=\left(\sum_{n=0}^{\infty}\sum_{k=0}^{\infty}A_{4}\Big{(}n-k(k+1)\Big{)}\right)q^{n}.$
(3.23)

On comparing the coefficients of $q^{n}$ in (3.23), we arrive at the desired
result. ∎

######  Theorem 3.5.

We have

$\displaystyle
P_{v}(6n+5)+\sum_{m=1}^{\infty}(-1)^{m}\Big{(}P_{v}(6n-9m^{2}-3m+5)+P_{v}(6n-9m^{2}+3m+5)\Big{)}$
$\displaystyle\hskip
93.89418pt=3\sum_{t=0}^{\infty}\sum_{c=0}^{\lfloor\frac{n-3t^{2}-3t}{2}\rfloor}(-1)^{t}(2t+1)p_{2d}\left(n-3t^{2}-3t-2c\right)\bar{p}(c).$

###### Proof.

From (3.12), we note that

$\left(\sum_{n=0}^{\infty}P_{v}(6n+5)q^{n}\right)\ell_{1}=3\left(\dfrac{\ell_{4}}{\ell_{2}^{2}}\right){\left(\dfrac{\ell_{2}}{\ell_{1}}\right)}^{2}\ell_{6}^{3}.$

Employing (1.10), (1.11), (2.4) and (2.7), we obtain

$\displaystyle\left(\sum_{n=0}^{\infty}P_{v}(6n+5)q^{n}\right)\left(1+\sum_{m=1}^{\infty}(-1)^{m}q^{m(3m+1)/2}+\sum_{m=1}^{\infty}(-1)^{m}q^{m(3m-1)/2}\right)$
$\displaystyle\hskip
85.35826pt=3\left(\sum_{k=0}^{\infty}\bar{p}(k)q^{2k}\right)\left(\sum_{l=0}^{\infty}p_{2d}(l)q^{l}\right)\ell_{6}^{3}$
$\displaystyle\hskip
85.35826pt=3\left(\sum_{l=0}^{\infty}\sum_{c=0}^{\lfloor\frac{l}{2}\rfloor}p_{2d}(l-2c)\bar{p}(c)q^{l}\right)\left(\sum_{n=0}^{\infty}(-1)^{n}(2n+1)q^{(3n^{2}+3n)}\right)$
$\displaystyle\hskip
85.35826pt=3\sum_{n=0}^{\infty}\sum_{l=0}^{\infty}\sum_{c=0}^{\lfloor\frac{l}{2}\rfloor}(-1)^{n}(2n+1)p_{2d}(l-2c)\bar{p}(c)q^{(l+3n^{2}+3n)},$

which imples

$\sum_{n=0}^{\infty}P_{v}(6n+5)q^{n}+\sum_{n=0}^{\infty}\sum_{m=1}^{\infty}(-1)^{m}\Big{(}P_{v}(6n-9m^{2}-3m+5)+P_{v}(6n-9m^{2}+3m+5)\Big{)}q^{n}$
$\hskip
113.81102pt=3\sum_{n=0}^{\infty}\sum_{t=0}^{\infty}\sum_{c=0}^{\lfloor\frac{n-3t^{2}-3t}{2}\rfloor}(-1)^{t}(2t+1)p_{2d}(n-3t^{2}-3t-2c)\bar{p}(c)q^{n}.$
(3.24)

Comparing the coefficients of $q^{n}$ in (3.24), we arrive at the desired
result. ∎

######  Remark 3.6.

Let $\mu(q)$ is as defined in (1.1) and
$\sum_{n=0}^{\infty}P_{\mu}(n)q^{n}=\mu(q)$. Then by (3.1), we have

$\sum_{n=0}^{\infty}P_{\mu}(n)q^{n}\equiv\dfrac{1}{\ell_{1}^{3}}=\sum_{n=0}^{\infty}p_{3}(n)q^{n}\,(\textup{mod}\,4)$

which implies $P_{\mu}(n)\equiv p_{3}(n)\,(\textup{mod}\,4)$.

##  4 Results on $\sigma(q)$

In this section, we set $\sum_{n=0}^{\infty}P_{\sigma}(n)q^{n}=\sigma(q)$,
where $\sigma(q)$ is as defined in (1.2).

######  Theorem 4.1.

We have

$\sum_{n=0}^{\infty}{P_{\sigma}}(2n+1)q^{n}=\dfrac{\ell_{2}^{2}\ell_{6}^{2}}{\ell_{1}^{2}\ell_{3}}.$
(4.1)

###### Proof.

Ramanujan listed linear relation connecting the sixth order mock theta
functions with each other as [14]:

$\nu(q^{2})-\sigma(-q)=q\dfrac{\ell_{4}^{2}\ell_{12}^{2}}{\ell_{2}^{2}\ell_{6}},$
(4.2)

where $\nu(q)$ is the sixth order mock theta function defined by

$\nu(q)=\sum_{n=0}^{\infty}\dfrac{q^{n+1}(-q;q)_{2n+1}}{(q;q^{2})_{n+1}}.$

Replacing $q$ by $-q$ in (4.2), we obatin

$\sigma(q)=\nu(q^{2})+q\dfrac{\ell_{4}^{2}\ell_{12}^{2}}{\ell_{2}^{2}\ell_{6}}.$
(4.3)

Extracting the terms involving $q^{2n+1}$, dividing by $q$ and replacing
$q^{2}$ by $q$ from (4.3), we arrive at the desired result. ∎

######  Theorem 4.2.

We have

${P_{\sigma}}(2n+1)={P_{\sigma}}_{(d,e)}(n)-{P_{\sigma}}_{(d,o)}(n),$

where ${P_{\sigma}}_{(d,e)}(n)\left(resp.\quad{P_{\sigma}}_{(d,o)}(n)\right)$
denotes the number of partition of $n$ such that

  * $(i)$

parts congruent to $1,5\,(\textup{mod}\,6)$ have two colour,

  * $(ii)$

parts congruent to $3\,(\textup{mod}\,6)$ have three colour,

  * $(iii)$

parts congruent to $0\,(\textup{mod}\,6)$ are distinct and have one colour,

  * $(iv)$

number of parts congruent to $0\,(\textup{mod}\,6)$ being even (resp. odd).

###### Proof.

Proceeding in the same way as Theorem (3.2), we arrive at the desired result.
∎

######  Theorem 4.3.

Let $p\geq 5$ be any prime such that $\left(\dfrac{-2}{p}\right)=-1$. Then for
integer $\alpha\geq 0$, we have

$\sum_{n=0}^{\infty}{P_{\sigma}}\left(2\cdot p^{2\alpha}n+\dfrac{11\cdot
p^{2\alpha}+1}{12}\right)q^{n}\equiv\ell_{2}\psi(q^{3})\,(\textup{mod}\,2).$
(4.4) ${P_{\sigma}}\left(2\cdot p^{2\alpha+2}n+2\cdot
p^{2\alpha+1}j+\dfrac{11\cdot p^{2\alpha+2}+1}{12}\right)\equiv
0\,(\textup{mod}\,2),\quad 1\leq j\leq(p-1).$ (4.5)

###### Proof.

Employing (2.14) and (2.3) in (4.1), we obtain

$\sum_{n=0}^{\infty}{P_{\sigma}}(2n+1)q^{n}\equiv\ell_{2}\psi(q^{3})\,(\textup{mod}\,2).$
(4.6)

which is the $\alpha=0$ case of (4.4). Assume that (4.4) is true for some
$\alpha\geq 0$. Now, substituting (2.8) and (2.9) in (4.4), we obtain

$\sum_{n=0}^{\infty}{P_{\sigma}}\left(2\cdot p^{2\alpha}n+\dfrac{11\cdot
p^{2\alpha}+1}{12}\right)\\\ \equiv
3\Big{[}\sum_{\begin{subarray}{c}t={-(p-1)/2}\\\ t\neq{(\pm
p-1)/6}\end{subarray}}^{(p-1)/2}(-1)^{t}q^{(3t^{2}+t)}f\left(-q^{3p^{2}+(6t+1)p},-q^{3p^{2}-(6t+1)p}\right)+(-1)^{(\pm
p-1)/6}q^{(p^{2}-1)/12}f_{2p^{2}}\Big{]}\\\
\times\Big{[}\sum_{m=0}^{(p-3)/2}q^{3(m^{2}+m)/2}f\left(q^{3{\left(p^{2}+(2m+1)p\right)/2}},q^{3{\left(p^{2}-(2m+1)p\right)}/2}\right)\\\
+q^{3(p^{2}-1)/8}\psi(q^{3p^{2}})\Big{]}\,(\textup{mod}\,2).$ (4.7)

Consider the congruence

$\left({3t^{2}+t}\right)+\left(\dfrac{3k^{2}+3k}{2}\right)\equiv
11\left(\dfrac{p^{2}-1}{24}\right)\,(\textup{mod}\,p),$ (4.8)

which is equivalent to

$(6t+3)^{2}+2(6k+1)^{2}\equiv 0\,(\textup{mod}\,p).$ (4.9)

For $\left(\dfrac{-2}{p}\right)=-1$, the congruence (4.9) has only solution
$t=\dfrac{(p-1)}{2}$ and $k=\dfrac{(\pm p-1)}{6}$. Therefore, extracting the
terms involving $q^{pn+11(p^{2}-1)/24}$, divding by $q^{11(p^{2}-1)/24}$ and
replacing $q^{p}$ by $q$ from (4.7), we obtain

$\sum_{n=0}^{\infty}{P_{\sigma}}\left(2\cdot p^{2\alpha+1}n+\dfrac{11\cdot
p^{2\alpha+2}+1}{12}\right)q^{n}\equiv\ell_{2p}\psi(q^{3p})\,(\textup{mod}\,2).$
(4.10)

Extracting the terms involving $q^{pn}$ and replacing $q^{p}$ by $q$ from
(4.10), we obtain

$\sum_{n=0}^{\infty}{P_{\sigma}}\left(2\cdot p^{2\alpha+2}n+\dfrac{11\cdot
p^{2\alpha+2}+1}{12}\right)q^{n}\equiv\ell_{2}\psi(q^{3})\,(\textup{mod}\,2),$

which is the $\alpha+1$ case of (4.4). Hence, by the method of induction we
complete the proof of (4.4). Now, extracting the terms involving $q^{pn+j}$,
$1\leq j\leq(p-1)$ from (4.10), we arrive at (4.5). ∎

######  Theorem 4.4.

We have

${P_{\sigma}}(2n+1)=p_{2d}(n)+p_{2d}(n-3)+p_{2d}(n-9)+....+p_{2d}\left(n-\frac{3k^{2}+3k}{2}\right)+.....$

###### Proof.

From (4.1), we note that

$\sum_{n=0}^{\infty}{P_{\sigma}}(2n+1)q^{n}={\left(\dfrac{\ell_{2}}{\ell_{1}}\right)}^{2}\psi(q^{3}).$

Employing (1.11) and (2.3), we obtain

$\displaystyle\sum_{n=0}^{\infty}{P_{\sigma}}(2n+1)q^{n}$
$\displaystyle=\left(\sum_{n=0}^{\infty}p_{2d}(n)q^{n}\right)\left(\sum_{k=0}^{\infty}q^{{3k(k+1)}/2}\right)$
$\displaystyle=\sum_{n=0}^{\infty}\left(\sum_{k=0}^{\infty}p_{2d}\left(n-\frac{3k^{2}+3k}{2}\right)\right)q^{n}.$
(4.11)

On comparing the coefficients of $q^{n}$ in (4.11), we arrive at the desired
result. ∎

##  5 Results on $\beta(q)$

Throughout the section, we set
$\sum_{n=0}^{\infty}P_{\beta}(n)q^{n}=\beta(q)$, where $\beta(q)$ is defined
in (1.3). From [29], we also note that

$\sum_{n=0}^{\infty}P_{\beta}(3n+1)q^{n}=\dfrac{\ell_{3}^{3}}{\ell_{1}^{2}}.$
(5.1)

######  Theorem 5.1.

We have

$\sum_{n=0}^{\infty}P_{\beta}(3n+2)q^{n}=2\dfrac{\ell_{6}^{3}}{\ell_{1}\ell_{2}}.$
(5.2)

###### Proof.

Ramanujan listed linear relation connecting the sixth order mock theta
functions with each other as [14]:

$\phi(q^{3})+2q^{-1}\psi(q^{3})+2\beta(q)=\dfrac{\ell_{2}\ell_{3}^{5}}{\ell_{1}^{2}\ell_{6}^{3}},$
(5.3)

where $\phi(q)$ and $\psi(q)$ are the sixth order mock theta functions [14]
given by

$\phi(q)=\sum_{n=0}^{\infty}\dfrac{(-1)^{n}q^{n^{2}}(q;q^{2})_{n}}{(-q;q)_{2n}}\quad\text{and}\quad\psi(q)=\sum_{n=0}^{\infty}\dfrac{(-1)^{n}q^{(n+1)^{2}}(q;q^{2})_{n}}{(-q;q)_{2n+1}}.$

Using (2.11) in (5.3), we obtain

$2\sum_{n=0}^{\infty}P_{\beta}(n)q^{n}=2\beta(q)=-\phi(q^{3})-2q^{-1}\psi(q^{3})+\dfrac{\ell_{6}\ell_{9}^{6}}{\ell_{3}^{3}\ell_{18}^{3}}+2q\dfrac{\ell_{9}^{3}}{\ell_{3}^{2}}+4q^{2}\dfrac{\ell_{18}^{3}}{\ell_{3}\ell_{6}}.$
(5.4)

Extracting the terms involving $q^{3n+2}$, dividing by $q^{2}$ and replacing
$q^{3}$ by $q$ from (5.4), we arrive at the desired result. ∎

######  Theorem 5.2.

We have

${P_{\beta}}(3n+2)={P_{\beta}}_{(d,e)}(n)-{P_{\beta}}_{(d,o)}(n),$

where ${P_{\beta}}_{(d,e)}(n)\left(resp.\quad{P_{\beta}}_{(d,o)}(n)\right)$
denotes the number of partitions of $n$ such that

  * $(i)$

parts congruent to $1,3,5\,(\textup{mod}\,6)$ have one colour,

  * $(ii)$

parts congruent to $2,4\,(\textup{mod}\,6)$ have two colour,

  * $(iii)$

parts congruent to $0\,(\textup{mod}\,6)$ are distinct and have one colour,

  * $(iv)$

number of parts congruent to $0\,(\textup{mod}\,6)$ being even (resp. odd).

###### Proof.

Proceeding in the same way as Theorem (3.2), we arrive at the desired result.
∎

######  Theorem 5.3.

We have

${P_{\beta}}(9n+8)\equiv 0\,(\textup{mod}\,6).$ (5.5)

###### Proof.

Using (2.12) in (5.2), we obtain

$\sum_{n=0}^{\infty}{P_{\beta}}(3n+2)q^{n}=2\dfrac{\ell_{9}^{9}\ell_{6}}{\ell_{3}^{6}\ell_{18}^{3}}+2q\dfrac{\ell_{9}^{6}}{\ell_{3}^{5}}+6q^{2}\dfrac{\ell_{9}^{3}\ell_{18}^{3}}{\ell_{3}^{4}\ell_{6}}-4q^{3}\dfrac{\ell_{18}^{6}}{\ell_{3}^{3}\ell_{6}^{2}}+8q^{4}\dfrac{\ell_{18}^{9}}{\ell_{3}^{2}\ell_{6}^{3}\ell_{9}^{3}}.$
(5.6)

Extracting the terms involving $q^{3n+2}$, dividing by $q^{2}$ and replacing
$q^{3}$ by $q$ from (5.6),

$\sum_{n=0}^{\infty}{P_{\beta}}(9n+8)q^{n}=6\dfrac{\ell_{3}^{3}\ell_{6}^{3}}{\ell_{1}^{4}\ell_{2}}.$
(5.7)

Now, the result follows immediately from (5.7). ∎

######  Theorem 5.4.

We have

$\displaystyle\sum_{k=0}^{\infty}{P_{\beta}}\left(3n-\frac{3k(k+1)}{2}+2\right)=2\bar{p}(n)-6\bar{p}(n-6)+10\bar{p}(n-18)-.....$
$\displaystyle\hskip
227.62204pt+2(-1)^{m}(2m+1)\bar{p}\Big{(}n-3m(m+1)\Big{)}+....$

###### Proof.

From (5.2), we note that

$\left(\sum_{n=0}^{\infty}{P_{\beta}}(3n+2)q^{n}\right)\dfrac{\ell_{2}^{2}}{\ell_{1}}=2\left(\dfrac{\ell_{2}}{\ell_{1}^{2}}\textasciibreve\right)\ell_{6}^{3}.$

Employing (1.10), (2.3) and (2.7), we obtain

$\left(\sum_{n=0}^{\infty}{P_{\beta}}(3n+2)q^{n}\right)\left(\sum_{k=0}^{\infty}q^{k(k+1)/2}\right)=2\left(\sum_{n=0}^{\infty}\bar{p}(n)\right)\left(\sum_{m=0}^{\infty}(-1)^{m}(2m+1)q^{3m(m+1)}\right),$

which implies

$\sum_{n=0}^{\infty}\sum_{k=0}^{\infty}{P_{\beta}}\left(3n-\frac{3k(k+1)}{2}+2\right)q^{n}=2\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}(-1)^{m}(2m+1)\bar{p}\Big{(}n-3m(m+1)\Big{)}q^{n}.$
(5.8)

On comparing the coefficients of $q^{n}$ in (5.8), we arrive at the desired
result. ∎

######  Theorem 5.5.

We have

$\displaystyle{P_{\beta}}(9n+8)-3{P_{\beta}}(9n-10)+...+(-1)^{m}(2m+1){P_{\beta}}\Big{(}9(n-m^{2}-m)+8\Big{)}+...$
$\displaystyle\hskip
142.26378pt=6\sum_{k=0}^{\infty}\sum_{l=0}^{\infty}(-1)^{l+k}(2k+1)(2l+1)\bar{p}\Big{(}n-\frac{3k^{2}+3k}{2}-3l^{2}-3l\Big{)}.$

###### Proof.

From (5.7), we note that

$\left(\sum_{n=0}^{\infty}{P_{\beta}}(9n+8)q^{n}\right)\ell_{2}^{3}=6{\left(\dfrac{\ell_{2}}{\ell_{1}^{2}}\right)}^{2}\ell_{3}^{3}\ell_{6}^{3}.$

Employing (1.10) and (2.7), we obatin

$\displaystyle\left(\sum_{n=0}^{\infty}{P_{\beta}}(9n+8)q^{n}\right)\left(\sum_{m=0}^{\infty}(-1)^{m}(2m+1)q^{m(m+1)}\right)$
$\displaystyle\hskip
56.9055pt=6\left(\sum_{n=0}^{\infty}\bar{p}_{2}(n)q^{n}\right)\left(\sum_{k=0}^{\infty}(-1)^{k}(2k+1)q^{(3k^{2}+3k)/2}\right)\left(\sum_{l=0}^{\infty}(-1)^{l}(2l+1)q^{(3l^{2}+3l)}\right),$

which implies

$\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}(-1)^{m}(2m+1)P_{\beta}\Big{(}9(n-m^{2}-m)+8\Big{)}q^{n}$
$\hskip
85.35826pt=6\sum_{n=0}^{\infty}\sum_{k=0}^{\infty}\sum_{l=0}^{\infty}(-1)^{l+k}(2k+1)(2l+1)\bar{p}\Big{(}n-\frac{3k^{2}+3k}{2}-3l^{2}-3l\Big{)}.$
(5.9)

On comparing the coefficients of $q^{n}$ in (5.9), we arrive at the desired
result. ∎

######  Theorem 5.6.

We have

$\displaystyle{P_{\beta}}(3n+1)+\sum_{m=1}^{\infty}(-1)^{m}{P_{\beta}}\Big{(}3n-3m(3m+1)+1\Big{)}+\sum_{m=1}^{\infty}(-1)^{m}{P_{\beta}}\Big{(}3n-3m(3m-1)+1\Big{)}$
$\displaystyle\hskip
56.9055pt=\bar{p}(n)-3\bar{p}(n-3)+5\bar{p}(n-9)-....+(-1)^{k}(2k+1)\bar{p}\Big{(}n-\frac{3k(k+1)}{2}\Big{)}+....$

###### Proof.

from (5.1), we note that

$\left(\sum_{n=0}^{\infty}{P_{\beta}}(3n+1)q^{n}\right)\ell_{2}=\left(\dfrac{\ell_{2}}{\ell_{1}^{2}}\right)\ell_{3}^{3}.$

Employing (1.10), (2.4) and (2.7), we obatin

$\displaystyle\left(\sum_{n=0}^{\infty}{P_{\beta}}(3n+1)q^{n}\right)\left(1+\sum_{m=1}^{\infty}(-1)^{m}q^{m(3m+1)}+\sum_{m=1}^{\infty}(-1)^{m}q^{m(3m-1)}\right)$
$\displaystyle\hskip
108.12054pt=\left(\sum_{n=0}^{\infty}\bar{p}(n)q^{n}\right)\left(\sum_{k=0}^{\infty}(-1)^{k}(2k+1)q^{{3k(k+1)}/2}\right),$

which implies

$\sum_{n=0}^{\infty}{P_{\beta}}(3n+1)q^{n}+\sum_{n=0}^{\infty}\sum_{m=1}^{\infty}(-1)^{m}\left({P_{\beta}}\Big{(}3n-3m(3m+1)+1\Big{)}+{P_{\beta}}\Big{(}3n-3m(3m-1)+1\Big{)}\right)q^{n}$
$\hskip
184.9429pt=\sum_{n=0}^{\infty}\sum_{k=0}^{\infty}(-1)^{k}(2k+1)\bar{p}\left(n-\frac{3k(k+1)}{2}\right)q^{n}.$
(5.10)

On comparing the coefficients of $q^{n}$ in (5.10), we arrive at the desired
result. ∎

##  6 Results on $\lambda(q)$

Following three identities from [18] will be useful in this section:

$\displaystyle\sum_{n=0}^{\infty}{P_{\lambda}}(2n)q^{n}=\dfrac{\ell_{2}^{3}\ell_{3}^{2}}{\ell_{1}^{3}\ell_{6}},$
(6.1)
$\displaystyle\sum_{n=0}^{\infty}{P_{\lambda}}(6n+2)q^{n}=3\dfrac{\ell_{3}^{5}}{\ell_{6}}{\left(\dfrac{\ell_{2}}{\ell_{1}^{2}}\right)}^{3},$
(6.2)
$\displaystyle\sum_{n=0}^{\infty}{P_{\lambda}}(6n+4)q^{n}=\dfrac{\ell_{2}^{2}\ell_{3}^{2}\ell_{6}^{2}}{\ell_{1}^{5}},$
(6.3)

where

$\sum_{n=0}^{\infty}P_{\lambda}(n)q^{n}=\lambda(q)$

and $\lambda(q)$ is defined as in (1.4).

######  Theorem 6.1.

We have

${P_{\lambda}}(2n)={P_{\lambda}}_{(d,e)}(n)-{P_{\lambda}}_{(d,o)}(n),$

where
${P_{\lambda}}_{(d,e)}(n)\left(resp.\quad{P_{\lambda}}_{(d,o)}(n)\right)$
denotes the number of partitions of $n$ such that

  * $(i)$

parts congruent to $1,5\,(\textup{mod}\,6)$ have three colour,

  * $(ii)$

parts congruent to $3\,(\textup{mod}\,6)$ have one colour,

  * $(iii)$

parts congruent to $0\,(\textup{mod}\,6)$ are distinct and have one colours,

  * $(iv)$

number of parts congruent to $0\,(\textup{mod}\,6)$ being even (resp. odd).

###### Proof.

Proceeding in the same way as Theorem 3.2, we arrive at the desired result. ∎

######  Theorem 6.2.

We have

${P_{\lambda}}(2n)=p_{3d}(n)-2p_{3d}(n-3)+2p_{3d}(n-12)-.....+2(-1)^{k}p_{3d}(n-3k^{2})+.....$

###### Proof.

From (6.1), we note that

$\sum_{n=0}^{\infty}{P_{\lambda}}(2n)q^{n}={\left(\dfrac{\ell_{2}}{\ell_{1}}\right)}^{3}\phi(-q^{3}).$

Employing (1.11) and (2.2), we obtain

$\displaystyle\sum_{n=0}^{\infty}{P_{\lambda}}(2n)q^{n}$
$\displaystyle=\left(\sum_{n=0}^{\infty}p_{3d}(n)q^{n}\right)\left(\sum_{k=-\infty}^{\infty}(-1)^{k}q^{3k^{2}}\right)$
$\displaystyle=\left(\sum_{n=0}^{\infty}p_{3d}(n)q^{n}\right)\left(1+2\sum_{k=1}^{\infty}(-1)^{k}q^{3k^{2}}\right)$
$\displaystyle=\sum_{n=0}^{\infty}p_{3d}(n)q^{n}+2\sum_{n=0}^{\infty}\sum_{k=1}^{\infty}(-1)^{k}p_{3d}(n-3k^{2})q^{n}.$
(6.4)

On comparing the coefficients of $q^{n}$ in (6.4), we arrive at the desired
result. ∎

######  Theorem 6.3.

We have

$\displaystyle{P_{\lambda}}(6n+2)=3\bar{p}_{3}(n)-9\bar{p}_{3}(n-3)+...+3(-1)^{l}(2l+1)\bar{p}_{3}\left(n-\dfrac{3l(l+1)}{2}\right)+....$
$\displaystyle\hskip
128.0374pt..+6\sum_{l=0}^{\infty}\sum_{k=1}^{\infty}(-1)^{l+k}(2l+1)\bar{p}_{3}\left(n-3k^{2}-\dfrac{3l(l+1)}{2}\right).$

###### Proof.

From (6.2), we note that

$\sum_{n=0}^{\infty}{P_{\lambda}}(6n+2)q^{n}=3{\left(\dfrac{\ell_{2}}{\ell_{1}^{2}}\right)}^{3}\phi(-q^{3})\ell_{3}^{3}.$

Employing (1.10), (2.2) and (2.7), we obtain

$\displaystyle\sum_{n=0}^{\infty}{P_{\lambda}}(6n+2)q^{n}$
$\displaystyle=3{\left(\dfrac{\ell_{2}}{\ell_{1}^{2}}\right)}^{3}\left(1+2\sum_{k=1}^{\infty}(-1)^{k}q^{3k^{2}}\right)\left(\sum_{l=0}^{\infty}(-1)^{l}(2l+1)q^{{3l(l+1)}/2}\right)$
$\displaystyle=3\left(\sum_{n=0}^{\infty}\bar{p}_{3}(n)q^{n}\right)\left(\sum_{l=0}^{\infty}(-1)^{l}(2l+1)q^{{3l(l+1)}/2}\right)$
$\displaystyle\hskip
28.45274pt+6\left(\sum_{n=0}^{\infty}\bar{p}_{3}(n)q^{n}\right)\left(\sum_{l=0}^{\infty}\sum_{k=1}^{\infty}(-1)^{l+k}(2l+1)q^{3k^{2}+{3l(l+1)}/2}\right)$
$\displaystyle=3\sum_{n=0}^{\infty}\sum_{l=0}^{\infty}(-1)^{l}(2l+1)\bar{p}_{3}\left(n-\dfrac{3l(l+1)}{2}\right)q^{n}$
$\hskip
139.41832pt+6\sum_{n=0}^{\infty}\sum_{l=0}^{\infty}\sum_{k=1}^{\infty}(-1)^{l+k}(2l+1)\bar{p}_{3}\left(n-3k^{2}-\dfrac{3l(l+1)}{2}\right)q^{n}.$
(6.5)

On comparing the coefficients of $q^{n}$ in (6.5), we arrive at the desired
result. ∎

######  Theorem 6.4.

We have

$\displaystyle{P_{\lambda}}(6n+4)-3{P_{\lambda}}(6n-2)+...+(-1)^{m}(2m+1){P_{\lambda}}\Big{(}6n-3m(m+1)+4\Big{)}+...$
$\displaystyle=6\sum_{l=0}^{\infty}(-1)^{l}(2l+1)p_{2d}\Big{(}n-3l(l+1)\Big{)}+12\sum_{l=0}^{\infty}\sum_{k=1}^{\infty}(-1)^{l+k}(2l+1)p_{2d}\Big{(}n-3k^{2}-3l(l+1)\Big{)}.$

###### Proof.

From (6.3), we note that

$\left(\sum_{n=0}^{\infty}{P_{\lambda}}(6n+4)q^{n}\right)\ell_{1}^{3}=6{\left(\dfrac{\ell_{2}}{\ell_{1}}\right)}^{2}\phi(-q^{3})\ell_{6}^{3}.$
(6.6)

Employing (2.2) and (2.7) in (6.6), we obtain

$\left(\sum_{n=0}^{\infty}{P_{\lambda}}(6n+4)q^{n}\right)\ell_{1}^{3}=6{\left(\dfrac{\ell_{2}}{\ell_{1}}\right)}^{2}\left(1+2\sum_{k=1}^{\infty}(-1)^{k}q^{3k^{2}}\right)\left(\sum_{l=0}^{\infty}(-1)^{l}(2l+1)q^{3l(l+1)}\right).$
(6.7)

Again, emlpoying (1.11) and (2.7) in (6.7), we obtain

$\displaystyle\left(\sum_{n=0}^{\infty}{P_{\lambda}}(6n+4)q^{n}\right)\left(\sum_{m=0}^{\infty}(-1)^{m}(2m+1)q^{{m(m+1)}/2}\right)$
$\displaystyle\hskip
28.45274pt=6\left(\sum_{n=0}^{\infty}p_{2d}(n)q^{n}\right)\left(\sum_{l=0}^{\infty}(-1)^{l}(2l+1)q^{3l(l+1)}+2\sum_{l=0}^{\infty}\sum_{k=1}^{\infty}(-1)^{l+k}(2l+1)q^{3k^{2}+3l(l+1)}\right).$

which implies

$\displaystyle\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}(-1)^{m}(2m+1){P_{\lambda}}\Big{(}6n-3m(m+1)+4\Big{)}q^{n}$
$\displaystyle\hskip
42.67912pt=6\sum_{n=0}^{\infty}\sum_{l=0}^{\infty}(-1)^{l}(2l+1)p_{2d}\Big{(}n-3l(l+1)\Big{)}q^{n}$
$\displaystyle\hskip
56.9055pt+12\sum_{n=0}^{\infty}\sum_{l=0}^{\infty}\sum_{k=1}^{\infty}(-1)^{l+k}(2l+1)p_{2d}\left(n-3k^{2}-3l(l+1)\right)q^{n}.$
(6.8)

On comparing the coefficients of $q^{n}$ in (6), we arrive at the desired
result. ∎

## Acknowledgements

The first author acknowledges the financial support received from University
Grants Commission through National Fellowship for Scheduled Caste Students
under grant Ref. no.: 211610029643.

## Declarations

Conflict of Interest. The authors declare that there is no conflict of
interest regarding the publication of this article.

Human and animal rights. The authors declare that there is no research
involving human participants or animals in the contained of this paper.

Data availability statements. Data sharing not applicable to this article as
no datasets were generated or analysed during the current study.

## References

  * [1] Agarwal, A. K., Sood, G.: Split $(n+t)$-color partitions and Gordon-McIntosh eight order mock theta functions. Electron. J. Comb. 21(2) (2014).
  * [2] Ahmed, Z., Baruah, N. D.: New congruences for $\ell$-regular partitions for $\ell\in\\{5,6,7,49\\}$. Ramanujan J. 40, 649-668 (2016).
  * [3] Andrews, G. E.: The theory of partitions. Addison-Wesley (1976).
  * [4] Andrews, G. E.: Mordell integrals and Ramanujan’s lost notebook, Analytic number theory (Philadelphia, Pa., 1980). pp.10-18. Lecture Notes in Math., 899, Springer, Berlin-New York (1981).
  * [5] Andrews, G. E., Berndt, B. C.: Ramanujan’s lost notebook part I. Springer. Berlin Heidelberg New York (2005).
  * [6] Andrews, G. E., Hickerson, D.: Ramanujan’s lost notebook VII : The sixth order mock theta functions. Adv. Math. 89, 60-105 (1991).
  * [7] Berndt, B. C.: Ramanujan’s Notebook. Part III. Springer-Verlag. New York (1991).
  * [8] Berndt, B. C., Rankin, R. A.: Ramanujan: letters and commentary. American Mathematical Society. Providence. RI. London Mathematical Society. London (1995).
  * [9] Chan, H. C.: Ramanujan’s cubic continued fraction and an analog of his most beautiful identity. Int. J. Number Theory. 6, 673-680 (2010).
  * [10] Cui, S. P., Gu, N. S. S.: Arithmetic properties of $l$-regular paritions. Adv. Appl. Math. 51, 507-523 (2013).
  * [11] Euler, L.: Introductio in Analysin Infinitorum. Marcum-Michaelem Bousquet. Lausannae (1748).
  * [12] Ewell, J. A.: Partition recurrences. J. Comb. Theory A. 14, 125-127 (1973).
  * [13] Gordon, B., McIntosh, R.J.: Some eight order mock theta functions. J. London Math. Soc. 62, 321–335 (2000).
  * [14] Gordon, B., McIntosh, R.J.: A survey of classical mock theta functions, in Partitions, $q$-Series and Modular Forms, in: Developments in Mathematics (eds. K. Alladi, F. Garvan). Springer. New York, 95-144 (2012).
  * [15] Hikami K.: Transformation formula of the 2ND order mock theta function. arXiv:math-ph/0604007 4 (2006).
  * [16] Hirschhorn, M. D.: The Power of $q$. In Developments in Mathematics. Springer. Berlin. Germany. 49 (2017).
  * [17] Hirschhorn, M. D., Sellers, J. A.: Arithmetic relations for overpartitions. J. Combin. Math. Combin. Comput. 53, 65-73 (2005).
  * [18] Kaur, H., Rana, M.: Congruences for sixth order mock theta functions $\lambda(q)$ and $\rho(q)$. Electron. Res. Arch. 29(6), 4257-4268. DOI: 10.3934/era.2021084 (2021).
  * [19] Kaur, H., Rana, M.: On some mock theta functions of order $2$ and $3$. J. Ramanujan Math. Soc. 37, 221-229 (2022).
  * [20] McIntosh, R.J.: Second order mock theta functions. Can. Math. Bull. 50, 284-290. DOI: 10.4153/CMB-2007-028-9 (2007).
  * [21] Nyirenda, D.: On parity and recurrences for certain partition functions. Contrib. Discret. Math. 15, 72-79 (2020).
  * [22] Ono, K., Robbins, N., Wilson, B.: Some recurrences for arithmetic functions. J. Indian Math. Soc. 62, 29-50 (1996).
  * [23] Ramanujan, S.: Congruence properties of partitions. Math. Z. 9, 147-153 (1921).
  * [24] Ramanujan, S.: Collected papers. Cambridge University press, 1972, reprinted by Chelsea. New York (1962).
  * [25] Ramanujan, S.: The lost notebook and other unpublished papers. Springer-Verlag. Berlin (1988).
  * [26] Rana, M., Sareen, J. K.: On combinatorial extensions of some mock theta functions using signed partitions. Adv. Appl. Math. 10, 15-25 (2015).
  * [27] Rana, M., Kaur, H., Garg, K.: Recurrence relation connecting mock theta functions and restricted partition functions. Notes Number Theory Discret. Math. 29, 360-371 (2023).
  * [28] Silva, R. da, Sakai, P.D.: New partition function recurrences. J. Integer Seq. 23, 1-16 (2020).
  * [29] Zhang, W., Shi, J.: Congruences for the coefficients of the mock theta function $\beta(q)$. Ramanujan J. 49, 257-267 (2019).


#  A binary quadratic form approach to the equation $X^{2}+(2k-1)^{Y}=k^{Z}$

Maohua Le  Institute of Mathematics, Lingnan Normal College, Zhangjiang,
Guangdong, 524048, China<EMAIL_ADDRESS>and  Anitha Srinivasan
Departamento de métodos cuantitativos, Universidad Pontificia de Comillas
(ICADE), C/ Alberto Aguilera, 23 - 28015 Madrid
<EMAIL_ADDRESS>
###### Abstract.

A conjecture of N. Terai states that for any integer $k>1$, the equation
$x^{2}+(2k-1)^{y}=k^{z}$ has only one solution, namely, $(x,y,z)=(k-1,1,2).$
Using the theory of representations of integers by binary quadratic forms, we
present methods to verify this conjecture in the case when $k\equiv
0\pmod{4}$, with $2k-1$ a prime power, and in the case when $k$ is any odd
integer. We present several values of $k$ for which our method shows that the
conjecture is true, while existing methods do not apply. However for $k\equiv
0\pmod{4}$ our method does not always work.

AMS Subject Classification: 11D09, 11R29, 11E16. Keywords: binary quadratic
forms, exponential diophantine equation, generalized Ramanujan-Nagell
equation.

##  1\.  Introduction

N. Terai in [7] stated the following conjecture for a particular case of the
generalized Ramanujan Nagell equation.

######  Conjecture 1.1.

For any integer $k>1$, the diophantine equation

(1.1) $X^{2}+(2k-1)^{Y}=k^{Z},X,Y,Z\in\mathbb{N}$

has only the solution $(X,Y,Z)=(k-1,1,2).$

The above conjecture has been proved only in some special cases. In [2], M.-J.
Deng, J. Guo and A.-J. Xu verified Conjecture 1.1 when $k\equiv 3\pmod{4}$
with $3\leq k\leq 499.$ Our method can verify the conjecture for any odd $k$,
computational power being the only limitation. We also note here that to the
best of our knowledge, there are no results that deal with the case when
$k\equiv 1\pmod{4}$.

N. Terai [7] dealt with $k\leq 30$ using methods that did not apply to
$k=12,24$. Subsequently M. A. Bennett and N. Billerey [1] used the modular
approach to solve these two cases. Our method proves the case $k=12$ in a very
straightforward manner. Interestingly, it does not work for $k=24$.

Recently Mutlu, Le and Soydan [5] showed under the assumption of the GRH that
if $k\equiv 0\pmod{4}$ and $30<k<724$ with $2k-1$ a prime power, then
Conjecture 1.1 is true. For several of these values our method applies easily.
Moreover our method can be used for any (larger) value of $k$ (such as
$k=1336$ given in section 3) satisfying these same conditions. The method for
these values of $k$ is based on the following theorem.

######  Theorem 1.2.

Let $k\equiv 0\pmod{4}$ and $2k-1$ be a prime power. Let $k-1=ab^{2}$ where
$a$ is square-free. If there exists a divisor $d$ of $ab$ such that $z$ is
even for all solutions $(x,y,z)$ of

(1.2) $d^{2}x^{2}+(2k-1)y^{2}=k^{z},x,y,z\in\mathbb{Z},\gcd(x,y)=1,z>0,$

then Conjecture 1.1 is true.

######  Remark 1.3.

Observe that there are infinitely many solutions $(x,y,z)$ to (1.2). This is
because $((k-1)/d,1,2)$ is a solution and we will see in Section 2 that all
solutions can be divided into classes. Moreover it is easy to check whether
all $z$ are even as the least value $z_{1}$ of $z$ in each class is bounded.
Furthermore, all other solutions $(x,y,z)$ satisfy $z=z_{1}+z_{1}^{\prime}t$,
where $z_{1}^{\prime}$ is a fixed integer(for a given class) that divides the
class number, and hence can be calculated.

The method for odd $k$ ($\lambda=1$) uses Lemma 2.4(4). If a solution to the
equation $X^{2}+(2k-1)^{Y}=k^{Z}$ exists, then in the case when $Y$ is odd we
have a solution to $x^{\prime 2}+(2k-1)y^{\prime 2}=k^{z^{\prime}}$ and in the
case when $Y$ is even, we have a solution to $x^{\prime 2}+(2k-1)^{2}y^{\prime
2}=k^{z^{\prime}}$. In both cases if the solution is the least solution in a
class, then by Lemma 2.4, parts (3) and (4) and Lemma 2.2(4), $z^{\prime}$
divides the class number and we may verify for each divisor of the class
number, whether for a solution $(x^{\prime},y^{\prime})$ (if it exists)
$y^{\prime}$ is a power of $(2k-1)$. When the solution is not the least
solution, by (2.7) we have a least solution,
$(x_{1}^{\prime},y_{1}^{\prime},z_{1}^{\prime})$ such that
$y_{1}^{\prime}|(2k-1)^{Y}$ and we may check whether this condition holds for
each least solution. Hence we have the following result.

######  Theorem 1.4.

For a fixed odd positive integer $k$ Conjecture 1.1 can be verified in a
finite number of steps.

The outline of the paper is as follows. In the next section we quote results
from [3] and [4] that relate the solutions of two related equations that our
theorems are based on. In Section 3 we prove our main theorems, and in the
last section we present examples to illustrate the applications of these
theorems, proving Conjecture 1.1 for several values of $k$, some that have
resisted existing algorithms.

##  2\. The solutions of two related equations

Let $D,D_{1},D_{2}$ be fixed odd positive integers with $D=D_{1}D_{2}>3$ and
$\gcd(D_{1},D_{2})=1$. Let $k$ be a fixed positive integer with $\gcd(D,k)=1$.
Let $w(k)$ be the number of distinct prime divisors of $k$ and let

$\lambda=\begin{cases}2&{\text{ if }}k{\text{ is even }}\\\ 1&{\text{ if
}}k{\text{ is odd. }}\end{cases}$

In this section we state results that are either given, or follow immediately
from the results and proof methods in [3] and [4]. These results classify and
connect the solutions of the equations

(2.1) $x^{\prime 2}+Dy^{\prime
2}=\lambda^{2}k^{z^{\prime}},x^{\prime},y^{\prime},z^{\prime}\in\mathbb{Z},\gcd(x^{\prime},y^{\prime})=1,z^{\prime}>0$

and

(2.2) $D_{1}x^{2}+D_{2}y^{2}=k^{z},x,y,z\in\mathbb{Z},\gcd(x,y)=1,z>0.$

######  Lemma 2.1.

If the congruence

(2.3)
$L^{2}\equiv-D\pmod{\lambda^{2}k},0<L<\frac{\lambda^{2}k}{2},\gcd\left(\lambda^{2}k,2L,\frac{L^{2}+D}{\lambda^{2}k}\right)=1$

has solutions $L$, then it has exactly $r=2^{w(k)-1}$ solutions.

We denote the $r$ solutions above as $L_{i},i=1\cdots L_{r}$.

######  Lemma 2.2.

A necessary and sufficient condition for (2.1) to have solutions is that (2.3)
has solutions. Moreover the solutions of (2.1) satisfy the following.

  1. (1)

For any fixed solution $(x^{\prime},y^{\prime},z^{\prime})$ of (2.1) there
exists a unique solution $L_{j}$ ($1\leq j\leq r$) of (2.3) such that

(2.4) ${}\frac{x^{\prime}}{y^{\prime}}\equiv\lambda^{\prime}L_{j}\pmod{\lambda
k},\lambda^{\prime}\in\\{1,-1\\}.$

  2. (2)

All solutions of (2.1) can be divided into $r$ disjoint equivalence classes
$C_{j}^{\prime}$, $1\leq j\leq r$, where each class $C_{j}^{\prime}$ is non-
empty and consists of solutions $(x^{\prime},y^{\prime},z^{\prime})$ of (2.1)
that satisfy (2.4).

  3. (3)

For each $C_{j}^{\prime}$ ($1\leq j\leq r$), there is a unique least positive
solution $(x_{j}^{\prime},y_{j}^{\prime},z_{j}^{\prime})$ such that
$z_{k}^{\prime}\leq z^{\prime}$, where $z^{\prime}$ runs through all solutions
$(x^{\prime},y^{\prime},z^{\prime})$ in $C_{j}^{\prime}$. Moreover every
solution $(x^{\prime},y^{\prime},z^{\prime})$ of $C_{j}^{\prime}$ satisfies
$z^{\prime}=z_{j}^{\prime}t,t\in\mathbb{N}$ and

(2.5)
$\frac{x^{\prime}+y^{\prime}\sqrt{-D}}{\lambda}=\pm\left(\frac{x_{j}^{\prime}\pm
y_{j}^{\prime}\sqrt{-D}}{\lambda}\right)^{t}$

for some positive integer $t$.

  4. (4)

The least solution $(x_{j}^{\prime},y_{j}^{\prime},z_{j}^{\prime})$ of each
class satisfies $z_{j}^{\prime}|h(-4D)$, where $h(-4D)$ is the class number of
binary quadratic primitive forms of discriminant $-4D$.

######  Remark 2.3.

Using Lemma 2.1 we may find all $r$ primitive binary quadratic forms, $F_{j}$,
of discriminant $-4D$ that represent $\lambda^{2}k$ [6, Solution of Problem 2,
page 120]. The order of $F_{j}$ is precisely $z_{j}^{\prime}$ and it then
follows that there is a primitive representation $(\alpha,\beta)$ such that
$\alpha^{2}+D\beta^{2}=\lambda^{2}k^{z_{j}^{\prime}}$.

######  Lemma 2.4.

A necessary and sufficient condition for (2.2) to have solutions is that (2.1)
has solutions. Moreover the solutions of (2.2) satisfy the following.

  1. (1)

For any fixed solution $(x,y,z)$ of (2.2) there exists a unique solution
$L_{j}$ ($1\leq j\leq r$) of (2.3) such that

(2.6) ${}\frac{D_{1}x}{y}\equiv\lambda^{\prime}L_{j}\pmod{\lambda
k},\lambda^{\prime}\in\\{1,-1\\}.$

  2. (2)

All solutions $(x,y,z)$ of (2.2) can be divided into $r$ equivalence classes,
$C_{j}$, where each class $C_{j}$ consists of solutions $(x,y,z)$ of (2.2)
that satisfy (2.6).

  3. (3)

Some classes of (2.2) may be empty. In every fixed non-empty class
$C_{j}$($1\leq j\leq r$), there is a unique least positive solution
$(x_{1j},y_{1j},z_{1j})$ such that $z_{1j}\leq z$, where $z$ runs through all
solutions $(x,y,z)$ of $C_{j}$. Moreover every solution $(x,y,z)$ of $C_{j}$
satisfies

$z=z_{j}+z_{j}^{\prime}t,$

for some integer $\geq 0$, where
$(x_{j}^{\prime},y_{j}^{\prime},z_{j}^{\prime})$ is the least solution of the
class $C_{j}^{\prime}$ of (2.1).

  4. (4)

If $k$ is odd and $C_{j}$ is non-empty, then $z_{j}^{\prime}=2z_{j}$ and every
solution $(x,y,z)$ of $C_{j}$ satisfies

(2.7) $x\sqrt{D_{1}}+y\sqrt{-D_{2}}=\pm(x_{j}\sqrt{D_{1}}\pm
y_{j}\sqrt{-D_{2}})^{2t+1}$

for some positive integer $t$.

######  Remark 2.5.

Lemmas 2.3 and 2.4 show that each class of solutions of (2.2) corresponds to a
class of solutions of (2.1). The correspondence is achieved via the integers
$L_{j}$. These integers are distinct for different classes $C_{j}^{\prime}$
and the same for $C_{j}$ and $C_{j}^{\prime}$.

##  3\. Proofs of main theorems

######  Lemma 3.1.

Let $X,Y,Z$ be positive integers such that $X^{2}+(2k-1)^{Y}=k^{Z}$. If
$k-1=ab^{2}$ with $a$ square-free, then $X\equiv 0\pmod{ab}$.

###### Proof.

The lemma follows on looking at the given equation modulo $k-1$ which gives
$X^{2}\equiv 0\pmod{ab^{2}}$. ∎

######  Lemma 3.2.

If $X,Y,Z$ is a solution of $X^{2}+(2k-1)^{Y}=k^{Z}$ with $k\equiv 0\pmod{4}$
and $2k-1$ a prime power, then $Y$ and $Z$ are odd.

###### Proof.

If $k\equiv 0\pmod{4}$ it is easy to see (considering the equation mod $4$)
that $Y$ is odd. In the case when $2k-1$ is a prime power it is shown in [2,
Lemma 2.6] that $Z$ is odd. ∎

The following lemma is key to our results and follows directly from part 3 of
Lemma 2.4.

######  Lemma 3.3.

Let $k\equiv 0\pmod{4}$ be a fixed positive integer. Then if the least
solution $(x_{j},y_{j},z_{j})$ in each (non-empty) class of (2.2) and the
least solution $(x_{j}^{\prime},y_{j}^{\prime},z_{j}^{\prime})$ of the
corresponding class of (2.1) both satisfy $z_{j}$ and $z_{j}^{\prime}$ are
even, then $z$ is even for all solutions $(x,y,z)$ of (2.2).

###  3.1. Proof of Theorem 1.2

Let $(X,Y,Z)$ be a solution of (1.1), where $k\equiv 0\pmod{4}$ and $2k-1$ is
a prime power. Assume that $d$ is a divisor of $ab$, that satisfies the
hypothesis in the theorem. Then from Lemma 3.1 we have $d|X$ and hence
$(X/d,(2k-1)^{(Y-1)/2},Z)$ is a solution of (1.2). From Lemma 3.2 we have that
$Z$ is odd, which contradicts the assumption of the theorem and hence
Conjecture 1.1 is true. ∎

###  3.2. Proof of Theorem 1.4

Suppose that $X^{2}+(2k-1)^{Y}=k^{Z}$ has a solution. If $Y$ is odd this gives
a solution to $x^{2}+(2k-1)y^{2}=k^{z}$, namely $x=X$ and $y=(2k-1)^{(Y-1)/2}$
and $z=Z$. Similarly if $Y$ is even, we have a solution to
$x^{2}+(2k-1)^{2}y^{2}=k^{z}$. Let $D=-4(2k-1)$ if $Y$ is odd and
$D=-4(2k-1)^{2}$ if $Y$ is even. Now, if the solution $(x,y,z)$ is the least
solution, $(x_{1}^{\prime},y_{1}^{\prime},z_{1}^{\prime})$ in a class, then by
Lemma 2.2 part 4, $z_{1}^{\prime}|h(D)$. Note that we can find all these least
solutions and therefore it may be verified if any $y_{1}^{\prime}$ is a power
of $2k-1$. If the solution is not the least solution then by (2.7) we have

$x+y\sqrt{-D}=\pm\left(x_{1}^{\prime}\pm y_{1}^{\prime}\sqrt{-D}\right)^{l}$

for some integer $l$ and least solution
$(x_{1}^{\prime},y_{1}^{\prime},z_{1}^{\prime})$. In this case we note that
each prime divisor of $y_{1}^{\prime}$ must divide $2k-1$. It is
straightforward to verify whether this is the case for each least solution
$(x_{1}^{\prime},y_{1}^{\prime},z_{1}^{\prime})$. ∎

Next we present an algorithm for the implementation of Theorem 1.4. Recall
that in this case we have $\lambda=1$.

###  3.3. An algorithm for odd $k$

Step 1. Evaluate the class numbers $h=h(-4(2k-1))$ and
$h^{\prime}=h(-4(2k-1)^{2})$.

Step 2. Determine all divisors of $h$ and $h^{\prime}$.

Step 3. Find all solutions $(x,y,d)$ of (2.1) (with $D=2k-1$) where $d$
divides $h$ and $y>1$.

Step 4. Find all solutions $(x^{\prime},y^{\prime},d^{\prime})$ of (2.1) (with
$D=(2k-1)^{2}$) where $d^{\prime}$ divides $h^{\prime}$.

Step 5. If each $y$ and $y^{\prime}$ has a prime divisor that does not divide
$2k-1$, Conjecure 1.1 is true.

##  4\. Examples

Example 1: $k=12$. We will show that $d=k-1$ satisfies the assumption of
Theorem 1.4 and hence Conjecture 1.1 is true for $k=12$.

We have $2k-1=23$ and $k-1=11$. As $w(k)=2$, equation (2.3) has two solutions,
namely $L_{1}=7$ and $L_{2}=23$. Let $D=(2k-1)(k-1)^{2}$. The binary quadratic
forms of discriminant $-4D$ representing $4k$ (see Remark 2.3) are
$f_{1}=(48,14,59)$ and $f_{2}=(48,46,69)$ with orders $z_{1}^{\prime}=6$ and
$z_{2}^{\prime}=18$. The least solutions of (2.1) are $(432,65,6)$ and
$(9706934521,66396265,18)$ corresponding to $L_{1}=7$ and $L_{2}=23$
respectively (from (2.4)). By Lemma 2.4 part (3), a least solution $(x,y,z)$
of (2.2) satisfies $z\leq 18$. Checking for all these values of $z$ we get
solutions $(1,1,2)$ and $(8870441293,4089910213,20)$ for equation (2.2). From
(2.6) (with $D_{1}=(k-1)^{2}$) we see that both these solutions correspond to
$L_{2}=23$ and hence are in the same class. It follows that the only least
solution of (2.2) is $(1,1,2)$ corresponding to the class of
$(9706934521,66396265,18)$ of (2.1). Hence by Lemma 3.3 all solutions of
(1.2), for $d=k-1$ satisfy $z$ even and thus the hypothesis of Theorem 1.4
holds for $d=k-1$ and hence Conjecture 1.1 is true.

Example 2: $k=24$. As mentioned earlier, our method fails to work in this
case. This is because there is no divisor $d$ satisfying the hypothesis of
Theorem 1.2.

We have $k-1=23$. It is easy to see that $(7,1,1)$ is a least solution of
(2.1). It follows that (2.1) represents all powers of $k$ and thus the
hypothesis of Theorem 1.2 does not hold for $d=1$. For $d=23$ we have
$L_{1}=1$ and $L_{2}=31$ are the two solutions of (2.3). From Remark 2.3 the
forms (of discriminant $-4(2k-1)(k-1)^{2}$) representing $4k$ are
$(96,62,269)$ and $(96,2,259)$ that have orders $6$ and $15$ respectively.
Therefore equation (2.1) with these exponents for $k$ has the least solutions
$(1727,175,6)$ and $(9795246139,278142485,15)$ . Using (2.4) we see that the
first solution corresponds to $L_{2}$ and the second to $L_{1}$. Now we turn
to the solutions of (2.2). By Lemma 2.4 part (3), a least solution $(x,y,z)$
here satisfies $z\leq 15$. Checking for all these values we get only one class
of solutions for (2.2), represented by the least solution $(1,1,2)$. From
(2.6) we identify that this class corresponds to $L_{1}=1$. The corresponding
class of (2.1) has least solution $(9795246139,278142485,15)$. As the $z$
value is odd here, the hypothesis of Lemma 3.3 is not satisfied and hence the
hypothesis of Theorem 1.2 does not hold for $d=23$. As there is no divisor $d$
satisfying the hypothesis of Theorem 1.2, we are unable to prove the
conjecture for $k=24$.

Example 3: $k=1336$. Here $2k-1=2671$ is prime and $k-1=3\cdot 5\cdot 89$. We
take $d=89$ in Theorem 1.2. As $w(k)=2$ there are two solutions of (2.3)
namely, $L_{1}=913$ and $L_{2}=1425$. The forms of discriminant
$-4(2k-1)89^{2}$ representing $4k$ are $(5344,1826,4115)$ and
$(5344,2850,4339)$, both having order $92$. By Remark 2.3 we find the two
least solutions of (2.1) as $(a_{1},b_{1},92)$ and $(a_{2},b_{2},92)$
belonging to classes corresponding to $L_{1}$ and $L_{2}$ (we have omitted
writing the values of $a_{i}$ and $b_{i}$ as they have several digits). Next
we look for solutions of (2.2) for $z$ up to $92$ as by Lemma 2.4 part (3) we
know that a least solution $(x,y,z)$ satisfies $z\leq 92$. We obtain two
classes of solutions of (2.2) namely $(x_{1},y_{1},2)$ and $(x_{2},y_{2},74)$
corresponding to $L_{2}$ and $L_{1}$ respectively. As the classes
corresponding to $L_{1}$ and $L_{2}$ for (2.1) have least solutions
$(x^{\prime},y^{\prime},z^{\prime})$ with $z^{\prime}$ even (namely $92$), by
Lemma 3.3 all solutions $(x,y,z)$ of (1.2) with $d=89$ have $z$ even. Hence
the hypothesis of Theorem 1.2 holds for $d=89$ and therefore Conjecture 1.1 is
true.

Example 4: $k=96$. In this case our method fails. Here we have $k-1=5\cdot
19$. For $d=1,5,19$ and $k-1$, we see that there are coprime solutions $(x,y)$
to $d^{2}x^{2}+(2k-1)y^{2}=k^{z}$ with $z$ odd. Thus Theorem 1.2 does not
apply and we are unable to settle the conjecture in this case.

Next we consider odd values of $k$ to illustrate Theorem 1.4 using the
algorithm presented at the end of Section 3.

Example 5: $k=531$. We have for the class numbers $h=h(-4(2k-1)=26$ and
$h^{\prime}=h(-4(2k-1)^{2}=530$. We verify for each divisor $d$ of $h$ whether
(2.1) with $D=2k-1$ has a solution and obtain two classes of solutions
$(a_{1},b_{1},2)$ and $(a_{2},b_{2},26)$. We observe that there are no
solutions $(x^{\prime},y^{\prime},d^{\prime})$ of (2.1) with $D=(2k-1)^{2}$
for any divisor $d^{\prime}$ of $h^{\prime}$.

We see that $b_{1}$ and $b_{2}$ are co-prime with $2k-1$. Hence Conjecture 1.1
holds.

Example 6: $k=733$. Here $2k-1=5\cdot 23$. We have $h=104$ and
$h^{\prime}=584$. In the tables below we give the required primes $p$ in Step
5 of the algorithm for odd $k$ in Section 3.3 to conclude that Conjecture 1.1
holds. More specifically, for each solution $(x,y,d)$ (and
$(x^{\prime},y^{\prime},d^{\prime})$) of (2.1) the prime $p$ satisfies $p|y$
($p|y^{\prime}$). It should be noted that $p\not|(2k-1)$.

$d$ | $4$ | $8$ | $26$ | $52$ | $104$
---|---|---|---|---|---
$p$ | $61$ | $7$ | $79$ | $61$ | $7$
Table 1. Solutions $x^{2}+(2k-1)y^{2}=k^{d}$ with $p|y$

$d^{\prime}$ | $146$ | $292$ | $584$
---|---|---|---
$p$ | $29$ | $29$ | $7$
Table 2. Solutions $x^{\prime 2}+(2k-1)^{2}y^{\prime 2}=k^{d^{\prime}}$ with
$p|y^{\prime}$

## References

  * [1] M. Bennett, N. Billerey, Sums of two S-units via Frey-Hellegouarch curves, Math. Comp. 305 (2017) 1375–1401.
  * [2] M.-J. Deng, J. Guo, A.-J. Xu, A note on the Diophantine equation $x^{2}+(2c-1)^{m}=c^{n}$ , Bull. Aust. Math. Soc. 98 (2018) 188–195.
  * [3] Yasutsugu Fujita, Maohua Le, Some exponential diophantine equations II: The equation $x^{2}-Dy^{2}=k^{z}$ for even $k$, Mathematica Slovaca, 72(2), 2022, 341–354.
  * [4] Maohua Le, Some exponential Diophantine equations I: The equation $D_{1}x^{2}-D_{2}y^{2}=\lambda k^{z}$, J. Number Theory, bf 55, (1995), 209–221.
  * [5] Elif Kızıldere Mutlu, Maohua Le, Gökhan Soydan, A modular approach to the generalized Ramanujan-Nagell equation, Indagationes Mathematicae, 33(5), September 2022, 992–1000.
  * [6] P. Ribenboim, My Numbers, My Friends, Popular Lectures on Number Theory, Springer-Verlag, 2000.
  * [7] N. Terai, A note on the diophantine equation $x^{2}+q^{m}=c^{n}$, Bull. Aust. Math. Soc. 90 (2014) 20–27.


00 00 2013 Unpublished

# Notes on the SWIFT method based on Shannon Wavelets for Option Pricing

Fabien Le Floc’h

###### Abstract

This note shows that the cosine expansion based on the Vieta formula is
equivalent to a discretization of the Parseval identity. We then evaluate the
use of simple direct algorithms to compute the Shannon coefficients for the
payoff. Finally, we explore the efficiency of a Filon quadrature instead of
the Vieta formula for the coefficients related to the probability density
function.

###### keywords:

SWIFT method, Wavelets, Heston, stochastic volatility, characteristic
function, quantitative finance

##  1 Introduction

Ortiz-Gracia and Oosterlee [12] describe a novel approach to the pricing of
European options under models with a known characteristic function, based on
Shannon Wavelets, referred to as the SWIFT method hereafter. This note shows
that the cosine expansion based on Vieta’s formula is equivalent to a
discretization of Parseval’s identity. We then evaluate the use of simple
direct algorithms to compute the Shannon coefficients for the payoff. Finally,
we explore the efficiency of a Filon quadrature instead of Vieta’s formula for
the coefficients related to the probability density function.

The equivalence with Parseval’s identity is also stated in [11].

##  2 Equivalence with Parseval’s identity

With the SWIFT method, the price at time $t$ of a Vanilla Put option of
maturity $T$ and log-moneyness $x=\ln\frac{F}{K}$, with $K$ the strike and
forward $F$ is

$v(x,t)=B(t,T)\sum_{k=k_{1}}^{k_{2}}c_{m,k}V_{m,k}$ (1)

where

$\displaystyle c_{m,k}$ $\displaystyle=\left\langle
f|\phi_{m,k}\right\rangle=2^{\frac{m}{2}}\int_{\mathbb{R}}f(x)\phi\left(2^{m}x-k\right)dx,,$
(2) $\displaystyle V_{m,k}$
$\displaystyle=\int_{I_{m}}v(y,T)\phi_{m,k}(y)dy\,,$ (3)
$\displaystyle\phi_{m,k}(x)$
$\displaystyle=2^{\frac{m}{2}}\phi\left(2^{m}x-k\right)\,,$ (4)
$\displaystyle\phi(x)$ $\displaystyle=\frac{\sin\pi x}{\pi x}$ (5)

and $k_{1},k_{2},m\in\mathbb{Z}$, $m>=1$ suitably chosen, $f$ the probability
density function and $v(y,T)$ is the payoff at maturity with
$y=\ln\frac{F(T,T)}{K}$, that is $v(y,T)=K|1-e^{y}|^{+}$ for a vanilla Put
option.

In [12], the coefficients $c_{m,k}$ and $V_{m,k}$ are computed using an
approximation based on Vieta formula for the cardinal sinus:

$\phi(x)\approx\frac{1}{2^{J-1}}\sum_{j=1}^{2^{J-1}}\cos\left(\frac{2j-1}{2^{J}}\pi
x\right)$ (6)

where $J$ is chosen sufficiently large.

As mentioned in paragraph 3.1.2 of their paper, $c_{m,k}$ can also be computed
by Parseval’s identity:

$c_{m,k}=\left\langle
f|\phi_{m,k}\right\rangle=\frac{1}{2\pi}\left\langle\hat{f}|\hat{\phi}_{m,k}\right\rangle$
(7)

where $\hat{f},\hat{\phi}_{m,k}$ are the Fourier transforms of $f$ and
$\phi_{m,k}$. In particular $\hat{f}(z)=\psi(-z)$ where $\psi$ is the
characteristic function and

$\hat{\phi}_{m,k}(w)=\frac{e^{-i\frac{k}{2^{m}}w}}{2^{\frac{m}{2}}}\operatorname*{rect}\left(\frac{w}{2^{m+1}\pi}\right)$
(8)

where $\operatorname*{rect}$ is the rectangular function, that is
$\operatorname*{rect}(x)=1$ for $|x|<\frac{1}{2}$,
$\operatorname*{rect}(x)=\frac{1}{2}$ for $|x|=\frac{1}{2}$,
$\operatorname*{rect}(x)=0$ for $|x|>\frac{1}{2}$.

Via a the change of variable $t=\frac{w}{2^{m+1}\pi}$, we obtain

$\displaystyle c_{m,k}$
$\displaystyle=2^{\frac{m}{2}}\int_{-\frac{1}{2}}^{\frac{1}{2}}\left[\hat{f}(2^{m+1}\pi
t)e^{i2\pi kt}\right]dt$ (9)
$\displaystyle=2^{\frac{m}{2}+1}\Re\left[\int_{0}^{\frac{1}{2}}\hat{f}(2^{m+1}\pi
t)e^{i2\pi kt}dt\right]$ (10)

as
$\Re(\psi(x))=\frac{\psi(x)+\overline{\psi(x)}}{2}=\frac{\psi(x)+\psi(-x)}{2}$.

Let us now discretize in $2^{J-1}$ equidistant steps equation (10) of size
$\frac{1}{2^{J}}$ at the mid-points $t_{j}=\frac{j-\frac{1}{2}}{2^{J}}$ for
$j=1,2,...,2^{J-1}$, we obtain

$\displaystyle c_{m,k}^{\star}$
$\displaystyle=\frac{2^{\frac{m}{2}}}{2^{J-1}}\sum_{j=1}^{2^{J-1}}\Re\left[\hat{f}(2^{m}\pi
2t_{j})e^{i\pi k2t_{j}}\right]$ (11)
$\displaystyle=\frac{2^{\frac{m}{2}}}{2^{J-1}}\Re\left[\sum_{j=1}^{2^{J-1}}\hat{f}\left(\frac{2^{m}\pi(2j-1)}{2^{J}}\right)e^{2i\pi
k\frac{j-\frac{1}{2}}{2^{J}}}\right]$ (12)
$\displaystyle=\frac{2^{\frac{m}{2}}}{2^{J-1}}\Re\left[e^{i\pi\frac{k}{2^{J}}}\sum_{j=0}^{2^{J-1}-1}\hat{f}\left(\frac{2^{m}\pi(2j-1)}{2^{J}}\right)e^{2i\pi
k\frac{j}{2^{J}}}\right]$ (13)

This is exactly equation (24) of [12, p. B127] which corresponds to their
expansion based on Vieta’s formula. Their expansion is thus equivalent to the
mid-point quadrature applied to Parseval’s identity.

A particularly important property of equation 13 is that it can be computed by
fast Fourier transform (FFT). The typical FFT algorithm computes the tranform
(or inverse transform) from index $0$ to $n$. Here, we start with a negative
index $k_{1}$. The coefficients can be obtained with the relation

$\displaystyle\mathbf{c}$
$\displaystyle=\frac{2^{\frac{m}{2}}}{2^{J-1}}\Re\left[\mathbf{e}^{T}\mathcal{F}^{-1}\left\\{\mathbf{f}\right\\}\right]$
(14)

where $\mathcal{F}^{-1}$ is the unscaled inverse discrete Fourier transform of
size $2^{J}$, the vector $\mathbf{f}$ has elements
$f_{j}=\hat{f}\left(\frac{2^{m}\pi(2j+1)}{2^{J}}\right)e^{2i\pi\frac{k_{1}j}{2^{J}}}$
and the vector $\mathbf{e}$ has elements
$e_{l}=e^{i\pi\frac{l+k_{1}}{2^{J}}}$. We also assumed that
$\hat{f}\left(\frac{2^{m}\pi(2j+1)}{2^{J}}\right)=0$ for $j\geq 2^{J-1}$. This
leads to a very efficient way to compute the coefficients $c_{m,k}$, for all
$k$, together. In practice, this means that the bounds $k_{1}\leq k<k_{2}$ are
chosen so that $k_{2}-k_{1}<2^{J}$.

In particular, if we center the interval around zero, that is for
$k_{1}=-2^{J-1}$, we can save a bit of computation by directly using
$f_{j}=\hat{f}\left(\frac{2^{m}\pi(2j+1)}{2^{J}}\right)$ and swapping
$(g_{0},...,g_{2^{J-1}})$ with $(g_{2^{J}-1},...g_{2^{J}-1})$ where
$\mathbf{g}=\mathcal{F}^{-1}\left\\{\mathbf{f}\right\\}$.

##  3 Alternative quadratures

###  3.1 Trapezoidal

Instead of the mid-point method, we could have considered the trapezoidal
method, this would result in

$c_{m,k}^{\star}=\frac{2^{\frac{m}{2}}}{2^{J-1}}\Re\left[\sum_{j=0}^{2^{J-1}-1}w_{j}\hat{f}\left(\frac{2^{m}\pi(2j)}{2^{J}}\right)e^{2i\pi
k\frac{j}{2^{J}}}\right]$ (15)

where $w_{j}=1$ for $j\geq 1$ and $w_{0}=\frac{1}{2}$.

The fast inverse discrete Fourier transform of length $2^{J}$ can be directly
used to compute $c_{m,k}$ by using
$f_{j}=\hat{f}\left(\frac{2^{m}\pi(2j)}{2^{J}}\right)$ for $1\leq j<2^{J-1}$,
$f_{j}=0$ for $2^{J-1}\leq j$, and $f_{0}=\frac{1}{2}\hat{f}(0)$.

We will see in the numerical examples that it can be much more accurate than
the mid-point method.

In the same framework, we could also explore other quadratures, such as the
Simpson’s quadrature. The problem is that those tend to behave worse than the
midpoint or trapezoidal rules on oscillatory functions. In fact, the
trapezoidal rule can achieve exponential convergence on oscillatory functions
[5, 14]. In the case of the probability density transform function $\hat{f}$,
this can be also be seen from the Euler-Maclaurin formula where as all the
derivatives $\hat{f}^{(2l+1)}\left(2^{m}\pi\right)$ will be small if the
characteristic function decreases exponentially.

###  3.2 Adaptive Filon

Instead of quadrature with a fixed number of steps, we can use an adaptive
Filon quadrature to compute the coefficients $c_{m,k}$ by equation (10). This
is particularly interesting since the cost of computing the characteristic
function is relatively high.

Is it more important to reduce its number of evaluations than to use Fast
Fourier Transform tricks to compute $c_{m,k}$? We will explore this in the
numerical examples (section 8).

An alternative adaptive quadrature, close in spirit, is to use an adaptive
cubic-Hermite quadrature to integrate $\hat{f}$, and use the integration nodes
to compute the piecewise cubic Hermite interpolant of $\hat{f}$. Then we can
use the trapezoidal-FFT approach on a dense discretization. This saves
explicit computations of the characteristic function while still allowing the
use of the FFT algorithm.

##  4 Sine and Exponential integrals for the payoff

For a Vanilla Put option, the payoff at maturity is $V(y,T)=K(1-e^{y})^{+}$.
According to equation (3), the payoffs coefficients are then

$\displaystyle V_{m,k}$
$\displaystyle=K2^{\frac{m}{2}}\int_{a}^{0}(1-e^{y})\frac{\sin\left(\pi\left(2^{m}y-k\right)\right)}{\pi\left(2^{m}y-k\right)}dy$
(16)
$\displaystyle=K2^{\frac{m}{2}}\int_{a}^{0}\frac{\sin\left(\pi\left(2^{m}y-k\right)\right)}{\pi\left(2^{m}y-k\right)}dy-K2^{\frac{m}{2}}\int_{a}^{0}e^{y}\frac{\sin\left(\pi\left(2^{m}y-k\right)\right)}{\pi\left(2^{m}y-k\right)}dy$
(17)
$\displaystyle=\frac{K}{2^{\frac{m}{2}}\pi}\int_{\pi\left(2^{m}a-k\right)}^{-\pi
k}\frac{\sin
t}{t}dt-\frac{Ke^{\frac{k}{2^{m}}}}{2^{\frac{m}{2}}\pi}\int_{\pi\left(2^{m}a-k\right)}^{-\pi
k}e^{\frac{t}{\pi 2^{m}}}\frac{\sin t}{t}dt$ (18)

The first integral corresponds the sine integral
$\textsf{Si}(x)=\int_{0}^{x}\frac{\sin t}{t}dt$. Many efficient algorithms
exist to compute it [9, 4]. Most mathematical software (for example Octave,
Matlab) or libraries (for example netlib) include the function. It can
effectively be considered as a closed form function.

The second integral can be reduced to evaluations of the complementary
exponential integral $\textsf{Ein}(z)=\int_{0}^{z}\frac{1-e^{-t}}{t}dt$ in the
complex plane. In deed, it can be verified that we have the identity

$\int_{0}^{1}\frac{e^{-at}\sin(bt)}{t}dt=\Im\textsf{Ein}(a+ib)$ (19)

The complementary exponential integral is related to the exponential integral
$\textsf{Ei}(z)=-\int_{z}^{\infty}\frac{e^{-t}}{t}dt$ by the relation
$\textsf{Ein}(z)=\gamma+\ln|z|+i\Im(-z)|\arg(-z)|-\textsf{Ei}(-z)$. Again many
efficient algorithms exist to compute the complementary exponential integral
[1, 4, 13].

In terms of those special functions, the coefficients are:

$V_{m,k}=\frac{K}{2^{\frac{m}{2}}\pi}e^{\frac{k}{2^{m}}}\Im\left[\textsf{Ein}\left(-\frac{t_{a}}{\pi
2^{m}}+it_{a}\right)-\textsf{Ein}\left(-\frac{t_{0}}{\pi
2^{m}}+it_{0}\right)\right]-\frac{K}{2^{\frac{m}{2}}\pi}\left[\textsf{Si}(t_{a})-\textsf{Si}(t_{0})\right]$
(20)

with $t_{a}=\pi\left(2^{m}a-k\right)$ and $t_{0}=-\pi k$.

The expansion based on Vieta’s formula might require thousands of terms to
reach an acceptable accuracy (Table 1). With the same number of terms, a
Simpson 3/8 quadrature is more accurate and faster to compute. Our simple
implementation of the algorithm from Pegoraro and Slusallek [13] is much
faster and achieves machine epsilon accuracy while the algorithm from the CERN
libary Mathlib [6] is even faster for a close to machine epsilon accuracy as
it relies on simple rational and padé expansions in the zone of interest. In
practice, the implementation of the SWIFT method will still benefit from a
cache table of $V_{m,k}$ for example for $m\in\\{2,...,8\\}$ and
$k\in\\{-512,...,512\\}$.

Table 1: $V_{m,k}$ for $m=6$, $k=-1$, $a=-1$. Vieta’s formula or Simpson’s quadrature use $2^{J-1}$ terms.  Method | Value | Time(ns)
---|---|---
Vieta $J=5$ | -0.0555195115435162 | 600
Simpson $J=5$ | -0.0020905045216672 | 520
Vieta $J=10$ | 0.0020428901436639 | 17300
Simpson $J=10$ | 0.0020420973936057 | 15300
CERN | 0.0020420954069492 | 420
Pegoraro | 0.0020420954069488 | 2500

##  5 Alternative payoff coefficients

The interval $[a,b]$ is centered along the spot $F(0,T)$, we can express the
payoff in terms of the spot $F(0,T)$ instead of the strike $K$. This leads to

$\displaystyle V_{m,k}$
$\displaystyle=2^{\frac{m}{2}}\int_{a}^{b}F\left|\frac{K}{F}-e^{y}\right|^{+}\frac{\sin\left(\pi\left(2^{m}y-k\right)\right)}{\pi\left(2^{m}y-k\right)}dy$
(21)
$\displaystyle=F2^{\frac{m}{2}}\int_{a}^{z}\left(e^{z}-e^{y}\right)\frac{\sin\left(\pi\left(2^{m}y-k\right)\right)}{\pi\left(2^{m}y-k\right)}dy$
(22)
$\displaystyle=Ke^{-z}2^{\frac{m}{2}}\int_{a}^{z}\left(e^{z}-e^{y}\right)\frac{\sin\left(\pi\left(2^{m}y-k\right)\right)}{\pi\left(2^{m}y-k\right)}dy$
(23)

where $z=\ln\frac{K}{F}$ and $y=\ln\frac{S_{T}}{F}$.

In terms of those special functions, the coefficients are:

$V_{m,k}(z)=\frac{Ke^{\frac{k}{2^{m}}-z}}{2^{\frac{m}{2}}\pi}\Im\left[\textsf{Ein}\left(-\frac{t_{a}}{\pi
2^{m}}+it_{a}\right)-\textsf{Ein}\left(-\frac{t_{z}}{\pi
2^{m}}+it_{z}\right)\right]-\frac{K}{2^{\frac{m}{2}}\pi}\left[\textsf{Si}(t_{a})-\textsf{Si}(t_{z})\right]$
(24)

with $t_{a}=\pi\left(2^{m}a-k\right)$ and $t_{z}=\pi\left(2^{m}z-k\right)$.

The price of the option of strike $K$ corresponds then to $v(0,t)$. The
coefficients $c_{m,k}$ become independent of $x$. This is nearly equivalent to
the Levy based equation (33) in [12] that defines the coefficients
$V_{m,k}^{\alpha}(x)$. The difference lies in the interval considered. In
their paper, $V_{m,k}^{\alpha}(x)=\int_{a}^{b}K|1-e^{u}|^{+}\phi_{m,k}(u+z)du$
with $u=\ln\frac{S_{T}}{K}$. This can be rewritten as

$V_{m,k}^{\alpha}(x)=K\int_{a+z}^{z}\left(1-e^{t-z}\right)\phi_{m,k}(t)dt$
(25)

with the change of variable $t=u+z$. The interval $[a,b]$ is thus shifted from
$z$ upwards. Our choice of interval is more accurate as it corresponds
directly to the Levy characteristic function, while their interval is based on
the shifted Levy characteristic function. Also their Levy formulation (as well
as ours) leads to options prices different from the classic formulation: for
the two to be equivalent, the integers $k_{1}$ and $k_{2}$ should be adjusted
to $k_{1}=2^{m}(a+z)$ and $k_{2}=2^{m}(b+z)$. But then some of the density
coefficients need to be recomputed at each strike as the window
$[k_{1},k_{2}]$ moves forward as $z$ increases and the Levy approach loses in
efficiency.

Another advantage of having $c_{m,k}$ independent of the strike is that the
integers $k_{1}$ and $k_{2}$ can also be determined in a strike independent
manner from the value of the density coefficients $c_{m,k}$ and the area under
the curve defined by the probability density (which should sum to one minus a
user-defined tolerance) as explained by Ortiz-Gracia and Oosterlee [12],
instead of relying on the relatively rough guess given by the cumulants (the
fixed interval $[a,b]$). With the cumulants approach, it is not always obvious
how large the truncation level $L$ should be chosen to achieve a desired
accuracy.

##  6 Alternative FFT-compatible payoff coefficients

In a similar fashion to Maree et al. [11], we start from the definition

$\frac{\sin(\pi x)}{\pi x}=\int_{0}^{1}\cos(\pi xw)dw\,.$ (26)

We can then choose an appropriate discretization that has good convergence,
and is allows computation of the payoff coefficients $V_{m,k}$ by the FFT. The
choice from Ortiz-Gracia and Oosterlee [12] is equivalent to the mid-point
quadrature. On this problem, the Trapezoidal rule would not lead to an
increase in accuracy111It can be shown that the mid-point is actually more
accurate by a factor of two.. A particularly simple an effective choice is the
second Euler-Maclaurin summation formula, that is the Euler-Maclaurin
extension to the mid-point rule.

$\frac{\sin(\pi x)}{\pi x}\approx\frac{1}{N}\sum_{n=0}^{N-1}\cos\left(\pi
x\frac{2n+1}{2N}\right)+\frac{\pi x}{24N^{2}}\sin(\pi x)\,.$ (27)

Using the above in equation (23) leads to

$\displaystyle V_{m,k}$
$\displaystyle=\frac{Ke^{-z}2^{\frac{m}{2}}}{N}\sum_{n=1}^{N-1}\int_{a}^{z}\left(e^{z}-e^{y}\right)\cos\left(\pi\left(2^{m}y-k\right)\frac{2n+1}{2N}\right)dy$
$\displaystyle+\frac{\pi}{24N^{2}}Ke^{-z}2^{\frac{m}{2}}\int_{a}^{z}\left(2^{m}y-k\right)\left(e^{z}-e^{y}\right)\sin\left(\pi\left(2^{m}y-k\right)\right)dy$
(28)

Let $C_{n}(a,z)=\int_{a}^{z}\left(e^{z}-e^{y}\right)\cos\left(\pi
2^{m}y\frac{n}{N}\right)dy$ and
$S_{n}(a,z)=\int_{a}^{z}\left(e^{z}-e^{y}\right)\sin\left(\pi
2^{m}y\frac{n}{N}\right)dy$. Using the trigonometric cos and sin identities,
we obtain

$\displaystyle V_{m,k}$
$\displaystyle=\frac{Ke^{-z}2^{\frac{m}{2}}}{N}\sum_{n=0}^{N-1}C_{n+\frac{1}{2}}(a,z)\cos\left(\pi
k\frac{2n+1}{2N}\right)+S_{n+\frac{1}{2}}(a,z)\sin\left(\pi
k\frac{2n+1}{2N}\right)$ $\displaystyle-\frac{(-1)^{k}\pi
k}{24N^{2}}Ke^{-z}2^{\frac{m}{2}}S_{N}(a,z)\
-\frac{(-1)^{k}}{24N^{2}}Ke^{-z}2^{\frac{m}{2}}D(a,z)$ (29)

with

$\displaystyle D(a,z)$
$\displaystyle=e^{z}\frac{\left(\left({{{{p}_{m}}}^{4}}+{{{{p}_{m}}}^{2}}\right)z-3{{{{p}_{m}}}^{2}}-1\right)\,\sin{\left({{p}_{m}}z\right)}+\left(\left({{{{p}_{m}}}^{3}}+{{p}_{m}}\right)z+2{{{{p}_{m}}}^{3}}\right)\,\cos{\left({{p}_{m}}z\right)}}{{p}_{m}(p_{m}^{4}+2{{{{p}_{m}}}^{2}}+1)}$
$\displaystyle+e^{z}\frac{\left({{{{p}_{m}}}^{4}}+2{{{{p}_{m}}}^{2}}+1\right)\sin{\left(a\,{{p}_{m}}\right)}+\left(-a\,{{{{p}_{m}}}^{5}}-2a\,{{{{p}_{m}}}^{3}}-a\,{{p}_{m}}\right)\cos{\left(a\,{{p}_{m}}\right)}}{{p}_{m}(p_{m}^{4}+2{{{{p}_{m}}}^{2}}+1)}$
$\displaystyle+e^{a}\frac{\left(\left(-a-1\right)\,{{{{p}_{m}}}^{4}}+\left(1-a\right)\,{{{{p}_{m}}}^{2}}\right)\sin{\left(a\,{{p}_{m}}\right)}+\left(a\,{{{{p}_{m}}}^{5}}+\left(a-2\right)\,{{{{p}_{m}}}^{3}}\right)\cos{\left(a\,{{p}_{m}}\right)}}{{p}_{m}(p_{m}^{4}+2{{{{p}_{m}}}^{2}}+1)}\,,$
(30) $\displaystyle C_{n}(a,z)$
$\displaystyle=e^{z}\frac{\sin\left(q_{n,m}z\right)-q_{n,m}\cos\left(q_{n,m}z\right)}{q_{n,m}(1+q_{n,m}^{2})}-e^{z}\frac{\sin\left(q_{n,m}a\right)}{q_{n,m}}$
$\displaystyle+e^{a}\frac{\cos\left(q_{n,m}a\right)+q_{n,m}\sin\left(q_{n,m}a\right)}{1+q_{n,m}^{2}}\,,$
(31) $\displaystyle S_{n}(a,z)$
$\displaystyle=-e^{z}\frac{\cos\left(q_{n,m}z\right)+q_{n,m}\sin\left(q_{n,m}z\right)}{q_{n,m}(1+q_{n,m}^{2})}+e^{z}\frac{\cos\left(q_{n,m}a\right)}{q_{n,m}}$
$\displaystyle+e^{a}\frac{\sin\left(q_{n,m}a\right)-q_{n,m}\cos\left(q_{n,m}a\right)}{1+q_{n,m}^{2}}\,,$
(32) $\displaystyle q_{n,m}$ $\displaystyle=\frac{n}{N}p_{m}\,,$ (33)
$\displaystyle p_{m}$ $\displaystyle=\pi 2^{m}\,.$ (34)

In particular, $S_{N}$ and $D$ are independent of $k$. Computing $V_{m,k}$
with the Euler-Maclauring correction for all $k$ requires only $k$ more
multiplications than the mid-point quadrature. The sum over $n$ corresponds to
the mid-point quadrature, and can be computed with two fast Fourier transforms
of size $N$ (see appendix A).

##  7 Choice of $m$ and $k_{1},k_{2}$

The SWIFT method accuracy is fully determined by the choice of the scale $m$
and the truncation $k_{1},k_{2}$. There is some interplay between those since
the scale $m$ also determines the truncation of the characteristic function:
the characteristic function will not be evaluated beyond $2^{m}\pi$.

If we want to use the radix-2 FFT algorithm to compute the payoff coefficients
$V_{m,k}$, there is little reason not to use $k_{2}-k_{1}=2^{J}$, centered on
zero, where a reasonably good guess for $J$ can be obtained from the model
characteristic function cumulants. In the evaluation of a single option
strike, the cost of computing the payoff coefficients will dominate the cost
of evaluating the price based on the sum of the $V_{m,k}$ multiplied by the
(precomputed) density coefficients $c_{m,k}$. Furthermore, the number of
coefficients must be a power of two and must include $[k_{1},k_{2})$.

The scale $m$ is more challenging to guess. It can be guessed from the rule
used to truncate the integral of the more standard Fourier based approach from
Andersen and Piterbarg [2], refined in [7]. It then directly depends on the
asymptotic behaviour of the characteristic function. Maree et al. [11] propose
a simple iterative method to determine $n$ automatically (with very few
iterations on $m$).

##  8 Numerical examples

###  8.1 Payoff coefficients $V_{m,k}$ and the FFT

Vieta’s formula is not very efficient to compute a single coefficient
$V_{m,k}$ but as we compute close to $2^{J}$ coefficients the FFT improves its
performance significantly. For $2^{1}0$ coefficients, Vieta’s formula end up
around six times faster than the CERN algorithm.

Table 2: Time in microseconds taken to compute $V_{m,k}$ for $k=0,...,2^{J-1}-1$ with $m=6$, $a=-1$. $J$ | FFT | CERN
---|---|---
5 | 1.7 | 10.7
10 | 56 | 360

While the raw difference in performance is impressive. It is more interesting
to look at the actual performance difference when pricing vanilla Put options
under the Heston stochastic volatility model. We consider two different Heston
parameter sets for two distinct option maturities. This leads to two vastly
different truncation ranges $[a,b]$, computed according to the Heston
cumulants. As a result $2^{J}=2^{12}=k_{2}-k_{1}$ for the first set and
$2^{J}=2^{8}=k_{2}-k_{1}$ for the second set. Ignoring the initialization time
where the $c_{m,k}$ are computed, which needs to be done only once per option
expiry, the direct CERN algorithm is between five to eight times slower.

Table 3: Heston parameter sets. Name | $v_{0}$ | $\kappa$ | $\theta$ | $\sigma$ | $\rho$ | $F$ | $T$
---|---|---|---|---|---|---|---
Set 1 | 0.1 | 1.0 | 0.1 | 1.0 | -0.9 | 1.0 | 2 days
Set 2 | 0.0225 | 0.1 | 0.01 | ,2.0 | 0.5 | 1000000 | 1 year
Table 4: Time in milliseconds taken to compute the Put option price under two different Heston parameter sets. Heston | Method | Price | Error | Time (ms)
---|---|---|---|---
Set 1 (J=12) | FFT | 117.9149 | -1.4704 | 0.250
| CERN | 117.9144 | -1.4708 | 1.370
Set 2 (J=8) | FFT | 0.006361 | -3.49e-15 | 0.016
| CERN | 0.006361 | 6.42e-13 | 0.101

###  8.2 New payoff coefficients versus the original formulation

We consider options of maturity 2 days (short) in order to make the issue more
visible and we consider the Heston parameters s
$\kappa=1.0,\theta=0.1,\sigma=1.0,\rho=-0.9,v_{0}=0.1$, along with a forward
price at valuation time $F=1.0$. Those parameters are not extreme, and are in
the typical range of a Heston fits to market option prices.

In Figure 1, we look at the absolute error in price for a scale $m=8$ and a
truncation $L=12$ based on the Heston cumulants. This truncation corresponds
to an interval $[a,b]=[-0.2815,0.2810]$. Our reference is the price obtained
by the Lord-Kahl optimal alpha method Lord and Kahl [8]. We consider two ways
of computing the payoff coefficients: the classic payoff formula of [12]
represented by equation (25), and our new formula represented by equation
(23). We make sure that the density coefficients are computed with maximum
accuracy by using a large $J$, so that the overall error is dominated by error
in the payoff formula.

Figure 1: Error in Vanilla option prices of maturity 2 days with Heston
parameters $\kappa=1.0,\theta=0.1,\sigma=1.0,\rho=-0.9,v_{0}=0.1,F=1.0$ using
a truncation levels $L=12$ and scale $m=8$.

We stop at strike $K=1.32$ since then $\ln\frac{K}{F}>b$. Figure 1 shows that
the error of the new formula stays below $10^{-13}$, close to machine epsilon
while the error of the classic formula can be as high as $1.5\cdot 10^{-2}$
when the strike approaches the upper boundary $Fe^{b}$.

###  8.3 Density coefficients $c_{m,k}$ and quadratures

We consider the same Heston model parameters as in the previous section. The
trapezoidal rule is three to six times more accurate than the mid-point rule
(or equivalently the formula from Ortiz-Gracia and Oosterlee [12] based
Vieta’s formula) across strikes and on both Heston sets. Both rules use
exactly the same number of points.

Table 5: Price of an out-of-the-money option under two different Heston parameter sets. Heston | Method | Strike | Price | Error
---|---|---|---|---
Set 1 ($m=8,J=12$) | Midpoint | 250000 | 114.51 | -4.87
| Trapezoidal | 250000 | 117.91 | -1.47
| Midpoint | 4000000 | 3866.59 | -85.33
| Trapezoidal | 4000000 | 3931.09 | -20.82
Set 2 ($m=6,J=5$) | Midpoint | 1.0064 | 0.0063611 | 3.97e-07
| Trapezoidal | 1.0064 | 0.0063606 | -7.39e-08
| Midpoint | 1.064 | 4.77e-06 | 5.09e-07
| Trapezoidal | 1.064 | 4.18e-06 | -8.22e-08

We now look at the time to initialize the SWIFT method for a given option
maturity. This corresponds to the calculation of the density coefficients
$c_{m,k}$, either with the FFT applied on the trapezoidal quadrature, or with
the direct adaptive Filon quadrature on a relative tolerance of $10^{-8}$
(which leads to a similar accuracy as the FFT approach).

Table 6: Initialization time of the SWIFT method for two different Heston parameter sets and different quadratures. Heston | Method | Points | Time (microseconds)
---|---|---|---
Set 1 | FFT | 4096 | 433
| Filon | 585 | 76000
Set 2 | FFT | 32 | 16
| Filon | 497 | 588

For a similar accuracy, the initialization based on the adaptive Filon
quadrature is slower by a factor of more than 32 although the characteristic
function is evaluated 585 times compared to 2048 times for the FFT
calculation. There is then a lot of room if we were to make the FFT density
calculation adaptive by doubling successively the interval $[k_{1},k_{2}]$.

##  9 Conclusion

The use of the fast Fourier transform (FFT) to compute the payoff coefficients
is particularly important and makes the SWIFT method competitive with some of
the fastest pricing methods such as COS method of Fang and Oosterlee [3]. Our
alternative formula centered on the forward is more accurate in general than
the original payoff coefficients formula from Ortiz-Gracia and Oosterlee [12]
while being of equivalent computational cost.

The calculation of the density coefficients also benefits from the FFT, even
though the related characteristic function is relatively expensive to compute.
The FFT based on the trapezoidal rule is much more accurate than the original
formula from Ortiz-Gracia and Oosterlee [12] for a slightly lower
computational cost. Using more fancy adaptive quadratures is no so useful. A
simple adaptive scheme based successively doubling the truncation interval
$[k_{1},k_{2}]$ according to the accuracy of the area underneath the curve is
good enough.

## References

  * Amos [1990] Amos, D. E. (1990) Algorithms 683: a portable FORTRAN subroutine for exponential integrals of a complex argument, ACM Transactions on Mathematical Software (TOMS), 16(2), pp. 178–182.
  * Andersen and Piterbarg [2010] Andersen, L. B. and Piterbarg, V. V. (2010) Interest Rate Modeling, Volume I: Foundations and Vanilla Models, (Atlantic Financial Press London).
  * Fang and Oosterlee [2008] Fang, F. and Oosterlee, C. W. (2008) A novel pricing method for European options based on Fourier-cosine series expansions, SIAM Journal on Scientific Computing, 31(2), pp. 826–848.
  * Jin and Jjie [1996] Jin, J. and Jjie, Z. S. (1996) Computation of special functions, (Wiley).
  * Johnson [2011] Johnson, S. G., Numerical integration and the redemption of the trapezoidal rule. (2011) , Technical report, MIT Applied Math.
  * Kölbig [1990] Kölbig, K., Exponential Integral for Complex Argument. (1990) , Technical report, CERN.
  * Le Floc’h [2013] Le Floc’h, F. (2013) Fourier Integration and Stochastic Volatility Calibration, Available at SSRN 2362968.
  * Lord and Kahl [2007] Lord, R. and Kahl, C. (2007) Optimal Fourier inversion in semi-analytical option pricing, SSRN papers.ssrn.com/abstract=921336.
  * MacLeod [1996] MacLeod, A. J. (1996) Rational approximations, software and test methods for sine and cosine integrals, Numerical Algorithms, 12(2), pp. 259–272.
  * Makhoul [1980] Makhoul, J. (1980) A fast cosine transform in one and two dimensions, IEEE Transactions on Acoustics, Speech, and Signal Processing, 28(1), pp. 27–34.
  * Maree et al. [2017] Maree, S. C., Ortiz-Gracia, L. and Oosterlee, C. W. (2017) Pricing early-exercise and discrete barrier options by Shannon wavelet expansions, Numerische Mathematik, 136(4), pp. 1035–1070.
  * Ortiz-Gracia and Oosterlee [2016] Ortiz-Gracia, L. and Oosterlee, C. W. (2016) A highly efficient Shannon wavelet inverse Fourier technique for pricing European options, SIAM Journal on Scientific Computing, 38(1), pp. B118–B143.
  * Pegoraro and Slusallek [2011] Pegoraro, V. and Slusallek, P. (2011) On the evaluation of the complex-valued exponential integral, Journal of Graphics, GPU, and Game Tools, 15(3), pp. 183–198.
  * Trefethen and Weideman [2014] Trefethen, L. N. and Weideman, J. (2014) The exponentially convergent trapezoidal rule, SIAM Review, 56(3), pp. 385–458.

##  Appendix A Computing the discrete Cosine and Sine transforms together from
the FFT

The calculation of the $V_{m,k}$ by the formula described in Appendix A of
Ortiz-Gracia and Oosterlee [12] is the sum of a type 2 discrete cosine
transform (DCT) and a type 2 discrete sine transform (DST). It can be
summarized by the following equation

$\displaystyle V_{m,k}$ $\displaystyle=\sum_{j=0}^{N-1}a_{j}\cos\left(\pi
k\frac{j+\frac{1}{2}}{N}\right)+b_{j}\sin\left(\pi
k\frac{j+\frac{1}{2}}{N}\right)$ (35)

with $N=2^{\bar{J}-1}$ for some positive integer $\bar{J}$. Makhoul [10] gives
a simple algorithm to compute the DCT of size $N$ with one FFT of size $N$. We
simply initialize the FFT coefficients $c_{j}$ with:

$c_{j}=a_{2j}\quad\,,\quad c_{N-1-j}=a_{2j+1}\quad\textmd{ for
}j=0,...,\frac{N}{2}-1$ (36)

and then from the result of the FFT $\hat{c}$, the DCT coefficients $\hat{a}$
are

$\hat{a}_{k}=\Re\left[\hat{c}_{j}e^{-i\pi\frac{k}{2N}}\right]$ (37)

Makhoul does not specify the equivalent formula for the DST, but we can do
something similar. We first initialize the FFT coefficients $c_{j}$ with:

$c_{j}=b_{2j}\quad\,,\quad c_{N-1-j}=-b_{2j+1}\quad\textmd{ for
}j=0,...,\frac{N}{2}-1$ (38)

and then from the result of the FFT $\hat{c}$, the DST coefficients $\hat{b}$
are

$\hat{b}_{k}=-\Im\left[\hat{c}_{j}e^{-i\pi\frac{k}{2N}}\right]$ (39)

For maximum performance, the two FFTs can reuse the same sine and cosine
tables. And the last step of the DCT and DST can be combined together.