1 Introduction

Throughout this paper, we only consider simple connected graphs \(\Gamma =(V_\Gamma , E_\Gamma )\) with vertex set \(V_\Gamma \) and edge set \(E_\Gamma \). The distance between two vertices \(x,y\in V_\Gamma \), written as \(d_\Gamma (x,y)\), is the length of a shortest path connecting them.

The adjacency matrix \(A_{\Gamma }\) of \(\Gamma \) is a 0-1 \(\nu \times \nu \) matrix whose (xy)-entry equals to 1 if and only if vertices x and y are adjacent, whereas the distance matrix \(D_{\Gamma }\) of \(\Gamma \) is a \(\nu \times \nu \) matrix whose (xy)-entry equals to \(d_\Gamma (x,y)\), where \(\nu :=|V_\Gamma |\). Since \(A_{\Gamma }\) and \(D_{\Gamma }\) are real and symmetric, all the eigenvalues of \(A_{\Gamma }\) and \(D_{\Gamma }\) are real. The eigenvalues of \(A_\Gamma \) (resp. \(D_\Gamma \)) are called the eigenvalues (resp. distance eigenvalues) of \(\Gamma \). The spectrum of \(A_\Gamma \) (resp. \(D_\Gamma \)) is called the adjacency spectrum (resp. distance spectrum) of \(\Gamma \). Graph \(\Gamma \) is said to be integral (resp. distance-integral) if every eigenvalue of its adjacency matrix (resp. distance matrix) is integer.

Let G be a finite group and let S be a subset of G such that \(1_G\notin S\) and \(S^{-1}=S\); here, we use \(1_G\) to denote the identity element of G, and we omit the subscript G for our notation when there is no danger of confusion. The Cayley graph Cay(GS) over G with respect to S is the graph with vertex set \(V_{Cay(G,S)}=G\) and edge set \(E_{Cay(G,S)}=\left\{ \{g,h\}\,|\,gh^{-1}\in S, g,h\in G\right\} \). It is well known that Cay(GS) is connected if and only if \(\left< S\right>=G.\)

The concept of integral graphs was proposed by Harary and Schwenk [13] in 1974. They also proposed the following interesting question: “Which graphs have integral spectra?” Since then, classifying and constructing integral graphs have become important research topics in algebraic graph theory. However, for a general graph, giving a systemic and complete solution to the aforementioned problem turns out to be extremely difficult, and the problem is yet far from being solved. Many researchers then tried to obtain some progress by studying the integrality of some special classes of graphs (see, for example, [7] and [26]). One of the most popular among them is the research on the integrality of Cayley graphs.

In 1979, Babai [4] used character theory of finite groups G to give an expression for the spectrum of a Cayley graph Cay(GS), which is a remarkable achievement on the spectra of Cayley graphs. Bridges and Mena [6] derived a complete characterization of integral Cayley graphs over abelian groups. Alperin and Peterson [3] presented a necessary and sufficient condition for the integrality of Cayley graphs Cay(GS) on abelian groups G by characterizing the structure of S. Recently, Lu, Huang and Huang [21] obtained a necessary and sufficient condition for the integrality of Cayley graphs over dihedral group \(D_n\) by analyzing the irreducible characters of the dihedral group \(D_n\), which is defined as \(D_{n}=\big \langle a,b\,\big {|}\,a^{n}=b^2=1, bab=a^{-1}\big \rangle \). Cheng, Feng and Huang [8] gave a necessary and sufficient condition for the integrality of Cayley graphs over the dicyclic group \(T_{4n}\) (see [17]), which is defined as

$$\begin{aligned} T_{4n}= & {} \big \langle a,b\,\big {|}\,a^{2n}=1, a^n=b^2, b^{-1}ab=a^{-1}\big \rangle \nonumber \\= & {} \big \{1,a,\ldots ,a^{2n-1},b,ba,\ldots ,ba^{2n-1}\big \}. \end{aligned}$$
(1.1)

For more results on integral Cayley graphs, one may refer to [1, 2, 10, 12, 18, 19, 22, 23] and the references with in.

The distance matrix has numerous applications in chemistry and other branches. The information contained in it is immensely useful for computing topological indices such as the Wiener index, Harary index and so on. What’s more, multiple applications of the distance matrix and its eigenvalues have been found in a large variety of problems, including those in ornithology, molecular biology, psychology and archeology. One may be referred to [5] and the references therein. For such reasons, it is important to study some properties of distance eigenvalues. In this paper, we focus on the distance integrality of Cayley graphs. However, comparing with the extensive studies on integral Cayley graphs, there are few results on the distance integrality of Cayley graphs, which is due to being more difficult to obtain the distance spectrum. In 2010, Ilić [15] proved that all the distance eigenvalues of integral Cayley graphs over cyclic groups are integers. Two years later, Klotz and Sander [20] extended the above result from cyclic groups to abelian groups. Renteln [24] showed that the distance spectrum of a Cayley graph over a real reflection group with respect to the set of all reflections is integral and provided a combinatorial formula for such spectrum. Foster-Greenwood and Kriloff [11] proved that the eigenvalues and distance eigenvalues of a Cayley graphs on a complex reflection group with connection sets consisting of all reflections are integers.

Inspired by [3, 8, 11, 15, 20, 21, 24], we are interested in considering the distance integrality of Cayley graphs over abelian groups and dicyclic groups. Our first main result characterizes the equivalence of integrality and distance integrality of Cayley graphs over abelian groups, which reads as

Theorem 1.1

Let G be an abelian group. Choose \(S\subseteq G\) such that \(1\notin S=S^{-1}\) and \(\langle S\rangle =G\). Then, Cay(GS) is integral if and only if Cay(GS) is distance-integral.

By virtue of Theorem 1.1, we can immediately get the following corollary, which is a main result of [20].

Corollary 1.2

([20]) All the distance eigenvalues of integral Cayley graphs over abelian groups are integers.

Define \(C(G)=\left\{ \bigcup _{[g]\in {\widetilde{B}}(G)}m_g[g]\,|\,m_g\in {\mathbb {N}}\right\} \), where \({\mathbb {N}}\) is the set of natural numbers. For simplicity, we use C(a) to denote \(C(\langle a\rangle )\) in rest of the paper.

Our second main result presents a necessary and sufficient condition for the \(Cay(T_{4n},S)\) to be distance-integral, where S is any subset of \(T_{4n}\) satisfying \(1\notin S, S=S^{-1}\) and \(\langle S\rangle =T_{4n}\), which reads as

Theorem 1.3

Let \(T_{4n}\) be the dicyclic group as given in (1.1). Choose \(S\subseteq T_{4n}\) such that \(1\notin S=S^{-1}\) and \(\langle S\rangle =T_{4n}\). Then, \(Cay(T_{4n},S)\) is distance-integral if and only if \(\sum _{k=1}^{2n-1}d(1,a^k)a^k\in C(a)\) and \( \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}\) is a square number for all \(1\le h\le \left\lfloor \frac{n-1}{2}\right\rfloor \), where \(\omega =e^\frac{\pi i}{n}\) is a primitive 2n-th root of unity.

Our next main result completely characterizes all distance-integral Cayley graphs over \(T_{4p}\) for a prime \(p\ge 3\), which reads as

Theorem 1.4

Let \(T_{4p}=\langle a,b\,|\,a^{2p}=1, a^p=b^2, b^{-1}ab=a^{-1}\rangle \) with prime \(p\ge 3\). Choose \(S\subseteq T_{4p}\) such that \(1\notin S, S^{-1}=S\) and \(\langle S\rangle =T_{4p}\). If S can be partitioned as \(S:=S_1\cup b S_2 \subseteq T_{4p}\) with \(S_1, S_2 \subseteq \langle a\rangle ,\) then \(Cay(T_{4p},S)\) is distance-integral if and only if either \(S_1\in \{\emptyset ,\{a^p\}\}\) and \(S_2\in \left\{ \langle a\rangle {\setminus }\{a^k,a^{p+k}\},\langle a\rangle \right\} \) or \(S_1\in \left\{ [a],[a^2],[a]\cup \{a^p\},[a^2]\cup \{a^p\},\langle a\rangle {\setminus }\{1,a^p\},\langle a\rangle {\setminus }\{1\}\right\} \) and \(S_2\in \left\{ \{a^k,a^{p+k}\},\langle a\rangle \right. \left. {\setminus }\{a^k,a^{p+k}\},\langle a\rangle \right\} \) for \(0\le k\le p-1\).

The remainder of this paper is organized as follows. In Sect. 2 we give some preliminary results. In Sect. 3 we give a proof of Theorem 1.1, whereas a proof of Theorem 1.3 is presented in Sect. 4. In the last section, we give the proof of Theorem 1.4.

2 Preliminary results

We first restate some basic results on representation theory of finite groups. We follow the notations and terminologies in [25] except if otherwise stated. Let G be a finite group and let V be a finite-dimensional vector space over the complex field \({\mathbb {C}}\). Denote by GL(V) the group of all bijective linear maps \(T:V\rightarrow V\). A representation of G on V is a group homomorphism \(\rho :G\rightarrow GL(V)\). The degree of \(\rho \), denoted by \(d_\rho \), is the dimension of V. Suppose that V is a unitary space, that is, it is endowed with a Hermitian scalar product \(\langle \cdot ,\cdot \rangle _V\). A representation \(\rho : G\mapsto GL(V)\) is unitary if \(\langle \rho (g)v_1,\rho (g)v_2\rangle _V=\langle v_1,v_2\rangle _V\) for all \(g\in G\) and \(v_1,v_2\in V\). It is well known that any finite-dimensional representation of a finite group can be unitarizable. Therefore, we consider only unitary representations.

Fix an orthonormal basis of V over \({\mathbb {C}}\). For each \(g\in G\), the matrix \({\mathfrak {X}}(g)\) of \(\rho (g)\) with respect to the orthonormal basis is a unitary matrix, and \({\mathfrak {X}}:g\mapsto {\mathfrak {X}}(g)\) defines a matrix representation of G called a matrix representation afforded by \(\rho \). The character \(\chi _\rho :G\rightarrow {\mathbb {C}}\) of \(\rho \) is defined as \(\chi _\rho (g)=Tr(\rho (g))\) for \(g\in G\), where \(Tr(\rho (g))\) is the trace of the matrix representation of \(\rho (g)\). A subspace \(W\le V\) is G-invariant if \(\rho (g)w\in W\) for all \(g\in G\) and \(w\in W\). The trivial subspaces V and \(\{0\}\) are always invariant. We say that a representation \(\rho : G\rightarrow GL(V)\) is irreducible if V has no non-trivial invariant subspaces; otherwise, we say that it is reducible.

Let \({\mathbb {C}}[G]\) denote the set of formal sums \(\sum _{g\in G}a_gg\), where \(a_g\in {\mathbb {C}}\) and G is any (not necessarily abelian) finite group. Obviously, \({\mathbb {C}}[G]\) is a complex algebra having a basis consisting of the elements of G. If \(D=\sum _{g\in G}a_gg\in {\mathbb {C}}[G]\), define \(D^{-1}=\sum _{g\in G}a_gg^{-1}\); if D is a subset of G, we identify D with \(\sum _{d\in D}d\in {\mathbb {C}}[G].\)

Given a finite abelian group G, let \({\mathcal {F}}_G\) be the set consisting of all subgroups of G. The Boolean algebra B(G) is the set whose elements are obtained by arbitrary finite intersections, unions, and complements of the elements in \({\mathcal {F}}_G.\) The minimal elements of B(G) are called atoms. Denote by \({\widetilde{B}}(G)\) the set of all different atoms. A muti-subset S of G is called integral if \(\chi (S)=\sum _{s\in S}\chi (s)\) is an integer for every irreducible character \(\chi \) of G. Alperin and Peterson [3] not only showed that each element of B(G) is the union of some atoms and each atom of B(G) has the form \([g]=\{x|\langle x\rangle =\langle g\rangle , x\in G\}\) but also determined the integrality of Cayley graphs over abelian groups, which is listed in the following lemma.

Lemma 2.1

([3]) Let G be a finite abelian group and \(S\subseteq G\). Then, the following statements are equivalent:

  1. (i)

    Cay(GS) is integral;

  2. (ii)

    S is integral;

  3. (iii)

    \(S\in B(G)\).

DeVos et al. [9] used an approach similar to those given in [3] to extend parts of the above lemma to multi-sets.

Lemma 2.2

([9]) Let G be a finite abelian group and let T be a multi-subset of G. Then, T is integral if and only if \(T\in C(G)\).

The irreducible representations of \(T_{4n}\) have been completely characterized, and we list them in the following lemma.

Lemma 2.3

([16]) The irreducible representations of \(T_{4n}\) are given in Table 1 if n is odd and in Table 2 otherwise, where i is the imaginary unit and \(\omega =e^\frac{\pi i}{n}\) is a primitive 2n-th root of unity.

Table 1 Inequivalent irreducible representation table of \(T_{4n}\) for odd n
Table 2 Inequivalent irreducible representation table of \(T_{4n}\) for even n

Let Cay(GS) be a connected Cayley graph with \(1\notin S\) and \(S^{-1}=S\). In correspondence with the orthonormal basis \(\{v_1^\rho ,v_2^\rho ,\ldots ,v_{d_\rho }^\rho \}\), we define \(\varphi _{s,t}^\rho (g)=\langle \rho (g)v_t^\rho ,v_s^\rho \rangle _{W_\rho }\), where \(W_\rho \) denotes the vector space corresponding to the representation \(\rho \). With the above notations, it has been proved that the distance matrices of Cayley graphs over any finite groups satisfy the following decomposed formula.

Lemma 2.4

([14]) Let G be a finite group with \(S\subseteq G,\) where \(1_G\notin S=S^{-1}\) and \(\langle S\rangle =G\). Let \(\rho _1,\rho _2,\ldots ,\rho _h\) be all inequivalent irreducible unitary representations of G with \(d_1,d_2,\ldots ,d_h\) as their degrees, respectively. Then, there exists an invertible matrix Q such that

$$\begin{aligned} QD_{Cay(G,S)}Q^{-1}=d_1\Phi (\rho _1)\bigoplus d_2\Phi (\rho _2)\bigoplus \cdots \bigoplus d_h\Phi (\rho _h), \end{aligned}$$

where \(\Phi (\rho _k)\) denotes the \(d_k\times d_k\) matrix whose (st)-entry is equal to \(\sum _{g\in G}d(1,g)\varphi _{s,t}^{\rho _k}(g)\) for \(s,t=1,2,\ldots ,d_k\) and \(k=1,2,\ldots ,h\).

The following properties about the dicyclic group \(T_{4n}\) immediately follow from the relations \(a^{2n}=1, a^n=b^2\) and \(b^{-1}ab=a^{-1},\) which can be found in [8].

Lemma 2.5

([8]) Let \(T_{4n}\) be the dicyclic group as defined in (1.1). Then, for all \(0\le k,m\le 2n-1,\) one has

  1. (i)

    \(ba^k=a^{-k}b, a^kb=ba^{-k};\)

  2. (ii)

    \(ba^kba^m=a^{n-k+m};\)

  3. (iii)

    \((ba^k)^{-1}=ba^{n+k}.\)

The following lemma is simple, but useful for the proofs of our main results.

Lemma 2.6

Let \(T_{4n}\) be the dicyclic group as defined in (1.1) and let \(S\subseteq T_{4n}\) with \(S^{-1}=S\) and \(\left< S\right>=T_{4n}\). Then, \(d(1,ba^k)=d(1,ba^{n+k})\) for \(0\le k\le n-1.\)

Proof

Note that for any \(g_1,g_2,h\in T_{4n}\), \(\{g_1,g_2\}\in E_{Cay(T_{4n},S)}\) if and only if \(\{hg_1,hg_2\}\in E_{Cay(T_{4n},S)}.\) Then, \(d(g_1,g_2)=d(hg_1,hg_2).\) Together with Lemma 2.5, we have

$$\begin{aligned} d(1,ba^k)=d(ba^{n+k},ba^{n+k}ba^k)=d(1,ba^{n+k}), \end{aligned}$$

as desired. \(\square \)

3 The proof of Theorem 1.1

In this section, we prove Theorem 1.1, which characterizes the equivalence of integrality and distance integrality of Cayley graphs over abelian groups.

The proof of Theorem 1.1

Let \(\rho \) be an irreducible representation of G, then \(d_\rho =1\). In view of Lemma 2.4, one has \(\Phi (\rho )=\sum _{g\in G}d(1,g)\rho (g)\). Thus, it follows from Lemma 2.2 that Cay(GS) is distance-integral if and only if \(\sum _{g\in G}d(1,g)g\in C(G)\). Consequently, by Lemma 2.1, it suffices to show that \(S\in B(G)\) if and only if \(\sum _{g\in G}d(1,g)g\in C(G)\).

Note that \(S=\{g\in G\,|\,d(1,g)=1\}\). The sufficiency is thus obvious. Suppose conversely that \({\widetilde{B}}(G)=\{[h_1],[h_2],\ldots ,[h_k]\}\) for some integer k. Let \(\langle g_1\rangle =\langle g_2\rangle \in {\widetilde{B}}(G)\) with \(d(1,g_1)=q\) and \(ord(g_1)=t\). Then, \(g_2=g_1^l\) for some integer l, which leads to \(\gcd (l,t)=1\). Assume that the order of G is n, then t is a divisor of n (abbreviated \(t\,|\,n\)). Thus, there exists a surjective group homomorphism \(f:{\mathbb {Z}}_n^*\rightarrow {\mathbb {Z}}_t^*\) such that \(f(x\pmod {n})=x\pmod {t}\), where \({\mathbb {Z}}_n^*=\{n'|\gcd (n',n)=1\}\).

Recall that \(l\in {\mathbb {Z}}_t^*\). Then, there exists \(y\in {\mathbb {Z}}_n^*\) such that \(f(y\pmod {n})=l\pmod {t}=y\pmod {t}\). Therefore, \(t\,|\,(l-y)\), which gives \(g_2=g_1^l=g_1^y\). Note that \(g_1\) can be expressed as \(g_1=z_1z_2\cdots z_q\), where \(z_i\in S\) for \(1\le i\le q\). Then, \(g_2=z_1^yz_2^y\cdots z_q^y\). Recall that \(\gcd (y,n)=1\), we thus have \(\gcd (y,ord(z_i))=1\), leading to \(z_i^y\in \langle z_i\rangle \subseteq S\) for all \(1\le i\le q\). Therefore, \(d(1,g_2)\le d(1,g_1)\). In a similar way, \(d(1,g_1)\le d(1,g_2)\). Consequently, \(d(1,g_1)=d(1,g_2)\) whenever \(\langle g_1\rangle =\langle g_2\rangle \) and therefore we conclude that \(\sum _{g\in G}d(1,g)g\in C(G)\) as desired.

This completes the proof. \(\square \)

4 The proof of Theorem 1.3

In this section, we prove Theorem 1.3, which studies the distance integrality of \(Cay(T_{4n},S)\). A necessary and sufficient condition for the distance integrality of \(Cay(T_{4n},S)\) is derived and some infinite families of distance-integral Cayley graphs over dicyclic groups are constructed.

The proof of Theorem 1.3

Let \(\rho \) be an irreducible representation of \(T_{4n}\). Then, \(d_\rho =1\) or \(d_\rho =2.\) In order to complete the proof, it suffices to consider the following two cases.

Case 1. \(d_\rho =1\). In this case, assume that \(W_\rho =\{\alpha v_1^\rho |\alpha \in {\mathbb {C}}\}.\) Then, it follows from Lemma 2.4 that

$$\begin{aligned} \Phi (\rho )= & {} \sum _{k=1}^{2n-1}d(1,a^k)\varphi _{1,1}^\rho (a^k)+\sum _{k=0}^{2n-1}d(1,ba^k)\varphi _{1,1}^\rho (ba^k)\nonumber \\= & {} \sum _{k=1}^{2n-1}d(1,a^k)\langle \rho (a^k)v_1^\rho ,v_1^\rho \rangle +\sum _{k=0}^{2n-1}d(1,ba^k)\langle \rho (ba^k)v_1^\rho ,v_1^\rho \rangle \nonumber \\= & {} \sum _{k=1}^{2n-1}d(1,a^k)\rho (a^k)+\sum _{k=0}^{2n-1}d(1,ba^k)\rho (ba^k). \end{aligned}$$
(4.1)

By Lemma 2.3, both \(d(1,a^k)\) and \(\rho (a^k)\) are integers, which implies that \(\sum _{k=1}^{2n-1}d(1,a^k)\rho (a^k)\) is an integer. Therefore, only \(\sum _{k=0}^{2n-1}d(1,ba^k)\rho (ba^k)\) requires further considerations. If n is even, then both \(d(1,ba^k)\) and \(\rho (ba^k)\) are integers, and thus, \(\Phi (\rho )\) is an integer by (4.1). If n is odd, then k and \(n+k\) have different parity. Combining with Lemmas 2.3 and 2.6, we have \(\sum _{k=0}^{2n-1}d(1,ba^k)\rho (ba^k)=0\). Consequently, \(\Phi (\rho )\) is also an integer in this case.

Case 2. \(d_\rho =2\). By Lemma 2.3, we have \(\rho \in \{\phi _j\,|\,1\le j\le n-1, j ~\hbox {is odd}\}\bigcup \left\{ \zeta _h\,|\,1\le h\le \left\lfloor \frac{n-1}{2}\right\rfloor \right\} \). Then, we proceed by distinguishing the following two possible subcases to complete the proof.

Subcase 2.1. \(\rho \in \{\phi _j\,|\,1\le j\le n-1, j ~\hbox {is odd}\}.\) Assume that \(W_\rho =\left\{ \beta v_1^\rho +\gamma v_2^\rho \,|\,\beta ,\gamma \in {\mathbb {C}}\right\} ,\) where \(\left\{ v_1^\rho ,v_2^\rho \right\} \) is an orthonormal basis corresponding to \(\rho \). Then, it follows from Lemma 2.3 that there exists an odd \(j\in [1,n]\) such that

$$\begin{aligned} \left\{ \!\! \begin{array}{l} \rho (a^k)v_1^\rho =\omega ^{kj}v_1^\rho ,\\ \rho (a^k)v_2^\rho =\omega ^{-kj}v_2^\rho ,\\ \rho (ba^k)v_1^\rho =-\omega ^{kj}v_2^\rho ,\\ \rho (ba^k)v_2^\rho =\omega ^{-kj}v_1^\rho \end{array} \right. \end{aligned}$$

for all \(0\le k\le 2n-1\). This gives

$$\begin{aligned} \left\{ \!\! \begin{array}{l} \varphi _{1,1}^\rho (a^k)=\langle \rho (a^k)v_1^\rho ,v_1^\rho \rangle =\langle \omega ^{kj}v_1^\rho ,v_1^\rho \rangle =\omega ^{kj},\\ \varphi _{1,1}^\rho (ba^k)=\langle \rho (ba^k)v_1^\rho ,v_1^\rho \rangle =\langle -\omega ^{kj}v_2^\rho ,v_1^\rho \rangle =0,\\ \varphi _{1,2}^\rho (a^k)=\langle \rho (a^k)v_2^\rho ,v_1^\rho \rangle =\langle \omega ^{-kj}v_2^\rho ,v_1^\rho \rangle =0,\\ \varphi _{1,2}^\rho (ba^k)=\langle \rho (ba^k)v_2^\rho ,v_1^\rho \rangle =\langle \omega ^{-kj}v_1^\rho ,v_1^\rho \rangle =\omega ^{-kj},\\ \varphi _{2,1}^\rho (a^k)=\langle \rho (a^k)v_1^\rho ,v_2^\rho \rangle =\langle \omega ^{kj}v_1^\rho ,v_2^\rho \rangle =0,\\ \varphi _{2,1}^\rho (ba^k)=\langle \rho (ba^k)v_1^\rho ,v_2^\rho \rangle =\langle -\omega ^{kj}v_2^\rho ,v_2^\rho \rangle =-\omega ^{kj},\\ \varphi _{2,2}^\rho (a^k)=\langle \rho (a^k)v_2^\rho ,v_2^\rho \rangle =\langle \omega ^{-kj}v_2^\rho ,v_2^\rho \rangle =\omega ^{-kj},\\ \varphi _{2,2}^\rho (ba^k)=\langle \rho (ba^k)v_2^\rho ,v_2^\rho \rangle =\langle \omega ^{-kj}v_1^\rho ,v_2^\rho \rangle =0 \end{array} \right. \end{aligned}$$
(4.2)

for \(k=0,1,\ldots ,2n-1.\) Combining Lemma 2.4 with (4.2) yields that

$$\begin{aligned} \Phi (\rho )= & {} \left( \begin{array}{cc} \sum _{g\in T_{4n}}d(1,g)\varphi _{1,1}^\rho (g) &{} \sum _{g\in T_{4n}}d(1,g)\varphi _{1,2}^\rho (g) \\ \sum _{g\in T_{4n}}d(1,g)\varphi _{2,1}^\rho (g) &{} \sum _{g\in T_{4n}}d(1,g)\varphi _{2,2}^\rho (g) \\ \end{array} \right) \nonumber \\= & {} \left( \begin{array}{ll} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{kj}&{} \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-kj} \\ -\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{kj} &{} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{-kj} \\ \end{array} \right) . \end{aligned}$$
(4.3)

Note that \(d(1,a^k)=d(1,a^{-k})\) for all \(0\le k\le 2n-1\). Hence, we have

$$\begin{aligned} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{-kj}=\sum _{k=1}^{2n-1}d(1,a^{-k})\omega ^{kj}=\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{kj}. \end{aligned}$$
(4.4)

It follows from Lemma 2.6 that

$$\begin{aligned} \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{kj}= & {} \sum _{k=0}^{n-1}\left[ d(1,ba^k)\omega ^{kj}+d(1,ba^{n+k})\omega ^{(n+k)j}\right] \nonumber \\= & {} \sum _{k=0}^{n-1}d(1,ba^k)\omega ^{kj}(1+\omega ^{nj})\nonumber \\= & {} \sum _{k=0}^{n-1}d(1,ba^k)\omega ^{kj}\left[ 1+(-1)^{j}\right] =0. \end{aligned}$$
(4.5)

Substituting (4.4) and (4.5) into (4.3) yields that

$$\begin{aligned} \Phi (\rho )=\left( \begin{array}{cc} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{kj}&{} \mathbf{0} \\ \mathbf{0} &{} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{kj} \\ \end{array} \right) . \end{aligned}$$

Therefore, the eigenvalues of \(\Phi (\rho )\) are \(x_1=x_2=\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{kj},\) which means that both \(x_1\) and \(x_2\) are integers if and only if \(\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{kj}\) is an integer.

Subcase 2.2. \(\rho \in \left\{ \zeta _h\,|\,1\le h\le \left\lfloor \frac{n-1}{2}\right\rfloor \right\} \). Assume that \(W_\rho =\left\{ \eta u_1^\rho +\theta u_2^\rho \,|\,\eta ,\theta \in {\mathbb {C}}\right\} ,\) where \(\left\{ u_1^\rho ,u_2^\rho \right\} \) is an orthonormal basis corresponding to \(\rho \). Then, in view of Lemma 2.3, there exists \(h\in \left[ 1,\left\lfloor \frac{n-1}{2}\right\rfloor \right] \) such that

$$\begin{aligned} \left\{ \!\! \begin{array}{l} \rho (a^k)u_1^\rho =\omega ^{2kh}u_1^\rho ,\\ \rho (a^k)u_2^\rho =\omega ^{-2kh}u_2^\rho ,\\ \rho (ba^k)u_1^\rho =\omega ^{2kh}u_2^\rho ,\\ \rho (ba^k)u_2^\rho =\omega ^{-2kh}u_1^\rho \end{array} \right. \end{aligned}$$

for all \(0\le k\le 2n-1\). Thus, we have

$$\begin{aligned} \left\{ \!\! \begin{array}{l} \varphi _{1,1}^\rho (a^k)=\langle \rho (a^k)u_1^\rho ,u_1^\rho \rangle =\langle \omega ^{2kh}u_1^\rho ,u_1^\rho \rangle =\omega ^{2kh},\\ \varphi _{1,1}^\rho (ba^k)=\langle \rho (ba^k)u_1^\rho ,u_1^\rho \rangle =\langle \omega ^{2kh}u_2^\rho ,u_1^\rho \rangle =0,\\ \varphi _{1,2}^\rho (a^k)=\langle \rho (a^k)u_2^\rho ,u_1^\rho \rangle =\langle \omega ^{-2kh}u_2^\rho ,u_1^\rho \rangle =0,\\ \varphi _{1,2}^\rho (ba^k)=\langle \rho (ba^k)u_2^\rho ,u_1^\rho \rangle =\langle \omega ^{-2kh}u_1^\rho ,u_1^\rho \rangle =\omega ^{-2kh},\\ \varphi _{2,1}^\rho (a^k)=\langle \rho (a^k)u_1^\rho ,u_2^\rho \rangle =\langle \omega ^{2kh}u_1^\rho ,u_2^\rho \rangle =0,\\ \varphi _{2,1}^\rho (ba^k)=\langle \rho (ba^k)u_1^\rho ,u_2^\rho \rangle =\langle \omega ^{2kh}u_2^\rho ,u_2^\rho \rangle =\omega ^{2kh},\\ \varphi _{2,2}^\rho (a^k)=\langle \rho (a^k)u_2^\rho ,u_2^\rho \rangle =\langle \omega ^{-2kh}u_2^\rho ,u_2^\rho \rangle =\omega ^{-2kh},\\ \varphi _{2,2}^\rho (ba^k)=\langle \rho (ba^k)u_2^\rho ,u_2^\rho \rangle =\langle \omega ^{-2kh}u_1^\rho ,u_2^\rho \rangle =0 \end{array} \right. \end{aligned}$$
(4.6)

for \(k=0,1,\ldots ,2n-1.\) By Lemma 2.4 and (4.6), one has

$$\begin{aligned} \Phi (\rho )= & {} \left( \begin{array}{cc} \sum _{g\in T_{4n}}d(1,g)\varphi _{1,1}^\rho (g) &{} \sum _{g\in T_{4n}}d(1,g)\varphi _{1,2}^\rho (g) \\ \sum _{g\in T_{4n}}d(1,g)\varphi _{2,1}^\rho (g) &{} \sum _{g\in T_{4n}}d(1,g)\varphi _{2,2}^\rho (g) \\ \end{array} \right) \\= & {} \left( \begin{array}{ll} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}&{} \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh} \\ \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh} &{} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{-2kh} \\ \end{array} \right) \\= & {} \left( \begin{array}{ll} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}&{} \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh} \\ \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh} &{} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh} \end{array} \right) , \end{aligned}$$

where the last equality follows from (4.4). Therefore,

$$\begin{aligned} \det \left( xI_2-\Phi (\rho )\right)= & {} \left| \begin{array}{cc} x-\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh} &{} -\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh} \\ -\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh} &{} x-\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh} \end{array} \right| \\= & {} \left( x-\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}\right) ^2-\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}. \end{aligned}$$

Consequently, the eigenvalues of \(\Phi (\rho )\) are

$$\begin{aligned} x_1'= & {} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}+\sqrt{\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}}, \end{aligned}$$
(4.7)
$$\begin{aligned} x_2'= & {} \sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}-\sqrt{\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}}. \end{aligned}$$
(4.8)

If both \(x_1'\) and \(x_2'\) are integers, then by (4.7)–(4.8), \(\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}=\frac{x_1'+x_2'}{2}\) is a rational number. Note that \(\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}\) is an algebraic integer. Hence, \(\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}\) is thus forced to be an integer. By (4.7) \(\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}\) is a square number. Conversely, if \(\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}\) is an integer and \(\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}\) is a square number, then both \(x_1'\) and \(x_2'\) are integers (based on (4.7)–(4.8)).

Therefore, both \(x_1'\) and \(x_2'\) are integers if and only if \(\sum _{k=1}^{2n-1}d(1,a^k)\omega ^{2kh}\) is an integer and \(\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}\) is a square number.

Consequently, by Cases 1 and 2, Lemma 2.2 and with the arbitrariness of \(\rho \), we obtain that \(Cay(T_{4n},S)\) is distance-integral if and only if \(\sum _{k=1}^{2n-1}d(1,a^k)a^k\in C(a)\) and

$$\begin{aligned} \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh} \end{aligned}$$

is a square number for all \(1\le h\le \left\lfloor \frac{n-1}{2}\right\rfloor \).

This completes the proof. \(\square \)

Example 4.1

Let \(T_{16}=\big \langle a,b\,\big {|}\,a^{8}=1, a^4=b^2, b^{-1}ab=a^{-1}\big \rangle =\big \{1,a,\ldots ,a^7,b,ba,\ldots ,ba^7\big \}\) be the dicyclic group of order 16 and \(S=\{a,a^3,a^5,a^7,b,ba^4\}\). Then,

$$\begin{aligned} {\widetilde{B}}(\langle a\rangle )=\left\{ \{1\},\{a,a^3,a^5,a^7\},\{a^2,a^6\},\{a^4\}\right\} . \end{aligned}$$
(4.9)

Note that for any \(g\in G\),

$$\begin{aligned} d(1,g)=\left\{ \begin{array}{ll} \min \left\{ k\,|\,g=s_1s_2\cdots s_k,\{s_1,s_2,\ldots ,s_k\}\subseteq S\right\} , &{} \hbox {if }g\ne 1; \\ 0, &{} \hbox {if }g=1. \end{array} \right. \end{aligned}$$

Then, by a direct calculation, one has

$$\begin{aligned}&d(1,a)=d(1,a^3)=d(1,a^5)=d(1,a^7)=1, \\&d(1,ba)=d(1,ba^3)=d(1,ba^5)=d(1,ba^7)=2, \\&d(1,b)=d(1,ba^4)=1, \ \ d(1,a^2)=d(1,a^4)=d(1,a^6)=2,\\&d(1,ba^2)=d(1,ba^6)=3. \end{aligned}$$

Then, in view of (4.9), we obtain

$$\begin{aligned} \sum _{k=1}^{7}d(1,a^k)a^k=a+a^3+a^5+a^7+2(a^2+a^6)+2a^4\in C(a) \end{aligned}$$

and

$$\begin{aligned}&\sum _{k=0}^{7}d(1,ba^k)\omega ^{2k}\cdot \sum _{k=0}^{7}d(1,ba^k)\omega ^{-2k}=(1+2\omega ^2+3\omega ^4+2\omega ^6+\omega ^8+2\omega ^{10}+3\omega ^{12}+2\omega ^{14})\\&\quad (1+2\omega ^{-2} +3\omega ^{-4}+2\omega ^{-6}+\omega ^{-8}+2\omega ^{-10}+3\omega ^{-12}+2\omega ^{-14})\\&\quad =16 \end{aligned}$$

is a square number. Therefore, by Theorem 1.3, \(Cay(T_{16},S)\) is distance-integral. In fact, it is routine to check that

$$\begin{aligned} D_{Cay(T_{16},S)}=\left( \begin{array}{cccccccccccccccc} 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 \\ 1&{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{} \quad 1 &{}\quad 2 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 \\ 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 \\ 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 \\ 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 \\ 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 \\ 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2\\ 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 \\ 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 \\ 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 1&{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 \\ 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 \\ 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 \\ 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 1 \\ 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 2 \\ 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0 &{}\quad 1 \\ 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 2 &{}\quad 1 &{}\quad 0\\ \end{array} \right) \end{aligned}$$

Then, the distance spectrum of \(Cay(T_{16},S)\) is \(\left\{ 26,2^{[4]},(-2)^{[8]},(-6)^{[3]}\right\} \), where superscripts denote multiplicities. Thus, \(Cay(T_{16},S)\) is distance-integral.

By Theorem 1.3, we can obtain infinite families of distance-integral Cayley graphs over dicyclic groups according to the following corollary.

Corollary 4.2

Let \(T_{4n}\) be the dicyclic group as defined in (1.1). Choose \(S\subseteq T_{4n}\) such that \(1\notin S, S^{-1}=S\) and \(\langle S\rangle =T_{4n}\). If S can be partitioned as \(S:=S_1\cup b S_2 \subseteq T_{4n}\) with \(S_1, S_2 \subseteq \langle a\rangle \) and \(S_2^{-1}=S_2,\) then \(Cay(T_{4n},S)\) is distance-integral if and only if \(\sum _{k=1}^{2n-1}d(1,a^k)a^k\in C(a)\) and \(\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}\in C\left( a^2\right) \).

Proof

First note that \(S^{-1}=S\) if and only if \(S_1^{-1}=S_1\) and \(S_2=a^nS_2\). Then, we show that \(d(1,ba^k)=d(1,ba^{-k})\) for all \(0\le k\le 2n-1\). Assume that \(ba^k\) can be expressed as \(ba^k=x_1x_2\cdots x_r\), where \(x_j\in S_1\) or \(x_j=bs_j\in bS_2\) for \(1\le j\le r\). Then, by Lemma 2.5 one has

$$\begin{aligned} ba^{-k}=b^3(ba^k)b=b^3x_1x_2\cdots x_rb=\left\{ \begin{array}{ll} (b^3x_1x_2\cdots x_{r-1}b)x_r^{-1}, &{} \hbox {if }x_r\in S_1; \\ (b^3x_1x_2\cdots x_{r-1}b)bs_r^{-1}, &{} \hbox {if }x_r=bs_r\in bS_2. \end{array} \right. \end{aligned}$$

Iterating the above argument yields

$$\begin{aligned} ba^{-k}=x_1'x_2'\cdots x_r',~ \hbox {where}~~x_j'=\left\{ \begin{array}{ll} x_j^{-1}, &{} \hbox {if }x_j\in S_1; \\ bs_j^{-1}, &{} \hbox {if }x_j=bs_j\in bS_2 \end{array} \right. ~ \hbox {for}~~j=1,2,\ldots ,r. \end{aligned}$$

Note that \(S_1^{-1}=S_1\) and \(S_2^{-1}=S_2\). Then, \(x_j'\in S\) for all \(1\le j\le r\). Recall that

$$\begin{aligned} d(1,g)=\left\{ \begin{array}{ll} \min \left\{ k\,|\,g=s_1s_2\cdots s_k,\{s_1,s_2,\ldots ,s_k\}\subseteq S\right\} , &{} \hbox {if }g\ne 1; \\ 0, &{} \hbox {if }g=1. \end{array} \right. \end{aligned}$$

Hence \(d(1,ba^{-k})\le d(1,ba^k)\). Similarly, \(d(1,ba^k)\le d(1,ba^{-k})\). Therefore, \(d(1,ba^{-k})=d(1,ba^k)\), which implies that

$$\begin{aligned} \sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{-2kh}=\sum _{k=0}^{2n-1}d(1,ba^{-k})\omega ^{2kh}=\sum _{k=0}^{2n-1}d(1,ba^k)\omega ^{2kh}. \end{aligned}$$

The desired result then follows from Theorem 1.3 and Lemma 2.2. \(\square \)

The following corollary gives a necessary condition for \(Cay(T_{4n},S)\) to be distance-integral.

Corollary 4.3

Let \(T_{4n}\) be the dicyclic group as defined in (1.1). Choose \(S\subseteq T_{4n}\) such that \(1\notin S, S^{-1}=S\) and \(\langle S\rangle =T_{4n}\). If \(Cay(T_{4n},S)\) is distance-integral, then \(\sum _{k=1}^{2n-1}d(1,a^k)a^k\in C(a)\) and \( \sum _{k=0}^{2n-1}d(1,ba^k)a^{2k}\cdot \sum _{k=0}^{2n-1}d(1,ba^k)a^{-2k}\in C\left( a^2\right) \).

5 The proof of Theorem 1.4

In this section, we prove Theorem 1.4. In the following, we discuss the distance integrality of Cayley graphs over dicyclic groups \(T_{4p}\) for primes \(p\ge 3\). All distance-integral Cayley graphs over \(T_{4p}\) for a prime \(p\ge 3\) are completely determined.

Proof of Theorem 1.4

Assume that \(S_1\) and \(S_2\) satisfy the sufficient conditions of our result and we aim to show that \(Cay(T_{4p},S)\) is distance-integral. By Theorem 1.3, \(Cay(T_{4p},S)\) is distance-integral if and only if \(\sum _{k=1}^{2p-1}d\left( 1,a^k\right) \omega ^{kj}\) is an integer for all \(1\le j\le p\) and \(\sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{2kh}\cdot \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{-2kh} \) is a square number for all \(1\le h\le \frac{p-1}{2}\).

If \(S_1=\emptyset \) and \(S_2=\langle a\rangle \), then \(d\left( 1,a^l\right) =2\) for \(1\le l\le 2p-1\), \(d\left( 1,ba^{l'}\right) =1\) for \(0\le l'\le 2p-1\), and thus,

$$\begin{aligned} \sum _{k=1}^{2p-1}d\left( 1,a^k\right) \omega ^{kj}= & {} 2\sum _{k=1}^{2p-1}\omega ^{kj}=-2,\ \ \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{2kh}\\&\quad \cdot \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{-2kh}=0. \end{aligned}$$

If \(S_1=\emptyset \) and \(S_2=\langle a\rangle {\setminus }\left\{ a^k,a^{p+k}\right\} \) for some \(0\le k\le p-1\), then it is direct to verify that \(d(1,a^l)=2\) for \(1\le l\le 2p-1\), \(d(1,ba^{l'})=1\) for \(~l'\notin \{k,p+k\}\) and \(d(1,ba^k)=d(1,ba^{p+k})=3\), which leads to

$$\begin{aligned} \sum _{k=1}^{2p-1}d\left( 1,a^k\right) \omega ^{kj}=2\sum _{k=1}^{2p-1}\omega ^{kj}=-2 \end{aligned}$$

and

$$\begin{aligned} \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{2kh}\cdot \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{-2kh}=4\omega ^{2kh}\cdot 4\omega ^{-2kh}=16. \end{aligned}$$

In a similar way, if \(S_1=\{a^p\}\) and \(S_2\in \left\{ \langle a\rangle {\setminus }\{a^k,a^{p+k}\},\langle a\rangle \right\} \), then \(\sum _{k=1}^{2p-1}d(1,a^k)\omega ^{kj}\in \{0,-2\}\) is an integer and \(\sum _{k=0}^{2p-1}d(1,ba^k)\omega ^{2kh}\cdot \sum _{k=0}^{2p-1}d(1,ba^k)\omega ^{-2kh}\in \{0,4\}\) is a square number.

If

$$\begin{aligned} S_1\in \left\{ [a],[a^2],[a]\cup \{a^p\},[a^2]\cup \{a^p\},\langle a\rangle {\setminus }\{1,a^p\},\langle a\rangle {\setminus }\{1\}\right\} \end{aligned}$$

and

$$\begin{aligned} S_2\in \left\{ \{a^k,a^{p+k}\}, \langle a\rangle {\setminus }\{a^k,a^{p+k}\},\langle a\rangle \right\} , \end{aligned}$$

then \(\sum _{k=1}^{2p-1}d(1,a^k)\omega ^{kj}\in \{-4,-2,-1,0\}\) is an integer and

$$\begin{aligned} \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{2kh}\cdot \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \omega ^{-2kh}\in \{0,1,4\} \end{aligned}$$

is a square number.

Now assume conversely that \(Cay(T_{4p},S)\) is distance-integral. Since \(p\ge 3\) is a prime number, we have

$$\begin{aligned} {\widetilde{B}}\left( \langle a\rangle \right) =&\left\{ \{1\},\left\{ a^p\right\} ,\left\{ a,a^3,\ldots ,a^{p-2},\ldots ,a^{p+2},\ldots ,a^{2p-1}\right\} ,\right. \\&\ \ \ \ \ \ \ \ \ \ \ \ \left. \left\{ a^2,a^4,\ldots ,a^{p-1},\ldots ,a^{p+1},\ldots ,a^{2p-2}\right\} \right\} . \end{aligned}$$

It follows from Corollary 4.3 that

$$\begin{aligned} \sum _{k=1}^{2p-1}d(1,a^k)a^k\in C(a),\ \ \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) a^{2k}\cdot \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) a^{-2k}\in C\left( a^2\right) . \end{aligned}$$

Then, we have

$$\begin{aligned} \left\{ \begin{array}{l} d(1,a)=d\left( 1,a^3\right) =\cdots =d\left( 1,a^{p-2}\right) =d\left( 1,a^{p+2}\right) =\cdots =d\left( 1,a^{2p-1}\right) ;\\ d(1,a^2)=d\left( 1,a^4\right) =\cdots =d\left( 1,a^{p-1}\right) =d\left( 1,a^{p+1}\right) =\cdots =d\left( 1,a^{2p-2}\right) \end{array} \right. \end{aligned}$$
(5.10)

and

$$\begin{aligned}&\left[ \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) a^{2k}\right] \left[ \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) a^{-2k}\right] \nonumber \\&\quad =2\sum _{k=0}^{2p-1}\left[ d\left( 1,ba^k\right) \right] ^2+m\left( a^2+a^4+\cdots +a^{2p-2}\right) , \end{aligned}$$
(5.11)

where m is a non-negative integer. Taking the trivial representation of \(\langle a^2\rangle \) on both sides of (5.11) yields

$$\begin{aligned} \left[ \sum _{k=0}^{2p-1}d\left( 1,ba^k\right) \right] ^2=2\sum _{k=0}^{2p-1}\left[ d\left( 1,ba^k\right) \right] ^2+(p-1)m. \end{aligned}$$
(5.12)

Recall that \(\chi _h\left[ \sum _{k=0}^{2p-1}d(1,ba^k)a^{2k}\cdot \sum _{k=0}^{2p-1}d(1,ba^k)a^{-2k}\right] \) is a square number for all \(1\le h\le \frac{p-1}{2}.\) Hence, there exists an integer t such that

$$\begin{aligned} t^2=2\sum _{k=0}^{2p-1}\left[ d\left( 1,ba^k\right) \right] ^2-m. \end{aligned}$$
(5.13)

Note that \(S=S^{-1}\) if and only if \(S_1=S_1^{-1}\) and \(S_2=a^pS_2\). Then, \(a^k\in S_2\) if and only if \(a^{p+k}\in S_2\) for all \(0\le k\le p-1\). In the following, we proceed by distinguishing the following two cases to show our result.

Case 1. \(\{a,a^2\}\bigcap S_1\ne \emptyset \). It follows from (5.10) that

$$\begin{aligned} S_1\in \left\{ [a],[a^2],[a]\cup \{a^p\},[a^2]\cup \{a^p\},\langle a\rangle {\setminus }\{1,a^p\},\langle a\rangle {\setminus }\{1\}\right\} . \end{aligned}$$

Then, it is routine to check that

$$\begin{aligned} d(1,ba^{k})=\left\{ \begin{array}{ll} 1, &{} \hbox {if }a^{k}\in S_2; \\ 2, &{} \hbox {if }a^{k}\notin S_2. \end{array} \right. \end{aligned}$$
(5.14)

Assume that \(|S_2|=2x\), then \(1\le x\le p\) by the fact that \(\langle S\rangle =T_{4n}\). Substituting (5.14) into (5.12) and (5.13) yields

$$\begin{aligned}{}[2x+2(2p-2x)]^2=2[2x+4(2p-2x)]+(p-1)m,\quad t^2=2[2x+4(2p-2x)]-m. \end{aligned}$$

Then, we obtain \(p(x-t^2)=(x+t)(x-t).\) Therefore, \(p\,|\,(x+t)\) or \(p\,|\,(x-t)\). Note that \(t^2\le 4(4p-3x)\le 4p^2\), we have \(x+t,x-t\in \{-p,0,p,2p,3p\}.\) If \(x+t=-p\), then \(x-t^2=t-x\). Thus, \(x^2+(2p-3)x+p(p-1)=0\) has no real roots, which is impossible. Similarly, all the possible cases lead to \(x\in \{1,p-1,p\}\), implying that \(S_2\in \left\{ \{a^k,a^{p+k}\},\langle a\rangle {\setminus }\{a^k,a^{p+k}\},\langle a\rangle \right\} \) for \(0\le k\le p-1\), as desired.

Case 2. \(\{a,a^2\}\bigcap S_1=\emptyset \). In this case, \(S_1=\emptyset \) or \(S_1=\{a^p\}\) (based on (5.10)). Then, we have \(|S_2|\ge 4\) due to \(S^{-1}=S\) and \(\langle S\rangle =G\). Assume that \(a^k=x_1x_2\cdots x_t\) with \(x_j\in S\) for all \(1\le j\le t\). Then, there exists \(x_l\ (1\le l\le t)\) such that \(x_l=bs_l\in bS_2\). Together with Lemma 2.5, one has

$$\begin{aligned} a^{p+k}=(x_1x_2\cdots x_t)a^p=x_1\cdots x_{l-1}(ba^ps_l)x_{l+1}\cdots x_t \end{aligned}$$

Note that \(S=S^{-1}\) if and only if \(S_1=S_1^{-1}\) and \(S_2=a^pS_2\). Hence, for \(s_l\in S_2\), we have \(a^ps_l\in S_2\). Recall that

$$\begin{aligned} d(1,g)=\left\{ \begin{array}{ll} \min \left\{ q\,|\,g=s_1s_2\cdots s_k,\{s_1,s_2,\ldots ,s_q\}\subseteq S\right\} , &{} \hbox {if }g\ne 1;\\ 0, &{} \hbox {if }g=1. \end{array} \right. \end{aligned}$$

Then, \(d\left( 1,a^{p+k}\right) \le d\left( 1,a^k\right) \). Similarly, \(d\left( 1,a^{p}\right) \le d\left( 1,a^{p+k}\right) \). Therefore, for all \(0\le k\le n-1\), one has \(d(1,a^k)=d(1,a^{p+k})\). Combining with (5.10) we have

$$\begin{aligned} d(1,a)=d\left( 1,a^2\right) =\cdots =d\left( 1,a^{p-1}\right) =d\left( 1,a^{p+1}\right) =\cdots =d\left( 1,a^{2p-1}\right) . \end{aligned}$$
(5.15)

Assume that \(\{a^{j_1},a^{j_2},a^{p+j_1},a^{p+j_2}\}\subseteq S_2\) with \(0\le j_1<j_2\le p-1\). Then, \(d(1,a^{j_2-j_1})=d(1,ba^{j_1}\cdot ba^{p+j_2})=2\). In view of (5.15), one has \( d(1,a)=d\left( 1,a^2\right) =\cdots =d\left( 1,a^{p-1}\right) =d\left( 1,a^{p+1}\right) =\cdots =d\left( 1,a^{2p-1}\right) =2\), which implies that

$$\begin{aligned} d\left( 1,ba^{j}\right) =\left\{ \begin{array}{ll} 1, &{} \hbox {if }a^{j}\in S_2;\\ 3, &{} \hbox {if }a^{j}\notin S_2. \end{array} \right. \end{aligned}$$
(5.16)

Assume that \(|S_2|=2y\), then \(2\le y\le p\). Substituting (5.16) into (5.12) and (5.13) yields

$$\begin{aligned}{}[2y+3(2p-2y)]^2=2[2y+9(2p-2y)]+(p-1)m,\ \ t^2=2[2y+9(2p-2y)]-m. \end{aligned}$$

Then, we obtain \(p(16y-t^2)=(4y+t)(4y-t).\) Therefore, \(p\,|\,(4y+t)\) or \(p\,|\,(4y-t)\). Note that \(t^2\le 4(9p-8y)\le 4(p+1)^2\), we have \(4y+t,4y-t\in \{-p,0,p,2p,3p,4p,5p,6p\}.\) If \(4y+t=-p\), then \(4y-t=t^2-16y\). Thus, \(16y^2+8(p-3)y+p(p-1)=0\) has no real roots, which is impossible. Similarly, all the possible cases lead to \(y\in \{p-1,p\}\), implying that \(S_2\in \left\{ \langle a\rangle {\setminus }\{a^k,a^{p+k}\},\langle a\rangle \right\} \) for \(0\le k\le p-1\).

This completes the proof. \(\square \)