1 Introduction

The sandpile group is originated from the Abelian Sandpile Model in statistical physics [5]. In fact, the sandpile group pops up in many different fields under different names, such as the critical group in the chip-firing game [2,3,4], the Picard group or the Jacobian group in the divisor theory of graphs [1], the group of components on arithmetical graphs [8], etc.

In [7], Lorenzini studied the structure of the sandpile group of a complete graph with edges of two disjoint paths \(P_a\) and \(P_b\) deleted. He showed that if \(a+b=n-1\) and \(gcd(a,b)=1\), then \(S(K_n-P_a-P_b)\) is cyclic, and at the same time, he suggested that the sandpile groups of \(K_n-C_{n-1}\) and \(K_n-C_{n}\) are never cyclic but with the problems open. Then, in 2011, Norine and Whalen [10] not only showed the other direction of the first result is also true, but settled the case \(K_n-C_{n-1}\) by completely determining the structure of its sandpile group. Motivated by the above two papers, we shall consider the sandpile group of the graph \(K_{n}-C_{k}\) for \(3\le k\le n-2\) in this paper.

Let \(G = (V, E)\) be a finite loopless graph with n vertices. Then, its Laplacian matrix \(L(G) = D(G)-A(G)\), where \(D(G) = \hbox {diag}(d_1, d_2, \ldots , d_n)\) and A(G) are the degree matrix and the adjacency matrix of G, respectively. Thinking of L(G) as a linear map \({\mathbb {Z}}^n\rightarrow {\mathbb {Z}}^n\), its cokernel has the form

$$\begin{aligned} coker L(G) = {\mathbb {Z}}^n/L(G){\mathbb {Z}}^n ={\mathbb {Z}}\oplus S(G), \end{aligned}$$

where S(G) is the sandpile group on G in the sense of isomorphism.

For \(v\in V(G)\), we define the reduced Laplacian \({\tilde{L}}_v\) as the submatrix of L(G) obtained by omitting the row and column corresponding to v. Then, it is well known that for any \(v\in V(G)\),

$$\begin{aligned} S(G)\cong {\mathbb {Z}}^{n-1}/{\tilde{L}}_v{\mathbb {Z}}^{n-1}=coker({\tilde{L}}_v). \end{aligned}$$

That is, \(coker({\tilde{L}}_v)\) is independent of the choice of vertex v. Thus, we simply write \({\tilde{L}}_v\) as \({\tilde{L}}\).

Recall that two matrices \(A,B\in {\mathbb {Z}}^{m\times n}\) are (unimodular) equivalent (written \(A\sim B\)) [9] if there exist \(P\in GL(m,{\mathbb {Z}})\), \(Q\in GL(n,{\mathbb {Z}})\), such that \(B=PAQ\). Equivalently, B is obtained from A by a sequence of integer row and column operations that are invertible over the ring \({\mathbb {Z}}\) of integers. For any square integer matrix A, it is equivalent to a unique diagonal matrix \(S(A) = \hbox {diag}(s_1, s_2,\ldots ,s_n)\) ( the Smith normal form) whose entries are nonnegative and \(s_i\) divides \(s_{i+1} (i=1,\ldots ,n-1)\). It can be seen easily that \(A \sim B\) implies \(coker A \cong coker B\). So if the Smith normal form of the reduced Laplacian \({\tilde{L}}\) is \( \hbox {diag}(s_1, s_2,\ldots , s_{n-1})\), where \(1=s_1=\cdots =s_{r-1}<s_{r}\le \cdots \le s_{n-1}\), then the sandpile group of G

$$\begin{aligned} S(G)={\mathbb {Z}}_{s_{r}}\oplus {\mathbb {Z}}_{s_{r+1}}\oplus \cdots \oplus {\mathbb {Z}}_{s_{n-1}}, \end{aligned}$$

where \({\mathbb {Z}}_{a}={\mathbb {Z}}/a{\mathbb {Z}}\). \(s_r,\ldots ,s_n\) are called invariant factors of S(G), and \(\mu (G)=n-r\) is the minimum number of generators of S(G).

The rest of the paper is arranged as follows: In Sect. 2, we give several lemmas which are needed for the main results. In Sect. 3, we determine the explicit structure of the sandpile group of \(K_{n}-C_{k}\),\((3\le k\le n-2)\). In Sect. 4, as applications of the main results, we deduce more explicit results for the sandpile group of \(K_{n}-C_{k}\) for \(k=3,4,5,6,7\) and prime k.

2 Preliminaries

In this section, we shall first give several lemmas.

Lemma 2.1

[9] Suppose that A is an \(n\times n\) integer matrix, and its Smith normal form is \(\hbox {diag}(s_1,s_2,\ldots ,s_n)\). Then,

$$\begin{aligned} s_i=\frac{\Delta _i}{\Delta _{i-1}},\quad \ \ i=1,2,\ldots ,n, \end{aligned}$$

where \(\Delta _i\) (called i-th determinant divisor) is the greatest common divisor of the \(i\times i\) minors of A. By convention \(\Delta _0:=1\).

Now let \(a_{k}(t), b_{k}(t), c_{k}(t)\) and \(d_k(t)\) be four sequences satisfying the same linear recurrence relation: \(y_{k}(t)= ty_{k-1}(t)-y_{k-2}(t)\) with initial values as follows, respectively,

$$\begin{aligned} \begin{aligned}&a_{0}(t)=1,\&a_{1}(t)=t;\\&b_{0}(t)=2,\&b_{1}(t)=t;\\&c_{0}(t)=1,\&c_{1}(t)=t+1;\\&d_{0}(t)=1,\&d_{1}(t)=t-1. \end{aligned} \end{aligned}$$

Solving the linear recurrence relations, it is easy to obtain that

$$\begin{aligned} \begin{aligned}&a_{k}(t)=\frac{1}{\sqrt{t^{2}-4}}(\lambda _1^{k+1}-\lambda _2^{k+1});\\&b_{k}(t)=\lambda _1^{k}+\lambda _2^{k};\\&c_{k}(t)=\frac{1}{t-2}(\lambda _1^{k}(\lambda _1-1)+\lambda _2^{k}(\lambda _2-1));\\&d_{k}(t)=\frac{1}{t+2}(\lambda _1^{k}(\lambda _1+1)+\lambda _2^{k}(\lambda _2+1)); \end{aligned} \end{aligned}$$

where

$$\begin{aligned} \lambda _1=\frac{t+\sqrt{t^{2}-4}}{2}, \ \ \lambda _2=\frac{t-\sqrt{t^{2}-4}}{2} \end{aligned}$$

are two roots of the characteristic equation \(x^2-tx+1=0\).

Lemma 2.2

For \(a_{k}(t), b_{k}(t), c_k(t)\) and \(d_k(t)\) as defined above, we have

  1. (1)

    if \(k=2m\), then

    $$\begin{aligned} \left\{ \begin{aligned}&a_{2m}(t)= c_{m}(t)d_m(t); \\&a_{2m}(t)+1= a_{m}(t)b_{m}(t). \end{aligned} \right. \end{aligned}$$
  2. (2)

    if \(k=2m-1\), then

    $$\begin{aligned} \left\{ \begin{aligned}&a_{2m-1}(t)= a_{m-1}(t)b_{m}(t);\\&a_{2m-1}(t)-1= c_{m-1}(t)d_{m}(t). \end{aligned} \right. \end{aligned}$$
  3. (3)
    $$\begin{aligned} \begin{aligned}&tb_{m}(t)-2b_{m-1}(t)=(t^{2}-4)a_{m-1}(t);\\&tc_m(t)-2c_{m-1}(t)=(t+2)d_m(t). \end{aligned} \end{aligned}$$

Proof

Using the facts \(\lambda _1\lambda _2=1, \lambda _1+\lambda _2=t, \lambda _1-\lambda _2=\sqrt{t^{2}-4}\). It is easy to check the identities. \(\square \)

Note that if t is an integer, then \(a_{k}(t), b_{k}(t), c_k(t)\) and \(d_k(t)\) are integer sequences. Let gcd(ab) denote the greatest common divisor of a and b. Then, we have the following results.

Lemma 2.3

Let t be an integer, then for any \(m>1\),

$$\begin{aligned} gcd(a_{m}(t),a_{m-1}(t))=gcd(c_{m}(t),c_{m-1}(t))=gcd(d_{m}(t),d_{m-1}(t))=1 \end{aligned}$$

and

$$\begin{aligned} gcd(b_{m}(t),b_{m-1}(t))=gcd(2,t). \end{aligned}$$

Proof

We only need to notice that for any sequence \(x_n\) satisfying \(x_n=tx_{n-1}-x_{n-2}\),

$$\begin{aligned} gcd(x_n, x_{n-1})=gcd(x_{n-1},x_{n-2})=\cdots =gcd(x_1,x_0). \end{aligned}$$

Thus, the results follow directly. \(\square \)

Using the fact

$$\begin{aligned} \begin{vmatrix} t&1&0&\cdots&0 \\ 1&t&1&\cdots&0 \\ 0&1&t&\cdots&0 \\ \vdots&\vdots&\vdots&\vdots \\ 0&0&0&\cdots&t \\ \end{vmatrix}_{k\times k}=a_k(t) \end{aligned}$$

for \(k\ge 1\), we obtain the following result.

Lemma 2.4

For \(k\ge 3\), let

$$\begin{aligned} A_k(t)=\begin{pmatrix} t &{} 1 &{} 0 &{} \cdots &{} 1 \\ 1 &{} t &{} 1 &{} \cdots &{} 0 \\ 0 &{} 1 &{} t &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \vdots &{} &{} \vdots \\ 1 &{} 0 &{} 0 &{} \cdots &{} t \\ \end{pmatrix}_{k\times k} \end{aligned}$$

then

$$\begin{aligned} \det A_k(t)=\left\{ \begin{array}{ll} (t^{2}-4)a_{m-1}^{2}(t),&{}\quad \ \ \text{ if }\ \ k=2m; \\ (t+2)d_{m}^{2}(t),&{}\quad \ \ \text{ if }\ \ k=2m+1. \end{array} \right. \end{aligned}$$

Proof

It is easy to see that

$$\begin{aligned} \det A_k(t)=ta_{k-1}(t)-2(a_{k-2}(t)+(-1)^k). \end{aligned}$$

(1) If \(k=2m\), then by Lemma 2.2

$$\begin{aligned} \begin{aligned} \det A_k(t)&=ta_{2m-1}(t)-2(a_{2m-2}(t)+1)\\&=ta_{m-1}(t)b_{m}(t)-2a_{m-1}(t)b_{m-1}(t))\\&=a_{m-1}(t)(tb_{m}(t)-2b_{m-1}(t))\\&=(t^{2}-4)a_{m-1}^{2}(t). \end{aligned} \end{aligned}$$

(2) If \(k=2m+1\), then by Lemma 2.2 again

$$\begin{aligned} \begin{aligned} \det A_k(t)&=ta_{2m}(t)-2(a_{2m-1}(t)-1)\\&=tc_{m}(t)d_{m}(t)-2c_{m-1}(t)d_{m}(t)\\&=d_{m}(t)(tc_m(t)-2c_{m-1}(t))\\&=(t+2)d_{m}^{2}(t). \end{aligned} \end{aligned}$$

Now the proof is completed. \(\square \)

3 The Sandpile Group of \(K_{n}-C_{k}\)

After the preparatory work we have done in the above section, in this section, we shall give the explicit structure of the sandpile group of the graph \(G=K_{n}-C_{k}\) for \(3\le k\le n-2\). Let \(V(G)=\{1, \ldots , n\}\), by symmetry, we may assume that \(d_1=d_2=\cdots =d_k=n-3\) and \(d_{k+1}=\cdots =d_n=n-1\). Then, the Laplacian matrix of G has the form

$$\begin{aligned} L= \begin{pmatrix} n-3 &{} 0 &{} -1 &{} \cdots &{} 0 &{} -1 &{} \cdots &{} -1 \\ 0 &{} n-3 &{} 0 &{} \cdots &{} -1 &{} -1 &{} \cdots &{} -1 \\ -1 &{} 0 &{} n-3 &{} \cdots &{} -1 &{} -1 &{} \cdots &{} -1 \\ \vdots &{} \vdots &{} \vdots &{} &{} \vdots &{} \vdots &{} &{} \vdots \\ 0 &{} -1 &{} -1 &{} \cdots &{} n-3 &{} -1 &{} \cdots &{} -1 \\ -1 &{} -1 &{} -1 &{} \cdots &{} -1 &{} n-1 &{} \cdots &{} -1 \\ \vdots &{} \vdots &{} \vdots &{} &{} \vdots &{} \vdots &{} \ &{} \vdots \\ -1 &{} -1 &{} -1 &{} \cdots &{} -1 &{} -1 &{} \cdots &{} n-1 \\ \end{pmatrix}_{n\times n} \end{aligned}$$

Deleting the last row and column from L to obtain the reduced Laplacian matrix, \({\tilde{L}}\) of G. For \({\tilde{L}}\), first subtracting the last row of \({\tilde{L}}\) from all other rows, and then subtracting the last column from all other columns. We get

$$\begin{aligned} {\tilde{L}}\sim \begin{pmatrix} n-2 &{} 1 &{} 0 &{} \cdots &{} 1 &{} 0 &{} \cdots &{} 0 &{} 0\\ 1 &{} n-2 &{} 1 &{} \cdots &{} 0 &{} 0 &{} \cdots &{} 0 &{} 0\\ 0 &{} 1 &{} n-2 &{} \cdots &{} 0 &{} 0 &{} \cdots &{} 0 &{} 0\\ \vdots &{} \vdots &{} \vdots &{} &{} \vdots &{} \vdots &{} &{} \vdots &{} \vdots \\ 1 &{} 0 &{} 0 &{} \cdots &{} n-2 &{} 0 &{} \cdots &{} 0 &{} 0\\ 0 &{} 0 &{} 0 &{} \cdots &{} 0 &{} n &{} \cdots &{} 0 &{} 0\\ \vdots &{} \vdots &{} \vdots &{} &{} \vdots &{} \vdots &{} &{} \vdots &{} \vdots \\ 0 &{} 0 &{} 0 &{} \cdots &{} 0 &{} 0 &{} \cdots &{} n &{} 0\\ 0 &{} 0 &{} 0 &{} \cdots &{} 0 &{} 0 &{} \cdots &{} 0 &{} 1\\ \end{pmatrix}_{(n-1)\times (n-1)} = \begin{pmatrix} A_k(n-2) &{} 0\\ 0 &{} B \end{pmatrix}, \end{aligned}$$

where

$$\begin{aligned} B= \begin{pmatrix} n &{} \cdots &{} 0 &{} 0 \\ \vdots &{} &{} \vdots &{} \vdots \\ 0 &{} \cdots &{} n &{} 0 \\ 0 &{} \cdots &{} 0 &{} 1 \\ \end{pmatrix}_{(n-1-k)\times (n-1-k)}. \end{aligned}$$

That is,

$$\begin{aligned} S(K_n-C_k)\cong ({\mathbb {Z}}_{n})^{n-k-2}\oplus coker(A_k(n-2)). \end{aligned}$$
(1)

Remark

Note that \(K_n-C_k\) can be viewed as the join of the graph \(K_k-C_k\) with the complete graph \(K_{n-k}\). The structure of the sandpile group of this family of graphs had been addressed in [6, 11]. (1) is just the same result of Theorem 1 (1) in [6]. In the following, we first determine the explicit structure of \(coker(A_k(n-2))\). Then, we determine all invariant factors of \(S(K_n-C_k)\).

Theorem 3.1

For the Smith normal form of \(A_k(n-2)\), we have

$$\begin{aligned} A_k(n-2)= \begin{pmatrix} n-2 &{} 1 &{} 0 &{} \cdots &{} 1 \\ 1 &{} n-2 &{} 1 &{} \cdots &{} 0 \\ 0 &{} 1 &{} n-2 &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \vdots &{} &{} \vdots \\ 1 &{} 0 &{} 0 &{} \cdots &{} n-2 \\ \end{pmatrix}_{k\times k} \sim \begin{pmatrix} 1 &{} 0 &{} \cdots &{} 0 &{} 0 \\ 0 &{} 1 &{} \cdots &{} 0 &{} 0 \\ \vdots &{} \vdots &{} &{} \vdots &{} \vdots \\ 0 &{} 0 &{} \cdots &{} s_{1} &{} 0 \\ 0 &{} 0 &{} \cdots &{} 0 &{} s_{2} \\ \end{pmatrix}_{k\times k} \end{aligned}$$

where

$$\begin{aligned} s_{1}= & {} \left\{ \begin{array}{ll} a_{m-1}(n-2)gcd (2, n),&{}\quad \ \ \text{ if }\ \ k=2m; \\ d_{m}(n-2),&{}\quad \ \ \text{ if }\ \ k=2m+1. \end{array} \right. \\ s_{2}= & {} \left\{ \begin{array}{ll} \frac{n(n-4)}{gcd^{2}(2,n)}s_{1},&{}\quad \ \ \text{ if }\ \ k=2m; \\ ns_{1},&{}\quad \ \ \text{ if }\ \ k=2m+1. \end{array} \right. \end{aligned}$$

Proof

Note that there exists a \((k-2)\times (k-2)\) minor in \(A_k(n-2)\) with value 1 (deleting the first and the \(k-\)th columns, the \(k-1\)-th and k-th rows, respectively). So \(\Delta _1=\cdots =\Delta _{k-2}=1\). Also \(\Delta _k=\det A_k(n-2)\) is given in Lemma 2.4. The only remain is to compute \(\Delta _{k-1}\). Since \(A_k(n-2)\) is a circulant matrix, so does its adjoint matrix \(adj(A_k(n-2))\). Hence,

$$\begin{aligned} \Delta _{k-1}=gcd(A_{ij};i,j=1,\ldots ,k)=gcd(A_{1j}; j=1,\ldots ,k), \end{aligned}$$

where \(A_{ij}(1 \le j \le k)\) is the algebraic cofactor of \(ij-\)element of \(A_k(n-2)\). For simplicity, let \((x_{1},x_{2},\ldots ,x_{k})=(A_{11},A_{12},\ldots ,A_{1k})\). Note that \(x_{i}=x_{k+2-i}(i=2,3,\ldots ,k\)) since \(A_k(n-2)\) is a symmetric circulant matrix. From

$$\begin{aligned} \begin{pmatrix} n-2 &{} 1 &{} 0 &{} \cdots &{} 1 \\ 1 &{} n-2 &{} 1 &{} \cdots &{} 0 \\ 0 &{} 1 &{} n-2 &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \vdots &{} &{} \vdots \\ 1 &{} 0 &{} 0 &{} \cdots &{} n-2 \\ \end{pmatrix}_{k\times k} \begin{pmatrix} x_{1} \\ x_{2} \\ x_{3} \\ \vdots \\ x_{k} \end{pmatrix} =\begin{pmatrix} \det A_k(n-2) \\ 0 \\ 0 \\ \vdots \\ 0 \end{pmatrix}, \end{aligned}$$

we obtain that

$$\begin{aligned} \begin{aligned}&\det A_k(n-2)=(n-2)x_{1}+2x_{2}\\&x_{1}+(n-2)x_{2}+x_{3}=0 \Rightarrow x_{3}=-x_{1}-(n-2)x_{2}\\&x_{2}+(n-2)x_{3}+x_{4}=0 \Rightarrow x_{4}=-x_{2}-(n-2)x_{3}\\&\vdots \\&x_{k-2}+(n-2)x_{k-1}+x_{k}=0 \Rightarrow x_{k}=-x_{k-2}-(n-2)x_{k-1}. \end{aligned} \end{aligned}$$

That is, \(x_{3},\ldots ,x_{k}\) can be represented linearly by \(x_{1},x_{2}\).

So

$$\begin{aligned} \Delta _{k-1}= & {} gcd(x_{1},x_{2},\ldots ,x_{k})= gcd(x_{1},x_{2}).\\ x_{1}= & {} A_{11}= \begin{vmatrix} n-2&1&\cdots&0\\ 1&n-2&\cdots&0\\ \vdots&\vdots&\vdots \\ 0&0&\cdots&n-2\\ \end{vmatrix}_{(k-1)\times (k-1)} =a_{k-1}(n-2)\\ x_{2}= & {} A_{12}=A_{1k}=(-1)^{k+1}\cdot \begin{vmatrix} 1&n-2&1&\cdots&0\\ 0&1&n-2&\cdots&0\\ \vdots&\vdots&\vdots&\vdots \\ 1&0&0&\cdots&1\\ \end{vmatrix}_{(k-1)\times ((k-1)}\\= & {} (-1)^{k+1}\cdot (1+(-1)^{k}a_{k-2}(n-2))\\= & {} (-1)^{k+1}-a_{k-2}(n-2), \end{aligned}$$

So by Lemma 2.1,

$$\begin{aligned} \left\{ \begin{aligned}&s_{1}=\Delta _{k-1}=gcd(a_{k-1}(n-2),a_{k-2}(n-2)+(-1)^{k});\\&s_{2}=\frac{\det A_{k}(n-2)}{s_{1}}. \end{aligned} \right. \end{aligned}$$

(1) If \(k=2m\), then by Lemmas 2.2, 2.3 and 2.4

$$\begin{aligned} \begin{aligned} s_{1}&=gcd(a_{2m-1}(n-2),a_{2m-2}(n-2)+1)\\&=gcd(a_{m-1}(n-2)b_{m}(n-2),a_{m-1}(n-2)b_{m-1}(n-2))\\&=a_{m-1}(n-2)gcd(b_{m}(n-2),b_{m-1}(n-2))\\&=a_{m-1}(n-2)gcd(2,n-2)\\&=a_{m-1}(n-2)gcd(2,n),\\ s_{2}&=\frac{(n^{2}-4n)a_{m-1}^{2}(n-2)}{a_{m-1}(n-2)gcd(2,n)}\\&=\frac{n(n-4)}{gcd^{2}(2,n)}s_{1}. \end{aligned} \end{aligned}$$

(2) If \(k=2m+1\), then by Lemmas 2.2, 2.3 and 2.4

$$\begin{aligned} \begin{aligned} s_{1}&=gcd(a_{2m}(n-2),a_{2m-1}(n-2)-1)\\&=gcd(c_{m}(n-2)d_{m}(n-2),c_{m-1}(n-2)d_{m}(n-2))\\&=d_{m}(n-2)gcd(c_{m}(n-2),c_{m-1}(n-2))\\&=d_{m}(n-2),\\ s_{2}&=\frac{nd_{m}^{2}(n-2)}{d_{m}(n-2)}\\&=ns_{1}. \end{aligned} \end{aligned}$$

\(\square \)

In order to give all invariant factors of \(S(K_n-C_k)\), we need the following result about \(a_{k}(n-2)\).

Lemma 3.2

$$\begin{aligned} a_{k}(n-2)=nf_{k}(n)+(-1)^{k}(k+1), \end{aligned}$$

where \(f_{k}(n)\)’s are all integers.

Proof

We prove the result by induction on k.

First \(a_{0}(n-2)=1, a_{1}(n-2)=n-2\), so \(f_0(n)=0, f_1(n)=1\) are integers.

Now suppose \(a_{k-1}(n-2)=nf_{k-1}(n)+(-1)^{k-1}k\), \(a_{k-2}(n-2)=nf_{k-2}(n)+(-1)^{k-2}(k-1)\), where \(f_{k-1}(n)\) and \(f_{k-2}(n)\) are integers. Then, by \(a_{k}(n-2)= (n-2)a_{k-1}(n-2)-a_{k-2}(n-2)\),

$$\begin{aligned} \begin{aligned} a_{k}(n-2)&=(n-2)(nf_{k-1}(n)+(-1)^{k-1}k)-(nf_{k-2}(n)+(-1)^{k-2}(k-1))\\&=n((n-2)f_{k-1}(n)-f_{k-2}(n)+(-1)^{k-1}k)+(-1)^{k}2k-(-1)^{k}(k-1)\\&=n((n-2)f_{k-1}(n)-f_{k-2}(n)+(-1)^{k-1}k)+(-1)^{k}(k+1)\\&=nf_{k}(n)+(-1)^{k}(k+1), \end{aligned} \end{aligned}$$

where \(f_{k}(n)=(n-2)f_{k-1}(n)-f_{k-2}(n)+(-1)^{k-1}k\) is an integer since \(f_{k-1}(n)\) and \(f_{k-2}(n)\) are integers. This completes the proof. \(\square \)

Now we are ready to give the main result.

Theorem 3.3

For the nearly complete graph \(G=K_{n}-C_{k}\) \((3\le k\le n-2)\), we have

  1. (1)

    if \(k=n-2\), then

    $$\begin{aligned} S(G)\cong {\mathbb {Z}}_{s_{1}}\oplus {\mathbb {Z}}_{s_{2}}; \end{aligned}$$
  2. (2)

    if \(3\le k\le n-3\), then

    $$\begin{aligned} S(G)\cong \left\{ \begin{array}{ll} \underbrace{{\mathbb {Z}}_{n}\oplus \cdots \oplus {\mathbb {Z}}_{n}}_{n-3-k}\oplus {\mathbb {Z}}_{ns_{1}}\oplus {\mathbb {Z}}_{s_{2}},&{}\quad \ \ \mathrm{if}\ \gcd (n,k)=1;\\ {\mathbb {Z}}_{i}\oplus \underbrace{{\mathbb {Z}}_{n}\oplus \cdots \oplus {\mathbb {Z}}_{n}}_{n-3-k}\oplus {\mathbb {Z}}_{\frac{n}{i}\cdot s_{1}}\oplus {\mathbb {Z}}_{s_{2}},&{}\ \ \mathrm{if}\ \gcd (n,k)=i,(1<i\le k); \end{array} \right. \end{aligned}$$

where

$$\begin{aligned} s_{1}=\left\{ \begin{array}{ll} a_{m-1}(n-2)gcd (2, n),&{}\quad \ \ \text{ if }\ \ k=2m; \\ d_{m}(n-2),&{}\quad \ \ \text{ if }\ \ k=2m+1; \end{array} \right. \end{aligned}$$

and

$$\begin{aligned} s_{2}=\left\{ \begin{array}{ll} \frac{n(n-4)}{gcd^{2}(2,n)}s_{1},&{}\quad \ \ \text{ if }\ \ k=2m; \\ ns_{1},&{}\quad \ \ \text{ if }\ \ k=2m+1. \end{array} \right. \end{aligned}$$

Proof

By Theorem 3.1, we have

$$\begin{aligned} {\tilde{L}}\sim \begin{pmatrix} 1 &{} \\ &{} \ddots &{} \\ &{} &{} 1 &{} \\ &{} &{} &{} s_{1} &{} \\ &{} &{} &{} &{} s_{2} &{}\\ &{} &{} &{} &{} &{} n &{} \\ &{} &{} &{} &{} &{} &{} \ddots &{}\\ &{} &{} &{} &{} &{} &{} &{} n \\ \end{pmatrix}_{(n-1)\times (n-1)}. \end{aligned}$$

Obviously, \(S(G)\cong {\mathbb {Z}}_{s_{1}}\oplus {\mathbb {Z}}_{s_{2}}\) for \(k=n-2\).

For \(3\le k\le n-3\), let

$$\begin{aligned} A= \begin{pmatrix} s_{1} &{} \\ &{} s_{2} &{}\\ &{} &{} n &{} \\ &{} &{} &{} \ddots &{}\\ &{} &{} &{} &{} n \\ \end{pmatrix}_{(n-k)\times (n-k)}. \end{aligned}$$

Note that both \(s_1\) and n divide \(s_2\), so it is not difficult to get that

$$\begin{aligned}&\Delta _{i}(A)=n^{i-1}gcd(s_{1},n),\quad \ \ i=1,\ldots ,n-k-2;\\&\Delta _{n-k-1}(A)=n^{n-k-2}s_1,\quad \ \ \Delta _{n-k}(A)=n^{n-k-2}s_1s_2. \end{aligned}$$

Now we shall show that \(gcd(s_{1},n)=gcd(n,k)\). First, for \(k=2m\), by Lemma 3.2

$$\begin{aligned} \begin{aligned} s_{1}&=a_{m-1}(n-2)gcd(2,n)\\&=(nf_{m-1}(n)+(-1)^{m-1}m)gcd(2,n)\\&=nf_{m-1}(n)gcd(2,n)+(-1)^{m-1}gcd(2,n)m, \end{aligned} \end{aligned}$$

so \(gcd(s_{1},n)=gcd(gcd(2,n)m,n)=gcd(2m,n)=gcd(n,k)\). Then, for \(k=2m+1\), by Lemma 3.2 again

$$\begin{aligned} \begin{aligned} s_{1}&=d_{m}(n-2)\\&=a_{m}(n-2)-a_{m-1}(n-2)\\&=nf_{m}(n)+(-1)^{m}(m+1)-(nf_{m-1}(n)+(-1)^{m-1}m)\\&=n(f_{m}(n)-f_{m-1}(n))+(-1)^{m}(2m+1), \end{aligned} \end{aligned}$$

so \(gcd(s_{1},n)=gcd(2m+1,n)=gcd(n,k)\). That is, for any case, \(gcd(s_{1},n)=gcd(n,k)\).

So by Lemma 2.1, we have

$$\begin{aligned} A\sim \hbox {diag}\left( gcd(n,k), n, \ldots , n, \frac{n}{gcd(n,k)}\cdot s_{1},s_2\right) . \end{aligned}$$

Now the results about S(G) follow directly. \(\square \)

Recall that the minimum number of generators of the sandpile group S(G) is denoted by \(\mu (G)\). From the above theorem, we immediately derive the following corollary.

Corollary 3.4

Let \(G=K_{n}-C_{k}\) \((3\le k\le n-2)\), we have

  1. (1)

    if \(k=n-2\), then \(\mu (G)=2\);

  2. (2)

    if \(3\le k\le n-3\), then

    $$\begin{aligned} \mu (G)=\left\{ \begin{array}{ll} n-k-1,&{}\quad \ \ \mathrm{if}\ \gcd (n,k)=1; \\ n-k,&{}\quad \ \ \mathrm{if}\ \gcd (n,k)=i,(1<i\le k). \end{array} \right. \end{aligned}$$

Remark

It is worthy of pointing out that our method can be used to determine the sandpile group of any graph as \(K_n-\cup _{i=1}^tC_{k_i}\), where \(C_{k_{i}}\) are mutual disjoint cycles and satisfy \(3\le k_1+k_2+\cdots +k_t\le n-2\). It is also not difficult to deduce that the sandpile groups of these graphs are never cyclic.

4 More Explicit Results for Some Special k

In this section, as applications of Theorem 3.3, we give more explicit results for the sandpile group of \(K_{n}-C_{k}\) for \(k=3,4,5,6,7\) and prime k.

Theorem 4.1

For the nearly complete graph \(G=K_{n}-C_{3}\), we have

  1. (1)

    if \(G=K_{5}-C_{3}\), then

    $$\begin{aligned} S(G)\cong {\mathbb {Z}}_{2}\oplus {\mathbb {Z}}_{10}; \end{aligned}$$
  2. (2)

    if \(n\ge 6\), then

    $$\begin{aligned} S(G)\cong \left\{ \begin{array}{ll} {\mathbb {Z}}_{3}\oplus ({\mathbb {Z}}_{n})^{n-6}\oplus {\mathbb {Z}}_{p(n-3)} \oplus {\mathbb {Z}}_{n(n-3)},&{}\quad \ \ \ \mathrm{if}\ \ n=3p;\\ ({\mathbb {Z}}_{n})^{n-6}\oplus ({\mathbb {Z}}_{n(n-3)})^{2},&{}\quad \ \ \ \mathrm{if}\ \ n=3p+1\ or\ 3p+2. \end{array} \right. \end{aligned}$$

Theorem 4.2

For the nearly complete graph \(G=K_{n}-C_{4}\), we have

  1. (1)

    if \(G=K_{6}-C_{4}\), then

    $$\begin{aligned} S(G)\cong {\mathbb {Z}}_{8}\oplus {\mathbb {Z}}_{24}; \end{aligned}$$
  2. (2)

    if \(n\ge 7\), then

    $$\begin{aligned} S(G)\cong \left\{ \begin{array}{llll} {\mathbb {Z}}_{4}\oplus ({\mathbb {Z}}_{n})^{n-7}\oplus {\mathbb {Z}}_{2p(n-2)} \oplus {\mathbb {Z}}_{2p(n-2)(n-4)},&{}\quad \ \ \ \mathrm{if}\ \ n=4p;\\ {\mathbb {Z}}_{2}\oplus ({\mathbb {Z}}_{n})^{n-7}\oplus {\mathbb {Z}}_{n(n-2)} \oplus {\mathbb {Z}}_{(2p+1)(n-2)(n-4)},&{}\quad \ \ \ \mathrm{if}\ \ n=4p+2;\\ ({\mathbb {Z}}_{n})^{n-7}\oplus {\mathbb {Z}}_{n(n-2)}\oplus {\mathbb {Z}}_{n(n-2)(n-4)},&{}\quad \ \ \ \mathrm{if}\ \ n=4p+1\ or\ 4p+3. \end{array} \right. \end{aligned}$$

Theorem 4.3

For the nearly complete graph \(G=K_{n}-C_{5}\), we have

  1. (1)

    if \(G=K_{7}-C_{5}\), then

    $$\begin{aligned} S(G)\cong {\mathbb {Z}}_{19}\oplus {\mathbb {Z}}_{133}; \end{aligned}$$
  2. (2)

    if \(n\ge 8\), then

    $$\begin{aligned} S(G)\cong \left\{ \begin{array}{ll} {\mathbb {Z}}_{5}\oplus ({\mathbb {Z}}_{n})^{n-8}\oplus {\mathbb {Z}}_{p(n-2)(n-3)-p} \oplus {\mathbb {Z}}_{n(n-2)(n-3)-n},&{}\quad \ \ \ \mathrm{if}\ \ n=5p;\\ ({\mathbb {Z}}_{n})^{n-8}\oplus ({\mathbb {Z}}_{n(n-2)(n-3)-n})^{2},&{}\quad \ \ \ \mathrm{otherwise.} \end{array} \right. \end{aligned}$$

Theorem 4.4

For the nearly complete graph \(G=K_{n}-C_{6}\), we have

  1. (1)

    if \(G=K_{8}-C_{6}\), then

    $$\begin{aligned} S(G)\cong {\mathbb {Z}}_{70}\oplus {\mathbb {Z}}_{560}; \end{aligned}$$
  2. (2)

    if \(n\ge 9\), then

    $$\begin{aligned} S(G)\cong \left\{ \begin{array}{ll} {\mathbb {Z}}_{6}\oplus ({\mathbb {Z}}_{n})^{n-9}\oplus {\mathbb {Z}}_{2p(n-1)(n-3)}\oplus {\mathbb {Z}}_{3p(n-1)(n-3)(n-4)},&{}\quad \ \ \ \mathrm{if}\ \ n=6p;\\ {\mathbb {Z}}_{2}\oplus ({\mathbb {Z}}_{n})^{n-9}\oplus {\mathbb {Z}}_{n(n-1)(n-3)}\oplus {\mathbb {Z}}_{(3p+1)(n-1)(n-3)(n-4)},&{}\quad \ \ \ \mathrm{if}\ \ n=6p+2;\\ {\mathbb {Z}}_{3}\oplus ({\mathbb {Z}}_{n})^{n-9}\oplus {\mathbb {Z}}_{(2p+1)(n-1)(n-3)}\oplus {\mathbb {Z}}_{n(n-1)(n-3)(n-4)},&{}\quad \ \ \ \mathrm{if}\ \ n=6p+3;\\ ({\mathbb {Z}}_{n})^{n-9}\oplus {\mathbb {Z}}_{n(n-1)(n-3)}\oplus {\mathbb {Z}}_{n(n-1)(n-3)(n-4)},&{}\quad \ \ \ \mathrm{if}\ \ n=6p+1\ or\ 6p+5. \end{array} \right. \end{aligned}$$

Theorem 4.5

For the nearly complete graph \(G=K_{n}-C_{7}\), we have

  1. (1)

    if \(G=K_{9}-C_{7}\), then

    $$\begin{aligned} S(G)\cong {\mathbb {Z}}_{281}\oplus {\mathbb {Z}}_{2529}; \end{aligned}$$
  2. (2)

    if \(n\ge 10\), then

    $$\begin{aligned} S(G)\cong \left\{ \begin{array}{lll} {\mathbb {Z}}_{7}\oplus ({\mathbb {Z}}_{n})^{n-10}\oplus {\mathbb {Z}}_{p(n-1)(n-2)(n-4)+p} \oplus {\mathbb {Z}}_{n(n-1)(n-2)(n-4)+n},&{}\quad \ \ \ \mathrm{if}\ \ n=7p;\\ ({\mathbb {Z}}_{n})^{n-10}\oplus ({\mathbb {Z}}_{n(n-1)(n-2)(n-4)+n})^{2},&{}\quad \ \ \ \mathrm{otherwise}. \end{array} \right. \end{aligned}$$

In fact, for any odd prime \(k=2m+1\), we have the following result.

Theorem 4.6

For the nearly complete graph \(G=K_{n}-C_{k}\). If \(k=2m+1\) is a prime, then

  1. (1)

    if \(G=K_{k+2}-C_{k}\), then

    $$\begin{aligned} S(G)\cong {\mathbb {Z}}_{d_m(k)}\oplus {\mathbb {Z}}_{(k+2)d_m(k)}; \end{aligned}$$
  2. (2)

    if \(n\ge k+3\), then

    $$\begin{aligned} S(G)\cong \left\{ \begin{array}{lllll} {\mathbb {Z}}_{k}\oplus ({\mathbb {Z}}_{n})^{n-k-3}\oplus {\mathbb {Z}}_{pd_m(n-2)} \oplus {\mathbb {Z}}_{nd_m(n-2)},&{}\quad \ \ \ \mathrm{if}\ \ n=kp;\\ ({\mathbb {Z}}_{n})^{n-k-3}\oplus ({\mathbb {Z}}_{nd_m(n-2)})^{2},&{}\quad \ \ \ \mathrm{otherwise.} \end{array} \right. \end{aligned}$$