1 Introduction

A partition of a positive integer \(n\) is a non-increasing sequence of positive integers whose sum is \(n\), and the number of such partitions is denoted by \(P(n)\) (we define \(P(0)=1\)). A standard result is

$$\begin{aligned} \sum _{j\ge 0}P(j)x^j=\frac{1}{\prod _{j\ge 1}(1-x^j)}. \end{aligned}$$

Many researchers, for example George Andrews, have focused on the number of partitions satisfying certain conditions (for example, see [15, 8, 10, 11] and references therein). For instance, if \(Q(n)\) is the number of partitions of \(n\) with distinct parts and \(Q(0):=1\), then we have the generating function

$$\begin{aligned} \sum _{j\ge 0}Q(j)x^j=\prod _{j\ge 0}(1+x^j). \end{aligned}$$

In this paper, we define a new statistic, namely a corner for such partitions. This is related both to descents and the number of occurrences of a part (of fixed size). It is simple to describe corners in terms of the associated Ferrers diagrams.

The Ferrers diagram of an integer partition proves to be a useful tool for visualizing partitions. It is constructed by stacking left-justified rows of cells, where the number of cells in the \(i\)th row corresponds to the size of the \(i\)th part.

A corner of a partition \(\pi \) is a point of degree two in the corresponding Ferrers diagram. We denote the number of corners of \(\pi \) by \(cor(\pi )\). For example, if \(\pi =4422111\), then \(cor(\pi )=6\), see Fig. 1. Moreover, we define \(cor_k(\pi )\) to be the number of corners at line \(y=k\) in the Ferrers diagram of \(\pi \), where the topmost horizontal line of the Ferrers diagram is the line \(y=0\). For example, for the partition illustrated below, \(cor_0(\pi )=2\) (corners \(E\) and \(F\)), \(cor_2(\pi )=1\) (corner \(C\)) and so on. More generally, we are interested in several types of corners. We say that a corner is of type \((a,b)\) if it is at the bottom right of a specific maximal \(a\times b\) rectangle (where \(b\) is its length and \(a\) its height). For such a maximal rectangle, there are no cells below it and no cells to its right. Thus, corner \(B\) is at the bottom right of the 2 by 1 rectangle, with cells marked by X. So that \(B\) is a \((2,1)\) corner. Here, we shall only consider corners which are at the bottom-right extremities of such \(b\) by \(a\) rectangles. So for convenience, we ignore the 3 corners \(D\), \(E\) and \(F\) at levels \(x=0\) and \(y=0\). Thus, the partition in Fig. 1 has corners \(C\) of type \((2,2)\), \(B\) of type \((2,1)\) and \(A\) of type \((3,1)\).

Fig. 1
figure 1

The 6 corners of \(\pi =4422111\), with \(A\), \(B\) and \(C\) of type \((a,b)\)

We observe that a corner of type \((a,b)\) in the Ferrers diagram of \(\pi \) corresponds to consecutive parts \(c\,,\,c-b\) in the partition \(\pi \) such that the multiplicity of \(c\) is exactly \(a\) and the last occurrence of \(c\) is followed by a part of size \(c-b\). We also consider corners of type \((a+,b)\); these are corners of type \((j,b)\) for any \(j \ge a\). Similarly, we define corners of type \((a+,b+)\). Finally, we define the size of corners of type \((a,b)\) to be \(a+b\).

We summarize some of the main results obtained in this paper in Table 1.

Table 1 Summary of main results

2 Corners at level \(k\)

Let \(P_m=P_m(x,t_0,t_1,\ldots )\) be the generating function for the number of partitions of \(n\) where the first part is \(m\) and \(t_k\) marks the number of corners at level \(k\) (\(y=k\), measured downwards with \(y=0\) at the top). Each partition \(\pi \) with first part \(m\) can be written as \(\pi =m\pi '\), where \(\pi '\) is either empty or its largest part is less than or equal to \(m\). Therefore we obtain

$$\begin{aligned} P_m(x,t_0,t_1,\ldots )=&\,x^m\bigg (\frac{t_0^2}{t_1^2}P_m(x,t_1,t_2,\ldots )\\&+\frac{t_0^2}{t_1}\sum _{j=1}^{m-1}P_j(x,t_1,t_2,\ldots )+t_0^2t_1^2\bigg ). \end{aligned}$$

Define \(P(z,x,t_0,t_1,\ldots ):=\sum _{m\ge 1}P_m(x,t_0,t_1,\ldots )z^m\). Multiplying the above equation by \(z^m\) and summing over \(m\ge 1\), we derive the following result.

Proposition 2.1

The generating function \(P(z,x,t_0,t_1,\ldots )\) satisfies the following functional equation:

$$\begin{aligned} P(z,x,t_0,t_1,\ldots )&= \frac{t_0^2}{t_1^2}P(xz,x,t_1,t_2,\ldots )+\frac{t_0^2t_1^2xz}{1-xz}\\&+\frac{t_0^2xz}{t_1(1-xz)}P(xz,x,t_1,t_2,\ldots ). \end{aligned}$$

Now, we are ready to study the total number of corners in a partition. Let \(P(z,x,t):=P(z,x,t,t,\ldots )\). Proposition 2.1 with \(t_j=t\) for all \(j\ge 0\) gives

$$\begin{aligned} P(z,x,t)=P(xz,x,t)+\frac{t^4xz}{1-xz}+\frac{txz}{(1-xz)}P(xz,x,t), \end{aligned}$$

which is equivalent to

$$\begin{aligned} P(z,x,t)=\frac{t^4xz}{1-xz}+\left( 1+\frac{xzt}{1-xz}\right) P(xz,x,t). \end{aligned}$$

By iterating this equation for \(z=1,x,x^2,\ldots \), and solving for \(P(1,x,t)\), we obtain the following result.

Theorem 2.2

The generating function for the number of partitions of \(n\) according to the number of corners counted by \(t\) is given by

$$\begin{aligned} P(1,x,t)=t^4\sum _{j\ge 1}\frac{x^j}{1-x^j}\prod _{i=1}^{j-1}\frac{1-(1-t)x^i}{1-x^i}. \end{aligned}$$

We shall need the lemma below for the work that follows:

Lemma 2.3

For all \(a,b\ge 1\),

$$\begin{aligned} (a) \quad \sum _{j\ge 0}\frac{x^{jb}}{\prod _{i=1}^j(1-x^i)}=\frac{1}{\prod _{i\ge b}\big (1-x^i\big )} \end{aligned}$$

and

$$\begin{aligned} (b) \quad \sum _{j\ge 0}x^{jb}\prod _{i=j+1}^{j+a}\big (1-x^i\big )=\frac{\prod _{i=1}^{a}\big (1-x^i\big )}{\prod _{i=b}^{b+a}\big (1-x^i\big )}. \end{aligned}$$

Proof

(a) We have

$$\begin{aligned} f(b):&=\sum _{j\ge 0}\frac{x^{jb}}{\prod _{i=1}^j\big (1-x^i\big )}=1+\sum _{j\ge 0}\frac{x^{(j+1)b}}{\prod _{i=1}^{j+1}\big (1-x^i\big )}\\&=1+\sum _{j\ge 0}\frac{x^{(j+1)b}-x^{(j+1)b+j+1}+x^{(j+1)b+j+1}}{\prod _{i=1}^{j+1}\big (1-x^i\big )}\\&=1+\sum _{j\ge 0}\frac{x^{(j+1)b}}{\prod _{i=1}^{j}\big (1-x^i\big )}+\sum _{j\ge 1}\frac{x^{j(b+1)}}{\prod _{i=1}^j\big (1-x^i\big )}=x^bf(b)+f(b+1), \end{aligned}$$

which implies that \(f(b)=\frac{1}{1-x^b}f(b+1)\). We use the fact that \(f(1)=\frac{1}{\prod _{i\ge 1}(1-x^i)}\) to complete the proof of the first identity.

(b) Next we prove the second identity using induction on \(a\). For \(a=1\), we have

$$\begin{aligned} \sum _{j\ge 0}x^{jb}\prod _{i=j+1}^{j+1}\big (1-x^i\big )=\frac{1-x}{\big (1-x^b\big )\big (1-x^{b+1}\big )}. \end{aligned}$$

Now, assume that the claim holds for all \(1,2,\ldots ,a\), and let us prove it for \(a+1\). Firstly, we have

$$\begin{aligned} g(a,b):&=\sum _{j\ge 0}x^{jb}\prod _{i=j+1}^{j+a}(1-x^i)\\&=\sum _{j\ge 0}\Big (x^{jb}-x^{jb+j+a+1}+x^{jb+j+a+1}\Big )\prod _{i=j+1}^{j+a}\big (1-x^i\big )\\&=\sum _{j\ge 0}x^{jb}\prod _{i=j+1}^{j+a+1}(1-x^i)+x^{a+1}\sum _{j\ge 0}x^{j(b+1)}\prod _{i=j+1}^{j+a}(1-x^i)\\&=g(a+1,b)+x^{a+1}g(a,b+1). \end{aligned}$$

Thus, by the induction hypothesis, we have

$$\begin{aligned} g(a+1,b)&=\frac{\prod _{i=1}^{a}\big (1-x^i\big )}{\prod _{i=b}^{b+a}\big (1-x^i\big )}-x^{a+1}\frac{\prod _{i=1}^{a}\big (1-x^i\big )}{\prod _{i=b+1}^{b+a+1}\big (1-x^i\big )}\\&=\frac{\prod _{i=1}^{a+1}\big (1-x^i\big )}{\prod _{i=b}^{b+a+1}\big (1-x^i\big )}\left( \frac{1-x^{a+b+1}}{1-x^{a+1}}-\frac{x^{a+1}(1-x^b)}{1-x^{a+1}}\right) \\&=\frac{\prod _{i=1}^{a+1}\big (1-x^i\big )}{\prod _{i=b}^{b+a+1}\big (1-x^i\big )}, \end{aligned}$$

which completes the induction. \(\square \)

We now find the derivative of the generating function \(t^{-4}P(1,x,t)\) with respect to \(t\) and thereafter substitute \(t=1\):

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}t}(t^{-4}P(1,x,t)){\Big |}_{t=1}=&\,\sum _{j \ge 1} \frac{x^j}{1-x^j}\sum _{i=1}^{j-1}\frac{x^i}{\prod _{m=1}^{j-1}\big (1-x^m\big )}\\ =&\,\frac{x}{1-x}\sum _{j\ge 0}\frac{x^j}{\prod _{m=1}^{j-1}\big (1-x^m\big )}\\&\,-\frac{1}{1-x}\sum _{j \ge 0} \frac{x^{2j}}{\prod _{m=1}^{j-1}\big (1-x^m\big )}-1\quad \hbox {by Lemma } 2.3\\ =&\,\frac{x}{1-x}\frac{1}{\prod _{i \ge 1}\big (1-x^i\big )}-\frac{1}{1-x}\frac{1}{\prod _{i \ge 2}\big (1-x^i\big )}-1\\ =&-1+\frac{2x-1}{(1-x)\prod _{j\ge 1}(1-x^j)}. \end{aligned}$$

Theorem 2.4

Thus, the generating function for the total number of corners is

$$\begin{aligned} -3+\dfrac{3-2x}{(1-x)\displaystyle \prod _{j \ge 1}\left( 1-x^j\right) }. \end{aligned}$$

This implies that the total number of corners in all partitions of \(n\) is given by

$$\begin{aligned} 3P(n)+\sum _{j=1}^nP(n-j). \end{aligned}$$

Remark 2.5

For any given partition \(\pi \), the total number of corners is equal to the number of distinct part sizes in \(\pi \) plus 3. Distinct part sizes in partitions have previously been studied in [7, 10].

By using Theorem 2.2 and the \(q\)-binomial theorem, we obtain

Theorem 2.6

The generating function for the number of partitions with exactly \(m+4\) corners is given by

$$\begin{aligned} \sum _{j\ge 1}\frac{x^j}{\prod _{i=1}^{j}\left( 1-x^i \right) }\sum _{i=0}^{j-1}(-1)^{i-m}x^{\left( {\begin{array}{c}i+1\\ 2\end{array}}\right) }{\Big [}\begin{matrix}j-1\\ i\end{matrix}{\Big ]}_x\left( {\begin{array}{c}i\\ m\end{array}}\right) . \end{aligned}$$

Another application of our general result in Proposition 2.1 is to study the total number of corners at line \(y=2k\) for any \(k\ge 0\). In order to do that, we define

$$\begin{aligned} Q(z,x,t)=P(z,x,t,1,t,1,\ldots ) \quad \mathrm and \quad Q'(z,x,t)=P(z,x,1,t,1,t,\ldots ). \end{aligned}$$

Proposition 2.1 shows

$$\begin{aligned} Q(z,x,t)=\frac{t^2xz}{1-xz}+\frac{t^2}{1-xz}Q'(xz,x,t) \end{aligned}$$

and

$$\begin{aligned} Q'(z,x,t)=\frac{1}{t^2}Q(xz,x,t)+\frac{t^2xz}{1-xz}+\frac{xz}{t(1-xz)}Q(xz,x,t). \end{aligned}$$

Therefore,

$$\begin{aligned} Q(z,x,t)=\frac{t^2xz(1+t^2x-x^2z)}{(1-xz)(1-x^2z)}+\frac{1+(t-1)x^2z}{(1-xz)(1-x^2z)}Q(x^2z,x,t). \end{aligned}$$

Iterating infinitely many times, we obtain

$$\begin{aligned} Q(z,x,t)=t^2xz\sum _{j\ge 0}\left( x^{2j}(1+t^2x-x^{2j+2}z)\frac{\prod _{i=1}^{j}(1+(t-1)x^{2i}z)}{\prod _{i=1}^{2j+2}(1-x^iz)}\right) . \end{aligned}$$

Thus, we may state the following result.

Theorem 2.7

The generating function \(Q(1,x,t)\), where \(t\) marks the number of corners at even levels, is given by

$$\begin{aligned} Q(1,x,t)=&\,t^2x\sum _{j\ge 0}\frac{x^{2j}\prod _{i=1}^{j}\big (1+(t-1)x^{2i}\big )}{\prod _{i=1}^{2j+1}\big (1-x^i\big )}\\&+t^4x^2\sum _{j\ge 0}\frac{x^{2j}\prod _{i=1}^{j}\big (1+(t-1)x^{2i}\big )}{\prod _{i=1}^{2j+2}\big (1-x^i\big )}. \end{aligned}$$

For the total number of such corners, we calculate

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}t}Q(1,x,t){\Big |}_{t=1}=&\,2\sum _{j\ge 0}\frac{x^{2j+1}}{\prod _{i=1}^{2j+1}\big (1-x^i\big )} +x\sum _{j\ge 0}\frac{x^{2j}\sum _{i=1}^{j}x^{2i}}{\prod _{i=1}^{2j+1}\big (1-x^i\big )}\\&+4\sum _{j\ge 0}\frac{x^{2j+2}}{\prod _{i=1}^{2j+2}\big (1-x^i\big )} +x^2\sum _{j\ge 0}\frac{x^{2j}\sum _{i=1}^{j}x^{2i}}{\prod _{i=1}^{2j+2}\big (1-x^i\big )}, \end{aligned}$$

which implies

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}t}Q(1,x,t){\Big |}_{t=1}&=\frac{2-x^2}{1-x^2}\sum _{j\ge 0}\frac{x^{2j+1}}{\prod _{i=1}^{2j+1}\big (1-x^i\big )} +\frac{3-2x^2}{1-x^2}\sum _{j\ge 0}\frac{x^{2j}}{\prod _{i=1}^{2j}\big (1-x^i\big )}-3. \end{aligned}$$
(1)

Note that \(\sum _{j\ge 0}\frac{x^jy^j}{\prod _{i=1}^j\big (1-x^i\big )}=\frac{1}{\prod _{j\ge 1}\big (1-yx^j\big )}\). By splitting the respective sums above into those with the largest part odd (and generating function \(\prod _{j \ge 1}\frac{1}{1-x^j}-\prod _{j \ge 1} \frac{1}{1+x^j}\)), or the largest part even (with generating function \(\prod _{\mathrm{j} \ge 1}\frac{1}{1-x^j}+\prod _{\mathrm{j} \ge 1} \frac{1}{1+x^j}\)), we obtain

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}t}Q(1,x,t)\mid _{t=1}&=\frac{5-3x^2}{2\big (1-x^2\big )\prod _{j\ge 1}\big (1-x^j\big )}+\frac{1}{2\prod _{j\ge 1}\big (1+x^j\big )}-3. \end{aligned}$$
(2)

Using the facts that \(\frac{1}{\prod _{j\ge 0}\big (1-x^j\big )}=\sum _{j\ge 0}P(j)x^j\) and \(\frac{1}{\prod _{j\ge 0}\big (1+x^j\big )}=\sum _{j\ge 0}P'(j)x^j\) (see sequence A081362 in [9]), we find

Theorem 2.8

Let \(n\ge 1\), then the total number of corners at even level \(2k\), where \(k\ge 0\), in all partitions of \(n\) is given by

$$\begin{aligned} \frac{1}{2}(5P(n)+P'(n))+\sum _{j\ge 1}P(n-2j). \end{aligned}$$

3 Corners of type \((a,b)\)

In this section, we study partitions according to the number of corners of type \((a,b)\). Let

$$\begin{aligned} P_{k;a,b}(x):=P_{k;a,b}(x,q) \end{aligned}$$

be the generating function for the number of partitions of \(n\) according to the number of corners of type \((a,b)\) with first part of size \(k\), where \(x\) marks the size of the partition and \(q\) the number of such corners. Then

$$\begin{aligned} P_{k;a,b}(x)=\frac{x^k}{1-x^k}\sum _{j=0}^{k-1}P_{j;a,b}(x)+(q-1)x^{ka}P_{k-b;a,b}(x), \end{aligned}$$

where \(P_{0;a,b}(x):=1\). This is equivalent to

$$\begin{aligned} P_{k;a,b}(x)=x^k\sum _{j=0}^kP_{j;a,b}(x)+(q-1)x^{ka}(1-x^k)P_{k-b;a,b}(x)\delta _{k\ge b}\quad \hbox {for }k \ge 0. \end{aligned}$$

Define \(P_{a,b}(x,y,q):=\sum _{k\ge 0}P_{k;a,b}(x)y^k\). By multiplying the last recurrence by \(y^k\) and summing over \(k\ge 0\), we get the following result.

Theorem 3.1

The generating function \(P_{a,b}(x,y,q)\) satisfies

$$\begin{aligned} P_{a,b}(x,y,q)=&\frac{1}{1-xy}P_{a,b}(x,xy,q)\\&+(q-1)y^bx^{ab}\big (P_{a,b}\big (x,x^ay,q\big )-x^bP_{a,b}\big (x,x^{a+1}y,q\big )\big ). \end{aligned}$$

Now we will find an explicit formula for the generating function \(P_{1,b}(x,y,q)\). To do that we need the following lemma.

Lemma 3.2

Let \(\mathcal {A}_0=\{1\}\) and \(\mathcal {A}_1=\{a_0\}\). For \(n\ge 2\), we define \(\mathcal {A}_n\) to be the set

$$\begin{aligned} \mathcal {A}_{n-1}\cdot a_{n-1}\cup \mathcal {A}_{n-2}\cdot b_{n-2}, \end{aligned}$$

where \(B\cdot x=\{\pi \cdot x\mid \pi \in B\}\). Assume that \(\alpha _i=a_i\alpha _{i+1}+b_i\alpha _{i+2}\) for all \(i\ge 0\). Then

$$\begin{aligned} \alpha _0=\left( \sum _{\pi \in \mathcal {A}_{n+1}} \pi \right) \alpha _{n+1} +\left( \sum _{\pi \in \mathcal {A}_n}\pi \right) b_{n}\alpha _{n+2}, \end{aligned}$$

for all \(n\ge 0\).

Proof

We proceed by induction on \(n\). For \(n=0\), the statement reduces to \(\alpha _0=a_0\alpha _1+b_0\alpha _2\), which holds. Assume that the claim holds for \(n\), and let us prove it for \(n+1\). By the induction hypothesis, we have

$$\begin{aligned} \alpha _0&=\left( \sum _{\pi \in \mathcal {A}_{n+1}} \pi \right) \alpha _{n+1} +\left( \sum _{\pi \in \mathcal {A}_n}\pi \right) b_{n}\alpha _{n+2}\\&=\left( \sum _{\pi \in \mathcal {A}_{n+1}} \pi \right) \big (a_{n+1}\alpha _{n+2}+b_{n+1}\alpha _{n+3}\big )+\left( \sum _{\pi \in \mathcal {A}_n}\pi \right) b_{n}\alpha _{n+2}\\&=\left( \sum _{\pi \in \mathcal {A}_{n+1}} \pi a_{n+1}+\sum _{\pi \in \mathcal {A}_n}\pi b_n\right) \alpha _{n+2}+\left( \sum _{\pi \in \mathcal {A}_{n+1}} \pi \right) b_{n+1}\alpha _{n+3}, \end{aligned}$$

which, by the definition of the sets \(\mathcal {A}_n\), implies

$$\begin{aligned} \alpha _0&=\left( \sum _{\pi \in \mathcal {A}_{n+2}} \pi \right) \alpha _{n+2}+\left( \sum _{\pi \in \mathcal {A}_{n+1}} \pi \right) b_{n+1}\alpha _{n+3}. \end{aligned}$$

This completes the induction step. \(\square \)

Clearly, the set \(\mathcal {A}_n\) in the statement of the above Lemma 3.2 can be described bijectively as all sequences \(\pi _0\pi _1\cdots \pi _s\) such that \(\pi _0=0\), \(\pi _s\in \{n-1,n-2\}\) and \(\pi _j-\pi _{j-1}=1,2\) for all \(j=1,2,\ldots ,s\). We denote all such sequences by \(\mathcal {B}_n\). For each word \(\pi =\pi _0\pi _1\cdots \pi _j\in \mathcal {B}_n\), we define

$$\begin{aligned} J(\pi )&=\{i|\pi _{i+1}-\pi _{i}=2 \text{ with } i=0,1,\ldots ,j-1, \text{ or } \pi _i=\pi _j=n-2\},\\ I(\pi )&=\{i|\pi _{i+1}-\pi _i=1 \text{ with } i=0,1,\ldots ,j-1, \text{ or } \pi _i=\pi _j=n-1\}. \end{aligned}$$

Therefore,

$$\begin{aligned} \sum _{\pi \in \mathcal {A}_{n}} \pi =\sum _{\pi \in \mathcal {B}_{n}} \prod _{i\in J(\pi )}b_{\pi _i}\prod _{i\in I(\pi )}a_{\pi _i}. \end{aligned}$$

By Theorem 3.1 with \(a=1\), the generating function \(P_{a,b}(x,y,q)\) satisfies

$$\begin{aligned} P_{1,b}(x,y,q)=&\left( \frac{1}{1-xy}+(q-1)y^bx^{b}\right) P_{1,b}(x,xy,q)\\&-(q-1)y^bx^{2b}P_{1,b}\big (x,x^2y,q\big ). \end{aligned}$$

Define \(\alpha _i=P_{1,b}\big (x,x^iy,q\big )\), \(a_i=\frac{1}{1-x^{i+1}y}+(q-1)y^bx^{b(i+1)}\) and \(b_i=(1-q)y^bx^{b(i+2)}\); so

$$\begin{aligned} \alpha _i=a_i\alpha _{i+1}+b_i\alpha _{i+2}, \end{aligned}$$

where \(\lim _{j\rightarrow \infty }\alpha _j=1\). Hence, by Lemma 3.2 (note that \(b_i\rightarrow 0\) when \(i\rightarrow \infty \)), we have

$$\begin{aligned} \alpha _0=\sum _{\pi \in \mathcal {B}_\infty } \prod _{i\in J(\pi )}b_{\pi _i}\prod _{i\in I(\pi )}a_{\pi _i}, \end{aligned}$$

where \(\mathcal {B}_\infty =\lim _{n\rightarrow \infty }\mathcal {B}_n\) which is the set of all sequences \(\pi _0\pi _1\pi _2\cdots \) such that \(\pi _0=0\) and \(\pi _{i+1}-\pi _i\) is 1 or 2. So we can state the following result.

Theorem 3.3

The generating function \(P_{1,b}(x,y,q)\) is given by

$$\begin{aligned}&\frac{P_{1,b}(x,y,q)}{\prod _{i\ge 1}\left( \frac{1}{1-x^{i}y}+(q-1)y^bx^{bi}\right) }\\&\quad =\sum _{\pi \in \mathcal {B}_\infty } \frac{(1-q)^{|J(\pi )|}y^{b|J(\pi )|}x^{2b|J(\pi )|+b\sum _{i\in J(\pi )}\pi _i}}{\prod _{i\in J(\pi ),m=1,2}\left( \frac{1}{1-x^{\pi _i+m}y}+(q-1)y^bx^{b(\pi _i+m)}\right) }. \end{aligned}$$

Note that \(J(\pi )=\emptyset \) if and only if \(\pi =0123\cdots \). Thus the above theorem with \(q=1\) becomes

$$\begin{aligned} P_{1,b}(x,y,1)=\prod _{i\ge 1}\frac{1}{1-x^{i}y}, \end{aligned}$$

as is well known.

Also, note that \(|J(\pi )|=1\) if and only if there exists \(i\ge 0\) such that

$$\begin{aligned} \pi =012\cdots i(i+2)(i+3)(i+4)\cdots , \end{aligned}$$

and \(|J(\pi )|=2\) if and only if there exists \(i'>i+1\ge 1\) such that

$$\begin{aligned} \pi =012\cdots i(i+2)(i+3)\cdots i'(i'+2)(i'+3)(i'+4)\cdots . \end{aligned}$$

(Similarly, we can characterize all the infinite sequences with \(J(\pi )=m\)). Then the above theorem shows that

$$\begin{aligned}&\frac{P_{1,b}(x,y,q)}{\prod _{i\ge 1}\left( \frac{1}{1-x^{i}y}+(q-1)y^bx^{bi}\right) }\\&\quad =1+(1-q)y^bx^b\sum _{s\ge 1}\frac{x^{bs}}{\left( \frac{1}{1-x^{s}y}+(q-1)y^bx^{bs}\right) \left( \frac{1}{1-x^{s+1}y}+(q-1)y^bx^{bs+b}\right) }\\&\qquad +\sum _{\pi \in \mathcal {B}_\infty ,\,|J(\pi )|\ge 2} \frac{(1-q)^{|J(\pi )|}y^{b|J(\pi )|}x^{2b|J(\pi )|+b\sum _{i\in J(\pi )}\pi _i}}{\prod _{i\in J(\pi ),m=1,2}\left( \frac{1}{1-x^{\pi _i+m}y}+(q-1)y^bx^{b(\pi _i+m)}\right) }. \end{aligned}$$

Another way to solve the recurrence \(\alpha _i=a_i\alpha _{i+1}+b_i\alpha _{i+2}\) in Lemma 3.2 is by using continued fractions. Note that \(\frac{\alpha _i}{\alpha _{i+1}}=a_i+\frac{b_i}{\frac{\alpha _{i+1}}{\alpha _{i+2}}}\), for all \(i\ge 0\). Therefore,

$$\begin{aligned} \frac{\alpha _i}{\alpha _{i+1}}=a_i+\dfrac{b_i}{a_{i+1}+\dfrac{b_{i+1}}{a_{i+2}+\ddots }}. \end{aligned}$$

So, multiplying over all \(i\ge 0\), assuming that \(\lim _{j\rightarrow \infty }\alpha _j=1\), we obtain

$$\begin{aligned} \alpha _0=\prod _{i\ge 0}\left( a_i+\dfrac{b_i}{a_{i+1}+\dfrac{b_{i+1}}{a_{i+2}+\ddots }}\right) . \end{aligned}$$

Thus, if we define \(\alpha _i=P_{1,b}(x,x^iy,q)\), \(a_i=\frac{1}{1-x^{i+1}y}+(q-1)y^bx^{b(i+1)}\) and \(b_i=(1-q)y^bx^{(2+i)b}\), we have the following result.

Theorem 3.4

The generating function \(P_{1,b}(x,y,q)\) is given by

$$\begin{aligned} \prod _{i\ge 0}\left( \!\frac{1}{1-x^{i+1}y}+(q-1)y^bx^{b(i+1)} \!+\!\frac{(1\!-\!q)y^bx^{(2+i)b}}{\frac{1}{1\!-\!x^{i+2}y}+(q-1)y^bx^{b(i+2)} \!+\!\frac{(1-q)y^bx^{(3+i)b}}{\frac{1}{1-x^{i+3}y}+(q-1)y^bx^{b(i+3)}+\ddots }}\!\right) \!. \end{aligned}$$

Note that by comparing Theorems 3.3 and 3.4, we get the following corollary.

Corollary 3.5

We have

$$\begin{aligned} P_{1,b}(x,y,q)=&\prod _{i\ge 1}\left( \frac{1}{1-x^{i}y}+(q-1)y^bx^{bi}\right) \\&\times \sum _{\pi \in \mathcal {B}_\infty } \frac{(1-q)^{|J(\pi )|}y^{b|J(\pi )|}x^{2b|J(\pi )|+b\sum _{i\in J(\pi )}\pi _i}}{\prod _{i\in J(\pi ),m=1,2}\left( \frac{1}{1-x^{\pi _i+m}y}+(q-1)y^bx^{b(\pi _i+m)}\right) }\\ =&\prod _{i\ge 0}\left( \frac{1}{1-x^{i+1}y}+(q-1)y^bx^{b(i+1)}\right. \\&\qquad \left. +\frac{(1-q)y^bx^{(2+i)b}}{\frac{1}{1-x^{i+2}y}+(q-1)y^bx^{b(i+2)} +\frac{(1-q)y^bx^{(3+i)b}}{\frac{1}{1-x^{i+3}y}+(q-1)y^bx^{b(i+3)}+\ddots }}\right) . \end{aligned}$$

3.1 Total number of corners of type \((a,b)\)

Using Theorem 3.1, we find the generating function for the total number of corners of type \((a,b)\) to be

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,y,q){\Big |}_{q=1}=&\frac{1}{1-xy}\frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,xy,q){\Big |}_{q=1}\\&+y^bx^{ab}\big (P_{a,b}\big (x,x^ay,1\big )-x^bP_{a,b}\big (x,x^{a+1}y,1\big )\big ). \end{aligned}$$

Using \(P_{a,b}(x,y,1)=\frac{1}{\prod _{j\ge 1}(1-x^jy)}\), this is equivalent to

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,y,q){\Big |}_{q=1}=\frac{1}{1-xy}\frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,xy,q){\Big |}_{q=1}+y^bx^{ab}\frac{1-x^b+x^{a+b+1}y}{\prod _{j\ge a+1}\big (1-x^jy\big )}. \end{aligned}$$

By iterating this an infinite number of times, and noting that \(\frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,x^s,q){\Big |}_{q=1} \rightarrow 0\) as \(s \rightarrow \infty \), we have

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,1,q){\Big |}_{q=1}&=\sum _{j\ge a}\frac{x^{jb}}{\prod _{i=1}^{j-a}\big (1-x^i\big )}\frac{1-x^b+x^{j+b+1}}{\prod _{i\ge j+1}\big (1-x^i\big )} \nonumber \\&=\frac{x^{ab}}{\prod _{i\ge 1}\big (1-x^i\big )}\sum _{j\ge 0}x^{jb}\big (1-x^b+x^{j+a+b+1}\big )\prod _{i=j+1}^{j+a}\big (1-x^i\big ). \end{aligned}$$
(3)

Thus, by Lemma 2.3 and Eq. (3),

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,y,q){\Big |}_{q=1}\!=\! \frac{x^{ab}\big (1\!-\!x^b\big )}{\prod _{i\ge 1}\big (1\!-\!x^i\big )}\left( \frac{\prod _{i=1}^{a} \big (1\!-\!x^i\big )}{\prod _{i=b}^{b+a}\big (1\!-\!x^i\big )} \!+\!x^{a+b+1}\frac{\prod _{i=1}^{a}\big (1\!-\!x^i\big )}{\prod _{i=b}^{b+a+1}\big (1-x^i\big )}\!\right) \!. \end{aligned}$$

This is captured in the following theorem.

Theorem 3.6

The generating function for the total number of corners of type \((a,b)\) in all partitions is given by

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,1,q){\Big |}_{q=1}=\frac{x^{ab}\prod _{i=1}^{a}\big (1-x^i\big )}{\prod _{i\ge 1}\big (1-x^i\big )\prod _{i=b+1}^{b+a+1}\big (1-x^i\big )}. \end{aligned}$$

Example 3.7

Theorem 3.6 for \(b=1\) leads to

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a,1}(x,1,q){\Big |}_{q=1}&=\frac{x^a(1-x)}{\big (1-x^{a+1}\big )\big (1-x^{a+2}\big )\prod _{i\ge 1}\big (1-x^i\big )}\\&=\frac{1}{x}\left( \frac{1}{1-x^{a+1}}-\frac{1}{1-x^{a+2}}\right) \frac{1}{\prod _{i\ge 1}\big (1-x^i\big )}, \end{aligned}$$

which implies that the total number of corners of type \((a,1)\) in all partitions of \(n\) is given by

$$\begin{aligned} \sum _{j\ge 0}(P(n+1-j(a+1))-P(n+1-j(a+2))). \end{aligned}$$

Let \(\mathcal {P}_n\) denote the set of all partitions of size \(n\). There is a simple correspondence between the total number of corners of type \((a,b)\) in \(\mathcal {P}_n\) and the number of parts \(\ge b\) of multiplicity \(a+1\) in \(\mathcal {P}_{n+b}\). We illustrate the bijection in Fig. 2.

Fig. 2
figure 2

Bijection between number of \((a,b)\) corners in \(\mathcal {P}_{n}\) and parts of multiplicity \(a+1\) in \(\mathcal {P}_{n+b}\)

Note, however, that the distributions of corners of type \((a,b)\) and of parts of multiplicity \(a+1\) are quite different. For example, for the case where \(a=1\), the generating function for partitions with no parts of multiplicity \(2\) is \(\prod _{i=1}^\infty (\frac{1}{1-x^i}-x^{2i})\), whereas by setting \(q=0\) in Theorem 3.4, the generating function for partitions with no corner of type \((1,b)\) is

$$\begin{aligned}&P_{1,b}(x,y,0)\\&\quad =\prod _{i\ge 0}\left( \frac{1}{1-x^{i+1}y}-y^bx^{b(i+1)}+\frac{y^bx^{(2+i)b}}{\frac{1}{1-x^{i+2}y}-y^bx^{b(i+2)} +\frac{y^bx^{(3+i)b}}{\frac{1}{1-x^{i+3}y}-y^bx^{b(i+3)}+\ddots }}\right) . \end{aligned}$$

4 Corners of type \((a+,b)\)

We define a corner of type \((a+,b)\) to be a corner of type \((j,b)\) for any \(j \ge a\). Let

$$\begin{aligned} P_{k;a+,b}(x):=P_{k;a+,b}(x,q) \end{aligned}$$

be the generating function for the number of partitions according to the number of corners of type \((a+,b)\) with first part \(k\). Then for \(k\ge b\),

$$\begin{aligned} P_{k;a+,b}(x)&= \big (x^k+x^{2k}+\cdots +x^{k(a-1)}\big )\sum _{j=0}^{k-1}P_{j;a+,b}(x)\\&+\frac{x^{ka}}{1-x^k}\left( (q-1)P_{k-b;a+,b}(x)+\sum _{j=0}^{k-1}P_{j;a+,b}(x)\right) \end{aligned}$$

with \(P_{k;a+,b}(x)=\frac{x^k}{(1-x)(1-x^2)\cdots (1-x^k)}\) for \(k=0,1,\ldots ,b-1\). Thus,

$$\begin{aligned} P_{k;a+,b}(x)=x^k\sum _{j=0}^{k}P_{j;a+,b}(x)+x^{ka}(q-1)P_{k-b;a+,b}(x)\delta _{k\ge b}. \end{aligned}$$

Define \(P_{a+,b}(x,y,q):=\sum _{k\ge 0}P_{k;a+,b}(x,q)y^k\). By multiplying the last recurrence by \(y^k\) and summing over \(k\ge 0\), we get

$$\begin{aligned} P_{a+,b}(x,y,q)=\frac{1}{1-xy}P_{a+,b}(x,xy,q)+(q-1)x^{ab}y^bP_{a+,b}(x,x^ay,q). \end{aligned}$$
(4)

We solve the recursion in the case where \(a=1\).

Theorem 4.1

The generating function \(P_{1+,b}(x,y,q)\) is given by

$$\begin{aligned} P_{1+,b}(x,y,q)=\prod _{i\ge 1}\left( \frac{1}{1-x^iy}+(q-1)(x^iy)^b\right) . \end{aligned}$$

Moreover, the generating function for the number of partitions without corners of types \((1+,b)\) is given by

$$\begin{aligned} P_{1+,b}(x,1,0)=\prod _{i\ge 1}\left( \frac{1}{1-x^i}-x^{ib}\right) . \end{aligned}$$

Proof

By (4) with \(a=1\), we have

$$\begin{aligned} P_{1+,b}(x,y,q)=\left( \frac{1}{1-xy}+(q-1)(xy)^b\right) P_{1+,b}(x,xy,q), \end{aligned}$$

which, by repeated iteration and using \(\lim _{i\rightarrow \infty }P_{1+,b}(x,x^iy,q)=1\), implies

$$\begin{aligned} P_{1+,b}(x,y,q)=\prod _{i\ge 1}\left( \frac{1}{1-x^iy}+(q-1)(x^iy)^b\right) , \end{aligned}$$

as required. \(\square \)

4.1 Total number of corners of type \((a+,b)\)

Differentiating Eq. (4) with respect to \(q\), then substituting \(q=1\) and using \(P_{a+,b}(x,y,1)=\frac{1}{\prod _{j\ge 1}(1-x^jy)}\), we obtain

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b}(x,y,q){\Big |}_{q=1}=\frac{1}{1-xy}\frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b}(x,xy,q){\Big |}_{q=1}+x^{ab}y^bP_{a+,b}(x,x^ay,1). \end{aligned}$$

This implies

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b}(x,y,q){\Big |}_{q=1}=\frac{x^{ab}y^b}{\prod _{j\ge a+1}(1-x^jy)}+\frac{1}{1-xy}\frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b}(x,xy,q){\Big |}_{q=1}. \end{aligned}$$

Iterating infinitely many times, we obtain

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b}(x,y,q){\Big |}_{q=1}=\sum _{j\ge 0}\frac{x^{(a+j)b}y^b}{\prod _{i=1}^j\big (1-x^iy\big )\prod _{i\ge a+1+j}\big (1-x^iy\big )}. \end{aligned}$$

By Lemma 2.3, this leads to the following result.

Theorem 4.2

The generating function for the total number of corners of type \((a+,b)\) in all partitions of \(n\) is given by

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b}(x,1,q){\Big |}_{q=1}=\frac{x^{ab}\prod _{i=1}^a\big (1-x^i\big )}{\prod _{i\ge 1}\big (1-x^i\big )\prod _{i=b}^{a+b}\big (1-x^i\big )}. \end{aligned}$$

Example 4.3

Theorem 4.2 for \(a=1\) shows that

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{1+,b}(x,1,q){\Big |}_{q=1}=\frac{1}{\prod _{i\ge 1}\big (1-x^i\big )}\left( \frac{1}{1-x^b}-\frac{1}{1-x^{b+1}}\right) . \end{aligned}$$

Thus, the total number of corners of type \((1+,b)\) in all the partitions of \(n\) is given by

$$\begin{aligned} \sum _{j\ge 1}(P(n-bj)-P(n-(b+1)j)). \end{aligned}$$

We note that a simple bijection between a Ferrers diagram and its transpose implies that the above results also count corners of type \((a,b+)\).

We also note that the number of corners of type \((a+,b)\) in the partitions of \(n\) equals the number \(\ge b\) of parts of size \(a+1\) in the partitions of \(n+b\). We illustrate the bijection in Fig. 3.

Fig. 3
figure 3

Bijection between number of \((a+,b)\) corners in \(\mathcal {P}_n\) and parts in \(\mathcal {P}_{n+b}\)

First, we add \(b\) cells to the first part of size \(j-b\) and then conjugate the \(a+1\) parts of size \(j\); thereafter we rearrange all parts (in the right-hand side drawing in Fig. 3) in descending order.

Example 4.4

For \(a=2\), the corners of type \((2+,1)\) in the partition \(2211\) maps to the two different partitions: \(322\) and \(331\). Also, the corner of type \((2+,1)\) in the partition \(111111\) (resp. \(21111\), \(3111\), \(411\)) maps to the partition \(31111\) (resp. \(3211\), \(331\), \(43\)).

5 Corners of type \((a+,b+)\)

Let \(P_{k;a+,b+}(x):=P_{k;a+,b+}(x,q)\) be the generating function for the number of partitions of \(n\) according to the number of corners of type \((a+,b+)\) with first part \(k\). Then for \(k\ge b\),

$$\begin{aligned} P_{k;a+,b+}(x)&= \Big (x^k+x^{2k}+\cdots +x^{k(a-1)}\Big )\sum _{j=0}^{k-1}P_{j;a+,b+}(x)\\&+\frac{x^{ka}}{1-x^k}\left( q\sum _{j=0}^{k-b}P_{j;a+,b+}(x)+\sum _{j=k-b+1}^{k-1}P_{j;a+,b+}(x)\right) \end{aligned}$$

with \(P_{k;a+,b+}(x)=\frac{x^k}{(1-x)(1-x^2)\cdots (1-x^k)}\) for \(k=0,1,\ldots ,b-1\). Thus,

$$\begin{aligned} P_{k;a+,b+}(x)=x^k\sum _{j=0}^{k}P_{j;a+,b+}(x)+(q-1)x^{ka}\sum _{j=0}^{k-b}P_{j;a+,b+}(x). \end{aligned}$$

Define \(P_{a+,b+}(x,y,q):=\sum _{k\ge 0}P_{k;a+,b+}(x,q)y^k\). Multiplying the last recurrence by \(y^k\) and summing over \(k\ge 0\), we get

$$\begin{aligned} P_{a+,b+}(x,y,q)=\frac{1}{1-xy}P_{a+,b+}(x,xy,q)+\frac{(q-1)x^{ab}y^b}{1-x^ay}P_{a+,b+}(x,x^ay,q). \end{aligned}$$
(5)

For \(a=1\), we obtain the following result.

Theorem 5.1

The generating function \(P_{1+,b+}(x,y,q)\) is

$$\begin{aligned} P_{1+,b+}(x,y,q)=\prod _{i\ge 1}\frac{1+(q-1)\big (x^iy\big )^b}{1-x^iy}. \end{aligned}$$

Note that \(P_{a+,b+}(x,y,1)=\frac{1}{\prod _{j\ge 1}(1-x^jy)}\). By differentiating Eq. (5) with respect to \(q\) and then substituting \(q=1\), we obtain

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b+}(x,y,q){\Big |}_{q=1}=&\frac{1}{1-xy}\frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b+}(x,xy,q){\Big |}_{q=1}\\&+\frac{x^{ab}y^b}{1-x^ay}P_{a+,b+}(x,x^ay,1), \end{aligned}$$

which implies

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b+}(x,y,q){\Big |}_{q=1}=\frac{1}{1-xy}\frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b+}(x,xy,q){\Big |}_{q=1}+\frac{x^{ab}y^b}{\prod _{j\ge a}\big (1-x^jy\big )}. \end{aligned}$$

Iterating infinitely many times, we obtain

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b+}(x,y,q){\Big |}_{q=1}=\sum _{j\ge 0}\frac{x^{(a+j)b}y^b}{\prod _{i\ge a+j}\big (1-x^iy\big )\prod _{i=1}^{j}\big (1-x^iy\big )}. \end{aligned}$$

By Lemma 2.3b, this implies the following result.

Theorem 5.2

The generating function for the total number of corners of type \((a+,b+)\) in all partitions is given by

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{a+,b+}(x,1,q){\Big |}_{q=1}=\frac{x^{ab}\prod _{i=1}^{a-1}\big (1-x^i\big )}{\prod _{i\ge 1}(1-x^i)\prod _{i=b}^{a+b-1}\big (1-x^i\big )}. \end{aligned}$$

Example 5.3

Theorem 5.2 for \(a=1\) shows that

$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}q}P_{1+,b+}(x,1,q){\Big |}_{q=1}=\frac{x^b}{(1-x^b)\prod _{i\ge 1}\big (1-x^i\big )}. \end{aligned}$$

Thus, the total number of corners of type \((1+,b+)\) in all partitions of \(n\) is given by

$$\begin{aligned} \sum _{j\ge 1}P(n-bj). \end{aligned}$$

6 Corners of size \(m\)

We shall define the size of a corner of type \((a,b)\) to be \(m\) when \(m=a+b\). In this section, we find the generating function that counts the total number of corners of size \(m\) in partitions of \(n\). For a corner of size \(m\), where \(m\) is fixed, there are \(p\) parts of size \(k\) followed by a part of size \(k+p-m\), for \(1 \le p \le m-1\). We denote the generating function by \(P_{k,m}(x):=P_{k,m}(x,q)\), where \(q\) marks such corners, as illustrated in Fig. 4.

Fig. 4
figure 4

Corner of size \(m\)

Clearly, the generating function satisfies the following equation:

$$\begin{aligned} P_{k,m}=\frac{x^k}{1-x^k}\sum _{j=0}^{k-1}P_{j,m}+(q-1)\sum _{p=1}^{m-1}x^{kp}P_{k+p-m,m}. \end{aligned}$$

Multiplying by \((1-x^k)\) and simplifying,

$$\begin{aligned} P_{k,m}=x^k\sum _{j=0}^{k}P_{j,m}+(q-1)(1-x^k)\sum _{p=1}^{m-1}x^{kp}P_{k+p-m,m}. \end{aligned}$$
(6)

We now define \(P_{m}(x,y,q):=\sum _{k \ge 0}P_{k,m}(x,y,q)y^k\). Thus after multiplying (6) by \(y^k\), summing over all \(k\) and interchanging the order of summation, we have

$$\begin{aligned} P_{m}(x,y,q) =&\sum _{j=0}^\infty P_{j,m}\frac{(xy)^j}{1-xy}+(q-1) \sum _{p=1}^{m-1}\big (x^py\big )^{m-p}\sum _{r \ge 0}\big (x^py\big )^{r-p+m}P_{r,m} \nonumber \\&-(q-1)\sum _{p=1}^{m-1}\sum _{r\ge 0} \big (x^{1+p}y\big )^{r-p+m} \, P_{r,m}\qquad (\mathrm where r=k+p-m) \nonumber \\ =&\frac{P_m(x,xy,q)}{1-xy}+(q-1)\sum _{p=1}^{m-1}P_m\big (x,x^py,q\big )\big (x^py\big )^{m-p}\nonumber \\&-(q-1)\sum _{p=1}^{m-1}P_m\big (x,x^{p+1}y,q\big )\big (x^{p+1}y\big )^{m-p}. \end{aligned}$$
(7)

Following the previous procedure for finding the total number of corners, we compute

$$\begin{aligned} \frac{{\mathrm{d}}P_m(x,y,q)}{{\mathrm{d}}q}{\Big |}_{q=1}=\,&\frac{1}{1-xy}\frac{{\mathrm{d}}P_m(x,xy,q)}{{\mathrm{d}}q}{\Big |}_{q=1}+\sum _{p=1}^{m-1}P_m\big (x,x^py,1\big )\big (x^py\big )^{m-p}\nonumber \\&-\sum _{p=1}^{m-1}P_m\big (x,x^{p+1}y,1\big )\big (x^{p+1}y\big )^{m-p}. \end{aligned}$$
(8)

The generating function for all partitions is \(P_m(x,y,1)=\frac{1}{\prod _{j\ge 1}(1-x^jy)}\). Therefore

$$\begin{aligned} \frac{{\mathrm{d}}P_m(x,y,q)}{{\mathrm{d}}q}{\Big |}_{q=1} =\,&\frac{1}{1-xy}\frac{{\mathrm{d}}P_m(x,xy,q)}{{\mathrm{d}}q}{\Big |}_{q=1}\nonumber \\&+\sum _{p=1}^{m-1}\frac{1-x^{m-p}\big (1-x^{1+p}yv)}{\prod _{j \ge 1}\big (1-x^{j+p}y\big )}\,\big (x^py\big )^{m-p}. \end{aligned}$$
(9)

After infinitely many iterations and noticing that \(\frac{{\mathrm{d}} P_m(x,x^s,q)}{{\mathrm{d}}q} \rightarrow 0\) as \(s \rightarrow \infty \), we obtain our result

Theorem 6.1

The generating function for the total number of corners of size \(m\) is

$$\begin{aligned} \frac{{\mathrm{d}}P_m(x,1,q)}{{\mathrm{d}}q}{\Big |}_{q=1}&=\sum _{i=0}^\infty \frac{1}{\prod _{l=1}^i \big (1-x^l\big )}\sum _{p=1}^{m-1} \frac{\big (x^{p+i}\big )^{m-p}\big (1-x^{m-p}+x^{m+1+i}\big )}{\prod _{j \ge 1} \big (1-x^{p+i+j}\big )}\end{aligned}$$
(10)
$$\begin{aligned}&=\frac{1}{\prod _{l=1}^\infty \big (1-x^l\big )}\sum _{p=1}^{m-1}\frac{x^{p(m-p)}\prod _{i=1}^p \big (1-x^i\big )}{\prod _{i=m-p+1}^{m+1} \big (1-x^i\big )}. \end{aligned}$$
(11)

Here, Eq. (11) follows from Eq. (10) by using Lemma 2.3.

7 Asymptotics

To find asymptotic estimates for the various types of corners studied above, we need to study generating functions of the form \(P(x)F(x)\), where \(P(x)\) is the generating function for the number of partitions. In the paper [6], the authors show how such asymptotic expansions can be obtained in a quasi-automatic way from expansions of \(F(x)\) around \(x = 1\). For the convenience of the reader, we state the relevant results from [6] that we need:

Theorem 7.1

Suppose that the function \(F(z)\) satisfies

$$\begin{aligned} |F(z)| =\mathcal {O}( e^{C/(1-|z|)^{\eta }}) \text { as } |z| \rightarrow 1 \text { for some } C > 0 \text { and } \eta < 1, \end{aligned}$$
(12)

and \(F(e^{-t}) = a t^b + \mathcal {O}(f(|t|))\) as \(t \rightarrow 0\), \(\mathfrak {R}t > 0\), for real numbers \(a,b\). Then one has

$$\begin{aligned} \frac{1}{p(n)} [x^n] P(x)F(x) =&\, a \left( \frac{2\pi }{\sqrt{24n-1}} \right) ^b \times \frac{I_{|b+3/2|}\left( \sqrt{\frac{2\pi ^2}{3} \left( n - \frac{1}{24} \right) } \right) }{I_{3/2}\left( \sqrt{\frac{2\pi ^2}{3} \left( n - \frac{1}{24} \right) } \right) } \\&+ \mathcal {O}\left( \exp \left( -n^{1/2-\epsilon }\right) + f\left( \frac{\pi }{\sqrt{6n}} + \mathcal {O}\left( n^{-1/2-\epsilon }\right) \right) \right) \end{aligned}$$

as \(n \rightarrow \infty \) for any \(0 < \epsilon < \frac{1 - \eta }{2}\), where \(I_{\nu }\) denotes a modified Bessel function of the first kind.

It is also shown in [6] that the quotient of modified Bessel functions simplifies, with \(h = |b+3/2|-1/2\) and \(m = \sqrt{\frac{2\pi ^2}{3} \left( n - \frac{1}{24} \right) }\), to

$$\begin{aligned} \frac{I_{|b+3/2|}\left( \sqrt{\frac{2\pi ^2}{3} \left( n - \frac{1}{24} \right) } \right) }{I_{3/2}\left( \sqrt{\frac{2\pi ^2}{3} \left( n - \frac{1}{24} \right) } \right) } = \frac{m}{m-1} \times \sum _{j=0}^h \frac{(h+j)!}{j!(h-j)!} \left( - \frac{1}{2m} \right) ^j + \mathcal {O}(e^{-2m}).\nonumber \\ \end{aligned}$$
(13)

In our applications, we apply (13) together with Theorem 7.1. Thereafter, we use computer algebra to obtain asymptotic formulae in terms of powers of \(n\).

Firstly, in the case of the total number of corners of type \((a,b)\), we have \(\frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,y,q){\Big |}_{q=1}=P(x)F_{a,b}(x)\), where

$$\begin{aligned} F_{a,b}(x)=\frac{x^{ab}\prod _{i=1}^{a}(1-x^i)}{\prod _{i=b+1}^{b+a+1}(1-x^i)}. \end{aligned}$$

To apply Theorem 7.1, we need to consider the Taylor expansion of \(F_{a,b}(e^{-t})\):

$$\begin{aligned} F_{a,b}(e^{-t})&=\frac{e^{-t a b}\prod _{i=1}^{a}(1-e^{-it})}{\prod _{i=1}^{a+1}(1-e^{(i+b)t})} \nonumber \\&=\frac{1-abt}{t}\frac{\prod _{i=1}^{a}(i-i^2t/2)}{\prod _{i=1}^{a+1}((i+b)-(i+b)^2 t/2)}+\mathcal {O}(t). \end{aligned}$$
(14)

Now

$$\begin{aligned} \prod _{i=1}^{a}(i-i^2t/2)=a!(1-ta(a+1)/4)+\mathcal {O}(t^2) \end{aligned}$$
(15)

and

$$\begin{aligned} \prod _{i=1}^{a+1}((i\!+\!b)\!-\!(i+b)^2 t/2)\!=\!\frac{(a+b+1)!}{b!}(1-t(a+1)(2b+a+2)/4)+\mathcal {O}(t^2).\nonumber \\ \end{aligned}$$
(16)

Substituting these into (14) gives

$$\begin{aligned} F_{a,b}(e^{-t})=\frac{a!b!}{(a+b+1)!}\left( \frac{1}{t}-\frac{ab-a-b-1}{2} \right) +\mathcal {O}(t). \end{aligned}$$
(17)

Using this in Theorem 7.1 leads to

Theorem 7.2

The average number of corners of type \((a,b)\) in a random partition of \(n\) is

$$\begin{aligned} \frac{ a! b!\sqrt{6n}}{\pi (a+b+1)!}-\frac{a! b! \left( \pi ^2 a b-\pi ^2 a-\pi ^2 b-\pi ^2-6\right) }{2 \pi ^2 (a+b+1)!} + \mathcal {O}(n^{-1/2}). \end{aligned}$$

In the case of the total number of corners of type \((a+,b)\), we have \(\frac{\mathrm{d}}{\mathrm{d}q}P_{a,b}(x,y,q){\Big |}_{q=1}=P(x)F_{a,b}(x)\), where

$$\begin{aligned} F_{a,b}(x)=\frac{x^{ab}\prod _{i=1}^{a}(1-x^i)}{\prod _{i=b}^{b+a}(1-x^i)}. \end{aligned}$$

From this we find

$$\begin{aligned} F_{a,b}(e^{-t})=\frac{a!(b-1)!}{(a+b)!}\left( \frac{1}{t}-\frac{b(a-2)}{2} \right) +\mathcal {O}(t). \end{aligned}$$
(18)

Using this in Theorem 7.1 leads to

Theorem 7.3

The average number of corners of type \((a+,b)\) in a random partition of \(n\) is

$$\begin{aligned} \frac{ a! (b-1)!\sqrt{6n}}{\pi (a+b)!}-\frac{a! (b-1)! \left( \pi ^2 a b-2 \pi ^2 b-6\right) }{2 \pi ^2 (a+b)!} + \mathcal {O}(n^{-1/2}). \end{aligned}$$

Next for the total number of corners of type \((a+,b+)\), we have

$$\begin{aligned} F_{a,b}(x)=\frac{x^{ab}\prod _{i=1}^{a-1}(1-x^i)}{\prod _{i=b}^{b+a-1}(1-x^i)}. \end{aligned}$$

This yields

$$\begin{aligned} F_{a,b}(e^{-t})=\frac{(a-1)!(b-1)!}{(a+b-1)!}\left( \frac{1}{t}-\frac{ab}{2} \right) +\mathcal {O}(t). \end{aligned}$$
(19)

Using this in Theorem 7.1 leads to

Theorem 7.4

The average number of corners of type \((a+,b+)\) in a random partition of \(n\) is

$$\begin{aligned} \frac{ (a-1)! (b-1)! \sqrt{6n}}{\pi (a+b-1)!}-\frac{(a-1)! (b-1)! \left( \pi ^2 a b-6\right) }{2 \pi ^2 (a+b-1)!} + \mathcal {O}(n^{-1/2}). \end{aligned}$$

For the total number of corners treated in Theorem 2.4, we use \(F(x)=\frac{2x-1}{1-x}+4\) in Theorem 7.1 to obtain

Theorem 7.5

The average number of corners in a random partition of \(n\) is

$$\begin{aligned} \frac{\sqrt{6n}}{\pi } + \frac{6+5\pi ^2}{2\pi ^2} + \mathcal {O}(n^{-1/2}). \end{aligned}$$

For the total number of corners at even level, the contribution of \(\frac{1}{2\prod _{j\ge 1}(1+x^j)}\) to (2) is asymptotically negligible; therefore, we may take \(F(x)=\frac{5-3x^2}{2(1-x^2)}\) in Theorem 7.1 to obtain

Theorem 7.6

The average number of corners at even level in a random partition of \(n\) is

$$\begin{aligned} \frac{ \sqrt{6n}}{2\pi }+\frac{3}{2 \pi ^2}+2 + \mathcal {O}(n^{-1/2}). \end{aligned}$$

Finally, for the total number of corners of size \(m\) we take

$$\begin{aligned} F(x)&=\sum _{a=1}^{m-1}\frac{x^{a(m-a)}\prod _{i=1}^a (1-x^i)}{\prod _{i=m-a+1}^{m+1} (1-x^i)}, \end{aligned}$$

in Theorem 7.1, with the aid of the expansions (17) applied to cases \((a,m-a)\) with \(1\le a\le m-1\), to obtain

Theorem 7.7

The average number of corners of size \(m\) in a random partition of \(n\) is

$$\begin{aligned} \frac{1}{m+1}\sum _{a=1}^{m-1} {\left( {\begin{array}{c}m\\ a\end{array}}\right) }^{-1}\left( \frac{\sqrt{6 n} }{\pi }+\frac{\pi ^2 \left( a^2-a m+m+1\right) +6}{2 \pi ^2}\right) + \mathcal {O}(n^{-1/2}). \end{aligned}$$