1 Introduction

A bounded measurable subset \(\Omega \subseteq \mathbb {R}^{n}\) with \(\mu (\Omega )>0\) is called spectral, if there is a subset \(\Lambda \subseteq \mathbb {R}^{n}\) such that the set of exponential functions \(\{e_{\lambda }(x)\}_{\lambda \in \Lambda }\) is a complete orthogonal basis, where \(e_{\lambda }(x)=e^{2\pi i\langle \lambda ,x\rangle }\). In this case, \(\Lambda \) is called the spectrum of \(\Omega \), and \((\Omega ,\Lambda )\) is called a spectral pair in \(\mathbb {R}^n\).

A subset \(A\subseteq \mathbb {R}^{n}\) tiles \(\mathbb {R}^{n}\) by translation, if there is a set \(T\subseteq \mathbb {R}^{n}\) such that almost all elements of \(\mathbb {R}^{n}\) can be uniquely written as a sum \(a+t\), where \(a\in A\), \(t\in T\). We will denote this by \(A\oplus T=\mathbb {R}^{n}\). T is called the tiling complement of A, and (AT) is called a tiling pair in \(\mathbb {R}^{n}\).

In 1974, Fuglede [11] proposed the following conjecture, which connected these two notions.

Conjecture 1.1

A subset \(\Omega \subseteq \mathbb {R}^{n}\) of positive and finite Lebesgue measure is a spectral set if and only if it tiles \(\mathbb {R}^{n}\) by translation.

In the same paper, Fuglede proved this conjecture when the tiling complement or the spectrum is a lattice in \(\mathbb {R}^n\). 30 years later, Tao [35] disproved this conjecture by constructing a non-tile spectral set in \(\mathbb {R}^5\). Currently, the conjecture does not hold in both directions for \(\mathbb {R}^n\), \(n\ge 3\) [9, 18, 19, 27]. However, this conjecture remains open in \(\mathbb {R}\) and \(\mathbb {R}^2\).

Given the falsification of Fuglede’s conjecture for \(\mathbb {R}^n\), \(n\ge 3\), researchers approached this problem from two perspectives. Firstly, under additional assumptions, Iosevich, Katz and Tao [13] showed that the conjecture holds for convex sets in \(\mathbb {R}^{2}\) in 2003, and Greenfeld and Lev [12] later proved a similar result in dimension 3. Recently, Lev and Matolcsi [24] demonstrated that the conjecture holds for convex domains in \(\mathbb {R}^{n}\) for all n. Secondly, researchers attempted to identify for which groups G, the conjecture holds. Fan et al. [7, 8] proved its validity in \(\mathbb {Q}_{p}\), the field of p-adic numbers, and it is known to hold in various finite Abelian groups such as \(\mathbb {Z}_{p}^{d}\) (\(p=2\) and \(d\le 6\); p is an odd prime and \(d=2\); \(p=3,5,7\) and \(d=3\)) [1, 5, 10, 14], \(\mathbb {Z}_{p}\times \mathbb {Z}_{p^{n}}\) [14, 31, 36], \(\mathbb {Z}_{p}\times \mathbb {Z}_{pq}\) [15] and \(\mathbb {Z}_{pq}\times \mathbb {Z}_{pq}\) [6], \(\mathbb {Z}_{p^{n}}\) [20], \(\mathbb {Z}_{p^{n}q^{m}}\) (\(p<q\) and \(m\le 9\) or \(n\le 6\); \(p^{m-2}<q^{4}\)) [16, 25, 26], \(\mathbb {Z}_{pqr}\) [30], \(\mathbb {Z}_{p^{2}qr}\) [32] and \(\mathbb {Z}_{pqrs}\) [17], where pqrs are distinct primes.

In this paper, we focus on finite cyclic groups. Following the notations from [4], write \(S-T(G)\) (respectively, \(T-S(G)\)), if the “Spectral \(\Rightarrow \) Tile” (respectively, “Tile \(\Rightarrow \) Spectral”) direction of Fuglede’s conjecture holds in G. Then we have the following relations [3, 4]:

$$\begin{aligned} T-S(\mathbb {R})\Leftrightarrow T-S(\mathbb {Z})\Leftrightarrow T-S(\mathbb {Z}_{N})\text { for all }N, \end{aligned}$$

and

$$\begin{aligned} S-T(\mathbb {R})\Rightarrow S-T(\mathbb {Z})\Rightarrow S-T(\mathbb {Z}_{N})\text { for all }N. \end{aligned}$$

The above relations show that finite cyclic groups play important roles in the study of Fuglede’s conjecture in \(\mathbb {R}\). As we have seen, Fuglede’s conjecture holds in the following finite cyclic groups: \(\mathbb {Z}_{p^{n}}\), \(\mathbb {Z}_{p^{n}q^{m}}\) (\(p<q\) and \(m\le 9\) or \(n\le 6\); \(p^{m-2}<q^{4}\)), \(\mathbb {Z}_{pqr}\), \(\mathbb {Z}_{p^{2}qr}\) and \(\mathbb {Z}_{pqrs}\), where pqrs are distinct primes. For the direction “Tile \(\Rightarrow \) Spectral”, Łaba [20] proved \(T-S(\mathbb {Z}_{p^nq^m})\) for distinct primes pq. Later, Łaba and Meyerowitz proved \(T-S(\mathbb {Z}_{n})\) in comments of Tao’s blog [34] (see also [30]), where n is a squarefree integer. Recently, Malikiosis [25] proved \(T-S(\mathbb {Z}_{p_{1}^{n}p_2\cdots p_k})\), where \(p_1,p_2,\dots ,p_k\) are distinct primes. In [21,22,23], the authors developed some new tools to study tiling sets in cyclic groups and proved \(T-S(\mathbb {Z}_{p^2q^2r^2})\), where pqr are distinct primes.

Now we state our main result.

Theorem 1.2

Let pqr be distinct primes and n be a positive integer. A subset in \(\mathbb {Z}_{p^{n}qr}\) is a spectral set if and only if it is a tile of \(\mathbb {Z}_{p^{n}qr}\).

Note that the “Tile \(\Rightarrow \) Spectral” direction follows from [25]. Hence, we only need to prove the “Spectral \(\Rightarrow \) Tile” direction. When we consider Fuglede’s conjecture in cyclic groups, one of the most important tools is the so-called (T1) and (T2) conditions, which was introduced by Coven and Meyerowitz [2]. In this paper, we introduce the group ring notation to study spectral sets in cyclic groups. In particular, we prove that Fuglede’s conjecture holds in \(\mathbb {Z}_{p^{n}qr}\). This paper is organized as follows. In Sect. 2, we recall some basics of spectral sets and tiles in cyclic groups. In Sect. 3, we prove some useful lemmas using the group ring notation. In Sect. 4, we prove Theorem 1.2.

2 Preliminaries

Let \(\mathbb {Z}_{n}\) be a finite cyclic group with order n (written additively). For any \(a,x\in \mathbb {Z}_{n}\), define

$$\begin{aligned} \chi _{a}(x)=e^{\frac{2\pi i\cdot ax}{n}}. \end{aligned}$$

Then \(\chi _{a}\chi _{b}=\chi _{a+b}\). Hence the set \(\widehat{\mathbb {Z}_{n}}=\{\chi _{a}:\ a\in \mathbb {Z}_{n}\}\) forms a group which is isomorphic to \(\mathbb {Z}_{n}\).

Now we restate the definition of spectral sets and tiles in cyclic groups.

Definition 2.1

A subset \(A\subseteq \mathbb {Z}_{N}\) is said to be spectral if there is a subset \(B\subseteq \mathbb {Z}_{N}\) such that

$$\begin{aligned} \{\chi _{b}: b\in B\} \end{aligned}$$

forms an orthogonal basis in \(L^{2}(A)\), the vector space of complex valued functions on A with Hermitian inner product \(\langle f,g\rangle =\sum _{a\in A}f(a)\overline{g}(a)\). In such a case, the set B is called a spectrum of A, and (AB) is called a spectral pair.

Since the dimension of \(L^{2}(A)\) is |A|, the pair (AB) being a spectral pair is equivalent to

$$\begin{aligned} |A|=|B|\text { and }\sum _{a\in A}\chi _{b-b'}(a)=0\text { for all }b\ne b'\in B. \end{aligned}$$

The set of zeros of A is defined by

$$\begin{aligned} \mathcal {Z}_{A}=\{b\in \mathbb {Z}_{n}: \sum _{a\in A}\chi _{b}(a)=0\}. \end{aligned}$$

Then \(\mathcal {Z}_{A}\) is precisely the zeros of the Fourier transform of the characteristic function of A.

The following equivalent conditions of a spectral pair can be found in [31, 36].

Lemma 2.2

Let \(A,B\subseteq \mathbb {Z}_{N}\). Then the following statements are equivalent.

  1. (a)

    (AB) is a spectral pair.

  2. (b)

    (BA) is a spectral pair.

  3. (c)

    \(|A|=|B|\) and \((B-B)\backslash \{0\}\subseteq \mathcal {Z}_{A}\).

  4. (d)

    The pair \((aA+g,bB+h)\) is a spectral pair for all \(a,b\in \mathbb {Z}_{N}^{*}\) and \(g,h\in \mathbb {Z}_{N}\).

Definition 2.3

A subset \(A\subseteq \mathbb {Z}_{N}\) is said to be a tile if there is a subset \(T\subseteq \mathbb {Z}_{N}\) such that each element \(g\in \mathbb {Z}_{N}\) can be expressed uniquely in the form

$$\begin{aligned} g=a+t,\ a\in A,\ t\in T. \end{aligned}$$

We will denote this by \(\mathbb {Z}_{N}=A\oplus T\). The set T is called a tiling complement of A, and (AT) is called a tiling pair.

We have the following equivalent conditions for a tiling pair [31, 33, Lemma 2.1].

Lemma 2.4

Let AT be subsets in \(\mathbb {Z}_{N}\). Then the following statements are equivalent.

  1. (a)

    (AT) is a tiling pair.

  2. (b)

    (TA) is a tiling pair.

  3. (c)

    \((A+g,T+h)\) is a tiling pair.

  4. (d)

    \(|A|\cdot |T|=N\) and \((A-A)\cap (T-T)=\{0\}\).

  5. (e)

    \(|A|\cdot |T|=N\) and \(\mathcal {Z}_{A}\cup \mathcal {Z}_{T}=\mathbb {Z}_{N}\backslash \{0\}\).

If \(|A|=1\) or \(A=\mathbb {Z}_{N}\), then the set A is called trivial. It is easy to see that a trivial set is a spectral set and also a tiling set. In the following of this paper, we will only consider nontrivial sets. We also need the following lemmas, which will be useful in the following sections.

Lemma 2.5

[16] Let A be a spectral set in \(\mathbb {Z}_{N}\), that does not generate \(\mathbb {Z}_{N}\). Assume that for every proper subgroup H of \(\mathbb {Z}_{N}\) we have \(S-T(H)\). Then A tiles \(\mathbb {Z}_{N}\).

Lemma 2.6

[16] Let N be a natural number and suppose that \(S-T(\mathbb {Z}_{N}/H)\) holds for every \(\{0\}\ne H\le \mathbb {Z}_{N}\). Assume that (AB) is a spectral pair and B does not generate \(\mathbb {Z}_{N}\). Then A tiles \(\mathbb {Z}_{N}\).

Lemma 2.7

[16] Let N be a natural number, A a spectral set in \(\mathbb {Z}_{N}\) and p a prime divisor of N. Assume that \(S-T(\mathbb {Z}_{\frac{N}{p}})\). If A is the union of \(\mathbb {Z}_{p}\)-cosets, then A tiles \(\mathbb {Z}_{N}\).

Lemma 2.8

[32] Let \(0\in T\subseteq \mathbb {Z}_{N}\) be a generating set and assume that p and q are different prime divisors of N. Then there are elements \(t_{1}\ne t_{2}\in T\) such that \(p\not \mid (t_{1}-t_{2})\) and \(q\not \mid (t_{1}-t_{2})\).

Lemma 2.9

Let p be a prime and set \(\zeta =\zeta _{p^n}\), a primitive \(p^n\)-th root of unity. Let \(c=c_{p^n-1}\zeta ^{p^n-1}+c_{p^n-2}\zeta ^{p^n-2}+\cdots +c_1\zeta +c_0\), where \(c_i\in \mathbb {Z}\), \(0\le i\le p^n-1\). Then \(c=0\) if and only if \(c_i=c_j\) for any ij with \(i\equiv j\pmod {p^{n-1}}\).

Proof

Let \(f(x)=c_{p^n-1}x^{p^n-1}+c_{p^n-2}x^{p^n-2}+\cdots +c_1x+c_0\), then \(c=0\) if and only if \(\zeta \) is a root of f(x). Since the minimal polynomial of \(\zeta \) over \(\mathbb {Z}\) is

$$\begin{aligned} \Phi _{p^{n}}(x)=x^{(p-1)p^{n-1}}+x^{(p-2)p^{n-1}}+\cdots +x^{p^{n-1}}+1, \end{aligned}$$

then \(c=0\) if and only if there exists a polynomial \(g(x)\in \mathbb {Z}[x]\) such that

$$\begin{aligned} f(x)=\Phi _{p^{n}}(x)g(x). \end{aligned}$$

Hence, the statement follows. \(\square \)

Let \(v_p(a)\) denote the p-adic valuation of a, i.e., \(p^{v_p(a)}\Vert a\).

Lemma 2.10

Let \(V\subset \mathbb {Z}_{p^n}\) satisfy \(|V|=p^t\), and \(I\subset [0,n-1]\) satisfy \(|I|=t\). If \(v_p(v)\in I\) for all \(v\in (V-V)\backslash \{0\}\), then the elements of V have the form \(\alpha _0+\alpha _1p+\cdots +\alpha _{n-1}p^{n-1}\), where \(\alpha _i\in [0,p-1]\) satisfy the following conditions:

  1. 1.

    if \(i\in I\), then \(\alpha _i\) can take every value from \([0,p-1]\);

  2. 2.

    if \(j\notin I\), the value of \(\alpha _j\) depends solely on \(\alpha _0,\dots ,\alpha _{j-1}\).

Proof

We prove the lemma by induction. It is easy to see that the result is true for \(|I|=1\). Suppose that the statement holds for \(|I|< t\).

Let \(|I|=t\), \(I=\{i_j:\ j\in [1,t]\}\), and \(0\le i_1<i_2<\cdots <i_t\le n-1\). For any \(v\in V\), we can write v as \(v=\sum _{i=0}^{n-1}v_ip^i\), where \(v_i\in [0,p-1]\). Denote

$$\begin{aligned} V_k=\{v\in V:\ v_{i_1}=k\}. \end{aligned}$$

Then \(V=\cup _{k=0}^{p-1}V_k\). By the pigeonhole principle, there exists k such that \(|V_k|\ge p^{t-1}\). Note that the p-adic valuations of the elements of \(V_k-V_k\) are in \(I\backslash \{i_1\}\). By the pigeonhole principle again, we have \(|V_{k}|\le p^{t-1}\). Hence \(|V_{k}|= p^{t-1}\) for all \(k\in [0,p-1]\). By induction, the elements of \(V_k\) have the form \(\alpha _0+\alpha _1p+\cdots +kp^{i_1}+\cdots +\alpha _{n-1}p^{n-1}\), where \(\alpha _i\in [0,p-1]\) satisfy the following conditions:

  1. 1.

    if \(i\in I\backslash \{i_1\}\), then \(\alpha _i\) can take every value from \([0,p-1]\);

  2. 2.

    if \(j\notin I\), the value of \(\alpha _j\) depends solely on \(\alpha _0,\dots ,\alpha _{j-1}\).

Then the statement follows from \(V=\cup _{k=0}^{p-1}V_k\). \(\square \)

3 Technique Tools

Throughout the following sections, the cyclic group \(\mathbb {Z}_{N}\) will be written multiplicatively. Let \(\mathbb {Z}_{N}=\langle u\rangle \), then all the statements in Sect. 2 still hold under the isomorphism map: \(i\rightarrow u^{i}\).

Our main result will be demonstrated using the language of group rings, which is commonly employed in the investigation of combinatorial designs, finite geometry, and related fields. For further information, please refer to [28, 29] and their associated references.

Let \(\mathbb {Z}[\mathbb {Z}_{N}]\) denote the group ring of \(\mathbb {Z}_{N}\) over \(\mathbb {Z}\). For any \(X\in \mathbb {Z}[\mathbb {Z}_{N}]\), X can be written as formal sums \(X=\sum _{g\in \mathbb {Z}_{N}}x_{g}g\), where \(x_{g}\in \mathbb {Z}\). The addition and subtraction of elements in \(\mathbb {Z}[\mathbb {Z}_{N}]\) is defined componentwise, i.e.,

$$\begin{aligned} \sum _{g\in \mathbb {Z}_{N}}x_{g}g\pm \sum _{g\in \mathbb {Z}_{N}}y_{g}g:=\sum _{g\in \mathbb {Z}_{N}}(x_{g}\pm y_g)g. \end{aligned}$$

The multiplication is defined by

$$\begin{aligned} \left( \sum _{g\in \mathbb {Z}_{N}}x_{g}g\right) \left( \sum _{g\in \mathbb {Z}_{N}}y_{g}g\right) :=\sum _{g\in \mathbb {Z}_{N}} \left( \sum _{h\in \mathbb {Z}_{N}}x_hy_{h^{-1}g}\right) g. \end{aligned}$$

For \(X=\sum _{g\in \mathbb {Z}_{N}}x_{g}g\) and \(t\in \mathbb {Z}\), we define

$$\begin{aligned} X^{(t)}:=\sum _{g\in \mathbb {Z}_{N}}x_{g}g^{t}. \end{aligned}$$

For any set X whose elements belong to \(\mathbb {Z}_{N}\) (X may be a multiset), we can identify X with the group ring element \(\sum _{g\in \mathbb {Z}_{N}}x_{g}g\), where \(x_g\) is the multiplicity of g appearing in X. The group ring notation is equivalent to the polynomial notation in cyclic groups. For example, the set \(A\subset \mathbb {Z}_N\) corresponds to the polynomial \(A(X)=\sum _{a\in A}X^a\pmod {X^N-1}\).

For any \(g=u^a,h=u^b\in \mathbb {Z}_{N}\), define

$$\begin{aligned} \chi _{g,N}(h):=e^{\frac{2\pi i\cdot ab}{N}}. \end{aligned}$$

We will use \(\chi _{a,N}\) instead of \(\chi _{u^a,N}=\chi _{g,N}\) if there is no misunderstanding. For any \(\chi \in \widehat{\mathbb {Z}_{N}}\) and \(X=\sum _{g\in \mathbb {Z}_{N}}x_{g}g\in \mathbb {Z}[\mathbb {Z}_{N}]\), define

$$\begin{aligned} \chi (X):=\sum _{g\in \mathbb {Z}_{N}} x_{g} \chi (g). \end{aligned}$$

Then the pair (AB) forms a spectral pair if and only if

$$\begin{aligned} |A|=|B|\text { and }\chi _{b-b',N}(A)=0\text { for all }u^b\ne u^{b'}\in B. \end{aligned}$$

Let \(\mathbb {Z}_{p^{n}p_{1}\cdots p_{k}}=\langle a,a_1,\dots ,a_{k}\rangle \), where \(o(a)=p^{n}\), \(o(a_{i})=p_i\) for \(i=1,\dots ,k\). Let A be a subset of \(\mathbb {Z}_{p^{n}p_{1}\cdots p_{k}}\), then A can be written as \(A=\sum _{i_1=0}^{p_1-1}\cdots \sum _{i_{k}=0}^{p_k-1}A_{i_1,\dots , i_k}a_{1}^{i_1}\cdots a_{k}^{i_k}\), where \(A_{i_1,\dots , i_k}\in \mathbb {Z}_{\ge 0}[\langle a\rangle ]\). For any \(i_{t+1}'\in [0,p_{t+1}-1],\dots ,i_{k}'\in [0,p_k-1]\), denote

$$\begin{aligned} \mathcal {I}_{t,s}(i_{t+1}',\dots ,i_{k}'):=&\{(i_1,i_2,\dots ,i_k):\text { there are exactly } s \text { of } j\in [t+1,k] \text { such that } i_{j}=0 \\ {}&\text { and for other }j\in [t+1,k], i_j=i_{j}'\}. \end{aligned}$$

Let \(A_{\mathcal {I}_{t,s}(i_{t+1}',\dots ,i_{k}')}:=\sum _{I\in \mathcal {I}_{t,s}(i_{t+1}',\dots ,i_{k}')}A_{I}.\) Then we have the following lemma, which can transfer the problem from \(\mathbb {Z}_{p^{n}p_{1}\cdots p_{k}}\) to \(\mathbb {Z}_{p^{n}}\).

Lemma 3.1

Let \(0\le t\le k\), \(0\le i\le n\), then \(p^{i}p_{1}\cdots p_{t}\in \mathcal {Z}_{A}\) if and only if

$$\begin{aligned} \chi _{p^{i},p^{n}} \left( \sum _{s=0}^{k-t}\sum _{i_1=0}^{p_1-1}\dots \sum _{i_t=0}^{p_t-1}(-1)^{s}A_{\mathcal {I}_{t,s}(i_{t+1}',\dots ,i_{k}')}\right) =0 \end{aligned}$$

for all \(i_{t+1}'\in [0,p_{t+1}-1],\dots ,i_{k}'\in [0,p_k-1]\), where \(p^{i}p_{1}\cdots p_{t}:=p^{i}\) if \(t=0\).

Proof

By the definition of zeros of a set, we have \(p^{i}p_{1}\cdots p_{t}\in \mathcal {Z}_{A}\) if and only if

$$\begin{aligned} 0&=\chi _{p^{i}p_{1}\cdots p_{t},p^{n}p_{1}\cdots p_{k}}(A)\\&=\chi _{p^{i}p_{1}\cdots p_{t},p^{n}p_{1}\cdots p_{k}}\left( \sum _{i_1=0}^{p_1-1}\cdots \sum _{i_{k}=0}^{p_k-1}A_{i_1,\dots , i_k}a_{1}^{i_1}\cdots a_{k}^{i_k}\right) \\&=\sum _{i_1=0}^{p_1-1}\cdots \sum _{i_{k}=0}^{p_k-1}\chi _{p^{i},p^n}(A_{i_1,\dots , i_k})\zeta _{p_{t+1}}^{i_{t+1}}\cdots \zeta _{p_{k}}^{i_k}\\&=\sum _{i_{k}=0}^{p_k-1}\left( \sum _{i_{t+1}=0}^{p_{t+1}-1}\cdots \sum _{i_{k-1}=0}^{p_{k-1}-1}\chi _{p^{i},p^n}\left( \sum _{i_1=0}^{p_1-1}\cdots \sum _{i_{t}=0}^{p_t-1}A_{i_1,\dots , i_k}\right) \zeta _{p_{t+1}}^{i_{t+1}}\cdots \zeta _{p_{k-1}}^{i_{k-1}}\right) \zeta _{p_{k}}^{i_k}\\&=\sum _{i_{k}=1}^{p_k-1}\left( \sum _{i_{t+1}=0}^{p_{t+1}-1}\cdots \sum _{i_{k-1}=0}^{p_{k-1}-1}\chi _{p^{i},p^n} \left( \sum _{i_1=0}^{p_1-1}\cdots \sum _{i_{t}=0}^{p_t-1}(A_{i_1,\dots , i_k}-A_{i_1,\dots , i_{k-1},0})\right) \zeta _{p_{t+1}}^{i_{t+1}}\cdots \zeta _{p_{k-1}}^{i_{k-1}}\right) \zeta _{p_{k}}^{i_k}, \end{aligned}$$

where the last equation follows from \(1=-\sum _{i_k=1}^{p_k-1}\zeta _{p_{k}}^{i_k}\). Since \(\zeta _{p_k},\zeta _{p_k}^{2},\dots ,\zeta _{p_k}^{p_k-1}\) forms a basis of \(\mathbb {Q}(\zeta _{p^{n}p_{1}\cdots p_{k}})/\mathbb {Q}(\zeta _{p^{n}p_{1}\cdots p_{k-1}})\), then \(\chi _{p^{i}p_{1}\cdots p_{t},p^{n}p_{1}\cdots p_{k}}(A)=0\) is equivalent to

$$\begin{aligned} \sum _{i_{t+1}=0}^{p_{t+1}-1}\cdots \sum _{i_{k-1}=0}^{p_{k-1}-1}\chi _{p^{i},p^n} \left( \sum _{i_1=0}^{p_1-1}\cdots \sum _{i_{t}=0}^{p_t-1}(A_{i_1,\dots , i_k}-A_{i_1,\dots , i_{k-1},0})\right) \zeta _{p_{t+1}}^{i_{t+1}}\cdots \zeta _{p_{k-1}}^{i_{k-1}}=0 \end{aligned}$$

for all \(i_k\in [0,p_k-1]\). Repeating above arguments, we have the statement. \(\square \)

In particular, let \(\mathbb {Z}_{p^{n}qr}=\langle a,b,c\rangle \), where \(o(a)=p^{n}\), \(o(b)=q\) and \(o(c)=r\), and write \(A=\sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{j,k}b^{j}c^{k}\), where \(A_{j,k}\in \mathbb {Z}_{\ge 0}[\langle a\rangle ]\). Then we have the following corollary.

Corollary 3.2

  1. (1)

    \(p^{i}\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(A_{j,k}-A_{j,0}-A_{0,k}+A_{0,0})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\).

  2. (2)

    \(p^{i}q\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(\sum _{j=0}^{q-1}(A_{j,k}-A_{j,0}))=0\) for all \(k\in [0,r-1]\).

  3. (3)

    \(p^{i}r\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(\sum _{k=0}^{r-1}(A_{j,k}-A_{0,k}))=0\) for all \(j\in [0,q-1]\).

  4. (4)

    \(p^{i}qr\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(\sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{j,k})=0\).

If A has many zeros, then we can get more information about the sets \(A_{j,k}\), \(j\in [0,q-1],k\in [0,r-1]\).

Lemma 3.3

  1. (1)

    \(p^{i},p^{i}q\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(A_{j,k}-A_{j,0})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\).

  2. (2)

    \(p^{i},p^{i}r\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(A_{j,k}-A_{0,k})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\).

  3. (3)

    \(p^{i}q,p^{i}r\in \mathcal {Z}_{A}\) if and only if \(r\chi _{p^i,p^n}(\sum _{j=0}^{q-1}A_{j,k'})=q\chi _{p^i,p^n}(\sum _{k=0}^{r-1}A_{j',k})\) for all \(j'\in [0,q-1],k'\in [0,r-1]\).

  4. (4)

    \(p^{i}q,p^{i}qr\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(\sum _{j=0}^{q-1}A_{j,k})=0\) for all \(k\in [0,r-1]\).

  5. (5)

    \(p^{i}r,p^{i}qr\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(\sum _{k=0}^{r-1}A_{j,k})=0\) for all \(j\in [0,q-1]\).

  6. (6)

    \(p^{i},p^{i}q,p^{i}r\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(A_{j,k}-A_{0,0})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\).

  7. (7)

    \(p^{i},p^{i}r,p^{i}q,p^{i}qr\in \mathcal {Z}_{A}\) if and only if \(\chi _{p^{i},p^n}(A_{j,k})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\).

Proof

We will only prove (1) and (3). For other statements, the proofs are similar.

(1). If \(p^{i},p^{i}q\in \mathcal {Z}_{A}\), by Corollary 3.2 (1) and (2), we have

$$\begin{aligned}&\chi _{p^{i},p^n}(A_{j,k}-A_{j,0}-A_{0,k}+A_{0,0})=0, \\&\chi _{p^{i},p^n}\left( \sum _{j=0}^{q-1}(A_{j,k}-A_{j,0})\right) =0. \end{aligned}$$

Then we can compute to get that

$$\begin{aligned} 0&=\sum _{j=0}^{q-1}\chi _{p^{i},p^n}(A_{j,k}-A_{j,0}-A_{0,k}+A_{0,0})\\&=\chi _{p^{i},p^n}\left( \sum _{j=0}^{q-1}(A_{j,k}-A_{j,0}-A_{0,k}+A_{0,0})\right) \\&=\chi _{p^{i},p^n}\left( \sum _{j=0}^{q-1}(-A_{0,k}+A_{0,0})\right) \\&=q\chi _{p^{i},p^n}(-A_{0,k}+A_{0,0})\\&=q\chi _{p^{i},p^n}(-A_{j,k}+A_{j,0}). \end{aligned}$$

Hence \(\chi _{p^{i},p^n}(A_{j,k}-A_{j,0})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\). For the converse, the result directly follows from Corollary 3.2 (1) and (2).

(3) If \(p^{i}q,p^{i}r\in \mathcal {Z}_{A}\), by Corollary 3.2 (2) and (3), we have

$$\begin{aligned}&\chi _{p^{i},p^n}\left( \sum _{j=0}^{q-1}(A_{j,k'}-A_{j,0})\right) =0, \\&\chi _{p^{i},p^n}\left( \sum _{k=0}^{r-1}(A_{j',k}-A_{0,k})\right) =0. \end{aligned}$$

Then we can compute to get that

$$\begin{aligned} r\chi _{p^i,p^n}\left( \sum _{j=0}^{q-1}A_{j,k'}\right)&=r\chi _{p^i,p^n}\left( \sum _{j=0}^{q-1}A_{j,0}\right) =\chi _{p^i,p^n}\left( \sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{j,0}\right) \\&=\chi _{p^i,p^n}\left( \sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{j,k}\right) \\&=\chi _{p^i,p^n}\left( \sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{0,k}\right) =q\chi _{p^i,p^n}\left( \sum _{k=0}^{r-1}A_{0,k}\right) =q\chi _{p^i,p^n}\left( \sum _{k=0}^{r-1}A_{j',k}\right) . \end{aligned}$$

For the converse, the result directly follows from Corollary 3.2 (2) and (3). \(\square \)

4 Proof of Theorem 1.2

Let (AB) be a nontrivial spectral pair in \(\mathbb {Z}_{p^{n}qr}\). Assuming further that A is not a tiling set, we will establish a contradiction.

Let \(\mathbb {Z}_{p^{n}qr}=\langle a,b,c\rangle \), where \(o(a)=p^{n}\), \(o(b)=q\) and \(o(c)=r\), and write \(A=\sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{j,k}b^{j}c^{k}\) and \(B=\sum _{j=0}^{q-1}\sum _{k=0}^{r-1}B_{j,k}b^{j}c^{k}\), where \(A_{j,k},B_{j,k}\in \mathbb {Z}_{\ge 0}[\langle a\rangle ]\). Let e be the identity element of group \(\mathbb {Z}_{p^{n}qr}\).

Remark 4.1

  1. (1)

    If \(a^{i_0},a^{i_0+up^{i_1}}\in A_{j,k}\) for some \(j\in [0,q-1],k\in [0,r-1]\) and \(u\not \equiv 0\pmod {p}\), then \(p^{i_1}qr\in \mathcal {Z}_{B}\).

  2. (2)

    If \(a^{i_0}\in A_{j_0,k},a^{i_0+up^{i_1}}\in A_{j_1,k}\) for some \(j_0,j_1\in [0,q-1],k\in [0,r-1]\) with \(j_0\ne j_1\), then \(p^{i_1}r\in \mathcal {Z}_{B}\) when \(u\not \equiv 0\pmod {p}\), and \(p^{n}r\in \mathcal {Z}_{B}\) when \(u=0\).

  3. (3)

    If \(a^{i_0}\in A_{j,k_0},a^{i_0+up^{i_1}}\in A_{j,k_1}\) for some \(j\in [0,q-1],k_0,k_1\in [0,r-1]\) with \(k_0\ne k_1\), then \(p^{i_1}q\in \mathcal {Z}_{B}\) when \(u\not \equiv 0\pmod {p}\), and \(p^{n}q\in \mathcal {Z}_{B}\) when \(u=0\).

  4. (4)

    If \(a^{i_0}\in A_{j_0,k_0},a^{i_0+up^{i_1}}\in A_{j_1,k_1}\) for some \(j_0,j_1\in [0,q-1],k_0,k_1\in [0,r-1]\) with \(j_0\ne j_1\) and \(k_0\ne k_1\), then \(p^{i_1}\in \mathcal {Z}_{B}\) when \(u\not \equiv 0\pmod {p}\), and \(p^{n}\in \mathcal {Z}_{B}\) when \(u=0\).

Note that Fuglede’s conjecture holds in \(\mathbb {Z}_{p^{n}q}\) [26], \(\mathbb {Z}_{pqr}\) [30] and \(\mathbb {Z}_{p^{2}qr}\) [32], where pqr are distinct primes. By Lemmas 2.2, 2.4, 2.5, 2.6 and 2.7, we also assume that

  1. (1)

    \(e\in A\), \(e\in B\);

  2. (2)

    A generates group \(\mathbb {Z}_{p^{n}qr}\);

  3. (3)

    B generates group \(\mathbb {Z}_{p^{n}qr}\);

  4. (4)

    A is not a union of \(\mathbb {Z}_{p}\)- or \(\mathbb {Z}_{q}\)- or \(\mathbb {Z}_{r}\)-cosets exclusively.

Then \(e\in A_{0,0}\) and \(e\in B_{0,0}\). Denote

$$\begin{aligned}&I_{1}=\{i: i\in [0,n-1],p^{i}qr\in \mathcal {Z}_{A}\},\\&I_{2}=\mathcal {Z}_{A}\cap \{p^{n}q,p^{n}r\},\\&J_{1}=\{i: i\in [0,n-1],p^{i}qr\in \mathcal {Z}_{B}\},\\&J_{2}=\mathcal {Z}_{B}\cap \{p^{n}q,p^{n}r\}. \end{aligned}$$

Then \(0\le |I_1|,|J_1|\le n\) and \(0\le |I_2|,|J_2|\le 2\). Now we first prove some lemmas.

Lemma 4.2

  1. (1)

    If \(q,r\in \mathcal {Z}_{A}\) and \(qr\not \in \mathcal {Z}_{A}\), then \(p^{n}q,p^{n}r\in \mathcal {Z}_{B}\).

  2. (2)

    If \(q,r\in \mathcal {Z}_{B}\) and \(qr\not \in \mathcal {Z}_{B}\), then \(p^{n}q,p^{n}r\in \mathcal {Z}_{A}\).

Proof

We will only prove the first statement, the proof of the second statement is similar. Note that \(qr\not \in \mathcal {Z}_{A}\). By Lemma 3.3 (3), (4) and (5), we have

$$\begin{aligned} r\chi _{1,p^n}\left( \sum _{j=0}^{q-1}A_{j,k'}\right) =q\chi _{1,p^n}\left( \sum _{k=0}^{r-1}A_{j',k}\right) \ne 0, \end{aligned}$$

for any \(j'\in [0,q-1]\) and \(k'\in [0,r-1]\). Let \(\sum _{j=0}^{q-1}A_{j,k'}=\sum _{i=0}^{p^{n}-1}x_{i}a^{i}\), and \(\sum _{k=0}^{r-1}A_{j',k}=\sum _{i=0}^{p^{n}-1}y_{i}a^{i}\), where \(x_i,y_i\in \mathbb {Z}_{\ge 0}\). Then, the above inequations show that

$$\begin{aligned}&\sum _{i=0}^{p^{n}-1}x_{i}\zeta _{p^n}^{i}\ne 0, \end{aligned}$$
(1)
$$\begin{aligned}&\sum _{i=0}^{p^{n}-1}y_{i}\zeta _{p^n}^{i}\ne 0, \end{aligned}$$
(2)
$$\begin{aligned}&\sum _{i=0}^{p^{n}-1}(rx_i-qy_i)\zeta _{p^n}^{i}=0. \end{aligned}$$
(3)

By Lemma 2.9, Equation (1) implies that there exist \(i_1,i_2\) with \(i_1\equiv i_2\pmod {p^{n-1}}\) such that \(x_{i_1}\ne x_{i_2}\). By Equation (3), we have \(rx_{i_1}-qy_{i_1}=rx_{i_2}-qy_{i_2}\), which leads to \(r(x_{i_1}-x_{i_2})=q(y_{i_1}-y_{i_2})\). Hence, we have \(|x_{i_1}-x_{i_2}|\ge q\) and \(|y_{i_1}-y_{i_2}|\ge r\). Therefore, \(\max \{x_{i_1},x_{i_2}\}\ge q\) and \(\max \{y_{i_1},y_{i_2}\}\ge r\). In other words, there exists \(a^{i_0}\in \sum _{j=0}^{q-1}A_{j,k'}\) such that \(a^{i_0}\) appears q times in \(\sum _{j=0}^{q-1}A_{j,k'}\). By Remark 4.1 (2), we have \(p^nr\in \mathcal {Z}_{B}\). Similarly, \(p^{n}q\in \mathcal {Z}_{B}\). \(\square \)

Lemma 4.3

  1. (1)

    If \(|J_{2}|\le 1\), then \(1\in \mathcal {Z}_{A}\).

  2. (2)

    If \(|I_{2}|\le 1\), then \(1\in \mathcal {Z}_{B}\).

Proof

We will only prove the first statement, the proof of the second statement is similar.

Assume to the contrary, \(1\not \in \mathcal {Z}_{A}\). By Lemma 2.8, there exist \(x,y\in B\) such that \(p\not \mid (x-y)\) and \(q\not \mid (x-y)\). Since \(1\not \in \mathcal {Z}_{A}\), then \(r\mid (x-y)\), and so \(r\in \mathcal {Z}_{A}\). Similarly, we have \(q\in \mathcal {Z}_{A}\).

By Lemma 4.2 (1), we have \(qr\in \mathcal {Z}_{A}\). By Lemma 3.3 (4) and (5), we get

$$\begin{aligned} \chi _{1,p^{n}}\left( \sum _{j=0}^{q-1}A_{j,k'}\right) =\chi _{1,p^{n}}\left( \sum _{k=0}^{r-1}A_{j',k}\right) =0\text { for all }j'\in [0,q-1], k'\in [0,r-1]. \end{aligned}$$

In other words, \(\sum _{j=0}^{q-1}A_{j,k'}\) and \(\sum _{k=0}^{r-1}A_{j',k}\) are unions of some \(\mathbb {Z}_{p}\)-cosets. Since \(1\notin \mathcal {Z}_{A}\), then there exist \(j_1,k_1\) such that \(\chi _{1,p^n}(A_{j_1,k_1})\ne 0\). Hence, there exists \(a^{i_0}\in A_{j_1,k_1}\) such that \(a^{i_0+up^{n-1}}\notin A_{j_1,k_1}\) for some \(u\in [1,p-1]\). Moreover, \(a^{i_0+up^{n-1}}\in A_{j_2,k_1}\) and \(a^{i_0+up^{n-1}}\in A_{j_1,k_2}\) for some \(j_2,k_2\) with \(j_2\ne j_1\) and \(k_2\ne k_1\). This shows that \(p^{n-1}q,p^{n-1}r,p^{n}\in \mathcal {Z}_{B}\). By Lemma 3.3 (3) and \(p^{n-1}q,p^{n-1}r\in \mathcal {Z}_{B}\), we have

$$\begin{aligned} r\chi _{p^{n-1},p^n}\left( \sum _{j=0}^{q-1}B_{j,k'}\right) =q\chi _{p^{n-1},p^n}\left( \sum _{k=0}^{r-1}B_{j',k}\right) \text { for all }j'\in [0,q-1],k'\in [0,r-1]. \end{aligned}$$
(4)

By Corollary 3.2 (1) and \(p^{n}\in \mathcal {Z}_{B}\), we have

$$\begin{aligned} |B_{j,k}|-|B_{j,0}|-|B_{0,k}|+|B_{0,0}|=0\text { for all }j\in [0,q-1],k\in [0,r-1]. \end{aligned}$$
(5)

Claim: \(p^{n-1}\notin \mathcal {Z}_{B}\).

Assume to the contrary, \(p^{n-1}\in \mathcal {Z}_{B}\).

If \(p^{n-1}qr\in \mathcal {Z}_{B}\), by Lemma 3.3 (7), we have \(\chi _{p^{n-1},p^n}(B_{j,k})=0\). Noting that \(e\in B_{0,0}\), then

$$\begin{aligned} \{i\pmod {p}:\ a^{i}\in B_{0,0}\}=\{0,1,\dots ,p-1\}. \end{aligned}$$

Since \(1\not \in \mathcal {Z}_{A}\), then \(B_{j,k}=\emptyset \) for \(j\in [1,q-1]\) and \(k\in [1,r-1]\). If \(B_{j,0}\ne \emptyset \) for some \(j\in [1,q-1]\), similarly as before,

$$\begin{aligned}&\{i\pmod {p}:\ a^{i}\in B_{j,0}\}=\{0,1,\dots ,p-1\},\\&B_{0,k}=\emptyset \text { for }k\in [1,r-1]. \end{aligned}$$

Thus \(B=\sum _{j=0}^{q-1}B_{j,0}b^{j}\), which contradicts the fact that B generates \(\mathbb {Z}_{p^{n}qr}\). Hence \(B_{j,0}=\emptyset \) for all \(j\in [1,q-1]\) and so \(B=\sum _{k=0}^{r-1}B_{0,k}c^{k}\), which also contradicts the fact that B generates \(\mathbb {Z}_{p^{n}qr}\). Therefore, \(p^{n-1}qr\not \in \mathcal {Z}_{B}\).

By Lemma 3.3 (6), (7) and \(p^{n-1},p^{n-1}q,p^{n-1}r\in \mathcal {Z}_{B}\), \(p^{n-1}qr\not \in \mathcal {Z}_{B}\), we have

$$\begin{aligned} \chi _{p^{n-1},p^n}(B_{j,k})=\chi _{p^{n-1},p^n}(B_{0,0})\ne 0\text { for all }j,k. \end{aligned}$$
(6)

If there exists \(j\in [0,q-1],k\in [0,r-1]\) such that \(|\{i\pmod {p}:\ a^{i}\in B_{j,k}\}|\ge 2\), WLOG, assume that \(|\{i\pmod {p}:\ a^{i}\in B_{0,0}\}|\ge 2\). Equation (6) implies that \(|B_{j,k}|\ge 1\) for all jk. Then we have \(1\in \mathcal {Z}_{A}\), which is a contradiction. Hence \(|\{i\pmod {p}:\ a^{i}\in B_{j,k}\}|=1\) for all \(j\in [0,q-1],k\in [0,r-1]\), and

$$\begin{aligned} \{i\pmod {p}:\ a^{i}\in B_{j,k}\}=\{i\pmod {p}:\ a^{i}\in B_{0,0}\}. \end{aligned}$$

This implies that \(B\subset {i+p\mathbb {Z}_{p^nqr}}\), so it does not generate \(\mathbb {Z}_{p^nqr}\), which is a contradiction. This ends the proof of claim.

Now we divide our discussion into two cases.

Case 1: p is an odd prime.

Since \(q,r,qr\in \mathcal {Z}_{A}\), by Lemma 3.3 (4) and (5),

$$\begin{aligned} \chi _{1,p^n}\left( \sum _{j=0}^{q-1}A_{j,k'}\right) =\chi _{1,p^n}\left( \sum _{k=0}^{r-1}A_{j',k}\right) =0\text { for all }j'\in [0,q-1], k'\in [0,r-1]. \end{aligned}$$

In other words, \(\sum _{j=0}^{q-1}A_{j,k'}\) and \(\sum _{k=0}^{r-1}A_{j',k}\) are unions of some \(\mathbb {Z}_{p}\)-cosets. Note that \(1\notin \mathcal {Z}_{A}\). There exist \(j_1,k_1\) such that \(\chi _{1,p^n}(A_{j_1,k_1})\ne 0\). Hence, there exists \(a^{i_0}\in A_{j_1,k_1}\) such that at least 2 of \(a^{i_0+tp^{n-1}}\), \(t=1,\dots ,p-1\) do not belong to \(A_{j_1,k_1}\), say \(a^{i_0+p^{n-1}}\) and \(a^{i_0+2p^{n-1}}\) (if there are \(p-1\) of \(a^{i_0+tp^{n-1}}\), \(t=0,\dots ,p-1\) belong to \(A_{j_1,k_1}\) and the remaining one belong to \(A_{j_1,k_1^{'}}\), then change \(A_{j_1,k_1}\) to \(A_{j_1,k_1^{'}}\)). Moreover, \(a^{i_0+p^{n-1}}\in A_{j_2,k_1}\) and \(a^{i_0+2p^{n-1}}\in A_{j_1,k_2}\) for some \(j_2,k_2\) with \(j_2\ne j_1\) and \(k_2\ne k_1\). Therefore, \(p^{n-1}\in \mathcal {Z}_{B}\), which is a contradiction.

Case 2: \(p=2\).

We divide our discussion into two subcases.

Subcase 2.1: For all jk, \(|\{i\pmod {2}:\ a^{i}\in B_{j,k}\}|\le 1\).

Claim: \(B_{j,k}=\emptyset \) for all \(j\in [1,q-1],k\in [1,r-1]\).

Assume to the contrary, there exist \(j_0\in [1,q-1]\), \(k_0\in [1,r-1]\) such that \(B_{j_0,k_0}\ne \emptyset \). Note that \(e\in B_{0,0}\) and \(1\notin \mathcal {Z}_{A}\). We can get that

$$\begin{aligned}&\{i\pmod {2}:\ a^{i}\in B_{j_0,k_0}\}=\{0\},\\&1\notin \{i\pmod {2}:\ a^{i}\in \cup _{j\in [0,q-1],k\in [0,r-1]}B_{j,k}\backslash (B_{j_0,0}\cup B_{0,k_0})\}. \end{aligned}$$

Since B generates \(\mathbb {Z}_{p^{n}qr}\), then \(1\in \{i\pmod {2}:\ a^{i}\in \cup _{j\in [0,q-1],k\in [0,r-1]}B_{j,k}\}\). Hence \(1\in \{i\pmod {2}:\ a^{i}\in B_{j_0,0}\cup B_{0,k_0}\}\).

If both \(B_{j_0,0}\) and \(B_{0,k_0}\) are nonempty, then \(\{i\pmod {2}:\ a^{i}\in B_{0,k_0}\}=\{i\pmod {2}:\ a^{i}\in B_{j_0,0}\}=\{1\}\) and

$$\begin{aligned} B_{j,k}=\emptyset \text { for all }(j,k)\ne (0,0),(j_0,k_0),(j_0,0),(0,k_0). \end{aligned}$$

For any \(j_1\ne j_0\), \(k_1\ne k_0\), by Equation (5), we have \(|B_{j_1,k_1}|-|B_{j_1,0}|-|B_{0,k_1}|+|B_{0,0}|=0\). Then \(|B_{0,0}|=0\), which is a contradiction.

If only one of \(B_{j_0,0}\) and \(B_{0,k_0}\) is nonempty, say \(B_{0,k_0}\), then \(\{i\pmod {2}:\ a^{i}\in B_{0,k_0}\}=\{1\}\), \(B_{j_0,0}=\emptyset \) and

$$\begin{aligned} \{i\pmod {2}:\ a^{i}\in \cup _{j\in [1,q-1]}B_{j,k_0}\}=\{i\pmod {2}:\ a^{i}\in \cup _{k\in [0,r-1]\backslash \{k_0\}}B_{0,k}\}=\{0\}. \end{aligned}$$

By Equation (5), we have

$$\begin{aligned}&|B_{0,k_1}|=|B_{0,k_2}|\text { for all }k_1,k_2\in [0,r-1]\backslash \{k_0\},\\&|B_{j_1,k_0}|=|B_{j_2,k_0}|\text { for all }j_1,j_2\in [1,q-1],\\&|B_{0,k_0}|=|B_{0,k_1}|+|B_{j_1,k_0}|\text { for all }k_1\in [0,r-1]\backslash \{k_0\},j_1\in [1,q-1]. \end{aligned}$$

Since \(p^{n-1}q,p^{n-1}r\in \mathcal {Z}_{B}\), by Corollary 3.2 (2) and (3),

$$\begin{aligned}&\chi _{p^{n-1},p^n}\left( \sum _{j=0}^{q-1}(B_{j,k_0}-B_{j,0})\right) =0,\\&\chi _{p^{n-1},p^n}\left( \sum _{k=0}^{r-1}(B_{j_0,k}-B_{0,k})\right) =0. \end{aligned}$$

From above equations, we can get

$$\begin{aligned}&|B_{0,0}|=\sum _{j=1}^{q-1}|B_{j,k_0}|-|B_{0,k_0}|=(q-1)|B_{j_0,k_0}|-|B_{0,k_0}|,\\&|B_{j_0,k_0}|=\sum _{k\in [0,r-1]\backslash \{k_0\}}|B_{0,k}|-|B_{0,k_0}|=(r-1)|B_{0,0}|-|B_{0,k_0}|, \end{aligned}$$

which contradicts \(|B_{0,k_0}|=|B_{0,0}|+|B_{j_0,k_0}|\). This ends the proof of claim.

Since B generates \(\mathbb {Z}_{p^{n}qr}\), then \(\cup _{j=1}^{q-1}B_{j,0}\ne \emptyset \) and \(\cup _{k=1}^{r-1} B_{0,k}\ne \emptyset \). Note that \(1\notin \mathcal {Z}_{A}\). We can get that

$$\begin{aligned} \{i\pmod {2}:\ a^{i}\in \cup _{j=1}^{q-1}B_{j,0}\}=\{i\pmod {2}:\ a^{i}\in \cup _{k=1}^{r-1}B_{0,k}\}=\{1\}. \end{aligned}$$

By Equation (5), we have

$$\begin{aligned} |B_{0,0}|=|B_{0,k}|+|B_{j,0}|\text { for }j\in [1,q-1],k\in [1,r-1], \end{aligned}$$

which leads to

$$\begin{aligned}&|B_{0,k_1}|=|B_{0,k_2}|\text { for }k_1,k_2\in [1,r-1],\\&|B_{j_1,0}|=|B_{j_2,0}|\text { for }j_1,j_2\in [1,q-1]. \end{aligned}$$

Since \(p^{n-1}q,p^{n-1}r\in \mathcal {Z}_{B}\), by Corollary 3.2 (2) and (3),

$$\begin{aligned}&\chi _{p^{n-1},p^n}\left( \sum _{j=0}^{q-1}(B_{j,k}-B_{j,0})\right) =0,\\&\chi _{p^{n-1},p^n}\left( \sum _{k=0}^{r-1}(B_{j,k}-B_{0,k})\right) =0. \end{aligned}$$

In other words,

$$\begin{aligned}&|B_{0,0}|-(q-1)|B_{1,0}|=|B_{0,0}|-\sum _{j=1}^{q-1}|B_{j,0}|=-\sum _{j=0}^{q-1}|B_{j,1}|=-|B_{0,1}|, \end{aligned}$$
(7)
$$\begin{aligned}&|B_{0,0}|-(r-1)|B_{0,1}|=|B_{0,0}|-\sum _{k=1}^{r-1}|B_{0,k}|=-\sum _{k=0}^{r-1}|B_{1,k}|=-|B_{1,0}|. \end{aligned}$$
(8)

Combining above two equations, we have \(q|B_{1,0}|=r|B_{0,1}|\). Assume that \(|B_{1,0}|=rm\) for some \(m\in \mathbb {Z}_{>0}\), then \(|B_{0,1}|=qm\) and \(|B_{0,0}|=(q+r)m\). By Equation (7), we have \((q+r)m-(q-1)rm=-qm\), that is \((qr-2q-2r)m=0\), which contradicts \(2\not \mid qr\).

Subcase 2.2: There exist jk such that \(\{i\pmod {2}:\ a^{i}\in B_{j,k}\}=\{0,1\}\).

WLOG, assume that \(\{i\pmod {2}:\ a^{i}\in B_{0,0}\}=\{0,1\}\). Since \(1\not \in \mathcal {Z}_{A}\), then

$$\begin{aligned} B_{j,k}=\emptyset \text { for all }j\in [1,q-1],k\in [1,r-1]. \end{aligned}$$

Since B generates \(\mathbb {Z}_{p^{n}qr}\), then \(\cup _{j=1}^{q-1}B_{j,0}\ne \emptyset \) and \(\cup _{k=1}^{r-1} B_{0,k}\ne \emptyset \). Note that \(1\not \in \mathcal {Z}_{A}\). We can get that

$$\begin{aligned}&|\{i\pmod {2}:\ a^{i}\in \cup _{j=1}^{q-1}B_{j,0}\}|=|\{i\pmod {2}:\ a^{i}\in \cup _{k=1}^{r-1}B_{0,k}\}|=1,\\&\text {and }\{i\pmod {2}:\ a^{i}\in \cup _{j=1}^{q-1}B_{j,0}\}=\{i\pmod {2}:\ a^{i}\in \cup _{k=1}^{r-1}B_{0,k}\}. \end{aligned}$$

WLOG, assume that \(\{i\pmod {2}:\ a^{i}\in \cup _{j=1}^{q-1}B_{j,0}\}=\{i\pmod {2}:\ a^{i}\in \cup _{k=1}^{r-1}B_{0,k}\}=\{0\}\). By Equation (5),

$$\begin{aligned} |B_{0,0}|=|B_{0,k}|+|B_{j,0}|\text { for }j\in [1,q-1],k\in [1,r-1], \end{aligned}$$

which leads to

$$\begin{aligned}&|B_{0,k_1}|=|B_{0,k_2}|\text { for }k_1,k_2\in [1,r-1],\\&|B_{j_1,0}|=|B_{j_2,0}|\text { for }j_1,j_2\in [1,q-1]. \end{aligned}$$

Since \(p^{n-1}q,p^{n-1}r\in \mathcal {Z}_{B}\), by Corollary 3.2 (2) and (3),

$$\begin{aligned}&\chi _{p^{n-1},p^n}\left( \sum _{j=0}^{q-1}(B_{j,k}-B_{j,0})\right) =0,\\&\chi _{p^{n-1},p^n}\left( \sum _{k=0}^{r-1}(B_{j,k}-B_{0,k})\right) =0. \end{aligned}$$

Let \(u=|\{b\in B_{0,0}: b\pmod {2}=0\}|\) and \(v=|\{b\in B_{0,0}: b\pmod {2}=1\}|\), then we have

$$\begin{aligned}&u+v=|B_{0,0}|=|B_{1,0}|+|B_{0,1}|, \end{aligned}$$
(9)
$$\begin{aligned}&(u-v)+(q-1)|B_{1,0}|=\chi _{p^{n-1},p^n}(B_{0,0})+\sum _{j=1}^{q-1}|B_{j,0}|=\sum _{j=0}^{q-1}|B_{j,1}|=|B_{0,1}|, \end{aligned}$$
(10)
$$\begin{aligned}&(u-v)+(r-1)|B_{0,1}|=\chi _{p^{n-1},p^n}(B_{0,0})+\sum _{k=1}^{r-1}|B_{0,k}|=\sum _{k=0}^{r-1}|B_{1,k}|=|B_{1,0}|. \end{aligned}$$
(11)

By Equations (10) and (11), we have \(r|B_{0,1}|=q|B_{1,0}|\). Assume that \(|B_{1,0}|=rm\) for some \(m\in \mathbb {Z}_{>0}\), then \(|B_{0,1}|=qm\) and \(|B_{0,0}|=(q+r)m\). By Equations (9) and (10), we get

$$\begin{aligned}&u-v=(q+r-qr)m,\\&u+v=(q+r)m. \end{aligned}$$

Combining above two equations, we obtain \(2u=(2q+2r-qr)m\ge 0\). Since qr are distinct odd primes, then \((q,r)=(3,5)\) or (5, 3). WLOG, assume that \(q=3\) and \(r=5\). Then we can get that \(|B_{0,0}|=8m\), \(|B_{j,0}|=5\,m\), \(|B_{0,k}|=3\,m\) and \(|A|=|B|=30\,m\). By the pigeonhole principle, we have \(|I_{1}|\ge \log _{2}(8m)\), that is \(2^{|I_1|}\ge 8\,m\). On the other hand, by the definition of \(I_1\), we have \(2^{|I_1|}\mid |A|\), and then \(2^{|I_1|}\mid 2m\), which is a contradiction. \(\square \)

Lemma 4.4

\(|J_2|\ge 1.\)

Proof

If \(|J_2|=0\), then \(1\in \mathcal {Z}_{A}\) by Lemma 4.3 (1). By Corollary 3.2 (1), we have

$$\begin{aligned} \chi _{1,p^n}(A_{j,k}-A_{j,0}-A_{0,k}+A_{0,0})=0\text { for all }j\in [0,q-1], k\in [0,r-1]. \end{aligned}$$

Since \(p^{n}q\notin \mathcal {Z}_{B}\), by Remark 4.1 (3), we have \(A_{j,k}\cap A_{j,0}=\emptyset \) and \(A_{0,k}\cap A_{0,0}=\emptyset \). Similarly, we can prove that

$$\begin{aligned} (A_{j,k}\cup A_{0,0})\cap (A_{j,0}\cup A_{0,k})=\emptyset . \end{aligned}$$
(12)

Let \(A_{j,k}+A_{0,0}=\sum _{i=0}^{p^n-1}x_ia^i\) and \(A_{j,0}+A_{0,k}=\sum _{i=0}^{p^n-1}y_ia^i\), where \(x_i,y_i\in \{0,1,2\}\). By Equation (12), we have \(x_iy_i=0\) for all \(i\in [0,p^n-1]\). Since \(\chi _{1,p^n}(A_{j,k}-A_{j,0}-A_{0,k}+A_{0,0})=\sum _{i=0}^{p^n-1}(x_i-y_i)\zeta _{p^n}^i=0\), and \(x_i-y_i=x_i\) or \(-y_i\), by Lemma 2.9, we have \(\chi _{1,p^n}(A_{j,k}+A_{0,0})=0\).

If there exist jk such that \(\chi _{1,p^n}(A_{j,k})\ne 0\), then \(\chi _{1,p^n}(A_{0,0})\ne 0\). Hence, there exists \(a^{i_0}\in A_{0,0}\) such that \(a^{i_0+tp^{n-1}}\notin A_{0,0}\) for some \(t\in [1,p-1]\), hence \(a^{i_0+tp^{n-1}}\in A_{j,k}\). If \(r\ge 3\), a similar discussion as above, we can get that \(a^{i_0+tp^{n-1}}\in A_{j,k'}\) for some \(k'\ne k\). Hence, \(p^{n}q\in \mathcal {Z}_{B}\), which is a contradiction. If \(r=2\) and \(q\ge 3\), we have \(a^{i_0+tp^{n-1}}\in A_{j',k}\) for some \(j'\ne j\). Hence, \(p^{n}r\in \mathcal {Z}_{B}\), which is also a contradiction. Therefore, \(\chi _{1,p^n}(A_{j,k})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\). This shows that A is a union of \(\mathbb {Z}_{p}\)-cosets, which is a contradiction. \(\square \)

Lemma 4.5

  1. (1)

    \(p^{n}r\in \mathcal {Z}_{A}\) or \(p^{n}r\in \mathcal {Z}_{B}\);

  2. (2)

    \(p^{n}q\in \mathcal {Z}_{A}\) or \(p^{n}q\in \mathcal {Z}_{B}\).

Proof

We will only prove the first statement, the proof of the second statement is similar. Assume to the contrary, \(p^{n}r\notin \mathcal {Z}_{A}\) and \(p^{n}r\notin \mathcal {Z}_{B}\). By Lemmas 4.3 and 4.4, \(1\in \mathcal {Z}_{A}\) and \(1,p^{n}q\in \mathcal {Z}_{B}\). Then \(r\mid |A|\), we may assume that \(|A|=p^{t}rm\), where \(\gcd (p,m)=1\).

If \(r\in \mathcal {Z}_{A}\), by Lemma 3.3 (2), \(\chi _{1,p^n}(A_{j,k}-A_{0,k})=0\). Since \(p^{n}r\notin \mathcal {Z}_{B}\), then \(A_{j,k}\cap A_{0,k}=\emptyset \). Hence, \(\chi _{1,p^n}(A_{j,k})=0\) for all \(j\in [0,q-1], k\in [0,r-1]\). This shows that A is a union of \(\mathbb {Z}_{p}\)-cosets, which is a contradiction. Therefore \(r\not \in \mathcal {Z}_{A}\).

Claim: \(p^{n-1}qr\in \mathcal {Z}_{B}\).

Assume to the contrary, \(p^{n-1}qr\not \in \mathcal {Z}_{B}\). Since \(1\in \mathcal {Z}_{A}\), by Corollary 3.2 (1),

$$\begin{aligned} \chi _{1,p^n}(A_{j,k}-A_{j,0}-A_{0,k}+A_{0,0})=0. \end{aligned}$$

Then for any \(a^{i_0}\in A_{0,0}\), we have \(a^{i_0+up^{n-1}}\notin A_{0,0}\) for \(u\in [1,p-1]\). Note that \(p^{n}r\notin \mathcal {Z}_{B}\). We can get that \(A_{j,0}\cap A_{0,0}=\emptyset \), and then \(a^{i_0}\notin A_{j,0}\).

If \(a^{i_0}\notin A_{0,k}\), then \(a^{i_0+up^{n-1}}\in A_{j,k}\). This leads to \(p=2\), since every \(A_{j,k}\) contains at most one element from every \(\mathbb {Z}_p\)-coset, hence \(q>2\). Considering \(\chi _{1,p^n}(A_{j',k}-A_{j',0}-A_{0,k}+A_{0,0})=0\) for some \(j'\ne j\), similarly as before, we can get \(a^{i_0+up^{n-1}}\in A_{j',k}\). This shows that \(p^{n}r\in \mathcal {Z}_{B}\), which is a contradiction. Hence, \(a^{i_0}\in A_{0,k}\).

Then we have \(A_{0,k}-A_{0,0}=0\). Therefore, \(A_{j,k}=A_{j,0}\) for all jk, and then \(A=\sum _{j=0}^{q-1}A_{j,0}b^{j}\sum _{k=0}^{r-1}c^{k}\), which contradicts the fact that A is not a union of \(\mathbb {Z}_{r}\)-cosets. This ends the proof of claim.

Claim: \(qr\in \mathcal {Z}_{A}\).

Assume to the contrary, \(qr\not \in \mathcal {Z}_{A}\). Since \(p^{n-1}qr,p^{n}q\in \mathcal {Z}_{B}\), by Corollary 3.2 (2) and (4), we have

$$\begin{aligned}&\sum _{j=0}^{q-1}|B_{j,k}|=p^{t}m,\\&\chi _{p^{n-1},p^n}\left( \sum _{j=0}^{q-1}\sum _{k=0}^{r-1}B_{j,k}\right) =0. \end{aligned}$$

Note that \(r,qr\not \in \mathcal {Z}_{A}\). We have \(\{i\pmod {p}:\ a^{i}\in \cup _{j=0}^{q-1}B_{j,k}\}=\{i_{k}\}\) for some \(i_{k}\in [0,p-1]\). Then we can compute to get that

$$\begin{aligned} 0&=\chi _{p^{n-1},p^n}\left( \sum _{j=0}^{q-1}\sum _{k=0}^{r-1}B_{j,k}\right) \\&=\sum _{k=0}^{r-1}\chi _{p^{n-1},p^n}\left( \sum _{j=0}^{q-1}B_{j,k}\right) \\&=\sum _{k=0}^{r-1}\sum _{j=0}^{q-1}|B_{j,k}|e^{\frac{2\pi i\cdot i_{k}}{p}}\\&=p^{t}m\sum _{k=0}^{r-1}e^{\frac{2\pi i\cdot i_{k}}{p}}, \end{aligned}$$

which contradicts \(p\not \mid r\). This ends the proof of claim.

Since \(r\notin \mathcal {Z}_{A}\), WLOG, the nonempty sets \(B_{j,k}\) are as follows (after permuting the rows and columns of \((B_{j,k})_{j\in [0,q-1],k\in [0,r-1]}\))

$$\begin{aligned} \begin{array}{cccccccccccccc} B_{0,0}&{}\cdots &{}B_{0,s_{0}-1} &{} &{} &{} &{} &{} B_{0,s_{u}} &{} \cdots &{} B_{0,s_{u+1}-1} &{} \cdots &{} B_{0,s_{u+p-1}} &{} &{} B_{0,s_{u+p}-1} \\ &{} &{} &{} \ddots &{} &{} &{} &{} \vdots &{} \vdots &{} \vdots &{} \cdots &{} \vdots &{} \vdots &{} \vdots \\ &{} &{} &{} &{} B_{u,s_{u-1}}&{}\cdots &{}B_{u,s_{u}-1} &{} \cdots &{} \cdots &{} \cdots &{} \cdots &{} \cdots &{} \cdots &{} \cdots \\ &{} &{}&{} &{} &{} &{} &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots \\ &{} &{} &{} &{} &{} &{} &{} B_{q-1,s_{u}} &{} \cdots &{} B_{q-1,s_{u+1}-1} &{} \cdots &{} B_{q-1,s_{u+p-1}} &{} &{} B_{q-1,s_{u+p}-1} \end{array}, \end{aligned}$$

where \(0=:s_{-1}\le s_{0}\le s_{1}\le \cdots \le s_{u+p}:=r\), \(|\{i\pmod {p}:\ a^{i}\in B_{j,k}\}|\ge 2\) for \(j\in [0,u]\), \(k\in [s_{j-1},s_{j}-1]\), and \(\{l\pmod {p}:\ a^{l}\in \cup _{j=0}^{q-1}B_{j,k}\}=\{i\}\) for \(k\in [s_{u+i},s_{u+i+1}-1]\), \(i\in [0,p-1]\). Since \(p^{n}q\in \mathcal {Z}_{B}\), we have

$$\begin{aligned}&|B_{j,k}|=p^{t}m \text { for }j\in [0,u],k\in [s_{j-1},s_{j}-1],\\&\sum _{j=0}^{q-1}|B_{j,k}|=p^{t}m\text { for }k\in [s_{u},s_{u+p}-1]. \end{aligned}$$

Case 1: \(0< s_{u}<r\).

For this case, \(|I_1|\le t\). By the pigeonhole principle, we have \(|I_1|\ge \log _{p}(p^{t}m)\). Then \(m=1\).

If \(q\in \mathcal {Z}_{A}\), note that \(1,qr\in \mathcal {Z}_{A}\), by Lemma 3.3 (1) and (4), we have

$$\begin{aligned}&\chi _{1,p^n}(A_{j,k}-A_{j,0})=0\text { for all }j\in [0,q-1], k\in [0,r-1],\\&\chi _{1,p^n}\left( \sum _{j=0}^{q-1}A_{j,k}\right) =0\text { for all }k\in [0,r-1]. \end{aligned}$$

Since \(r\notin \mathcal {Z}_{A}\), then there exists jk such that \(\chi _{1,p^n}(A_{j,k})\ne 0\). Hence, there exists \(a^{i_0}\in A_{j,k}\) but \(a^{i_0+up^{n-1}}\notin A_{j,k}\) for some \(u\in [1,p-1]\). Moreover, \(a^{i_0}\in A_{j,0}\) and \(a^{i_0+up^{n-1}}\in A_{j',k}\) for some \(j'\ne j\). This shows that \(p^{n-1},p^{n-1}r\in \mathcal {Z}_{B}\). By Lemma 3.3 (2), we have

$$\begin{aligned} \chi _{p^{n-1},p^n}(B_{j,k}-B_{0,k})=0\text { for all }j\in [0,q-1], k\in [0,r-1]. \end{aligned}$$

Then we deduce that \(|B_{j,k}|=|B_{0,k}|\) for \(j\in [0,q-1],k\in [s_{u},s_{u+p}-1]\), which contradicts \(\sum _{j=0}^{q-1}|B_{j,k}|=p^{t}\) for \(k\in [s_{u},s_{u+p}-1]\). Hence \(q\not \in \mathcal {Z}_{A}\).

Now the nonempty sets \(B_{j,k}\) are as follows

$$\begin{aligned} \begin{array}{cccccccccccccc} B_{0,0} &{} &{} &{} &{} &{} &{} &{} &{} &{} \\ &{} \ddots &{} &{} &{} &{} &{} &{} &{} &{} \\ &{} &{} B_{u,u}&{} &{} &{} &{} &{} &{} &{} \\ &{} &{} &{} B_{u+1,s_{u}} &{} \cdots &{} B_{u+1,s_{u+1}-1} &{} &{} &{} &{} \\ &{} &{} &{} \vdots &{} \ddots &{} \vdots &{} &{} &{} &{} \\ &{} &{} &{} B_{u+j_{1},s_{u}} &{} \cdots &{} B_{u+j_{1},s_{u+1}-1} &{} &{} &{} &{} \\ &{} &{} &{} &{} &{} &{} \ddots &{} &{} &{} \\ &{} &{} &{} &{} &{} &{} &{} B_{u+j_{p-1}+1,s_{u+p-1}} &{} \cdots &{} B_{u+j_{p-1}+1,s_{u+p}-1} \\ &{} &{} &{} &{} &{} &{} &{} \vdots &{} \ddots &{} \vdots \\ &{} &{} &{} &{} &{} &{} &{} B_{u+j_{p},s_{u+p-1}} &{} \cdots &{} B_{u+j_{p},s_{u+p}-1} \end{array}. \end{aligned}$$

Since \(\cup _{l=0}^{q-1}\{l\pmod {p}:\ a^{l}\in B_{j,k}\}=\{i\}\) for \(k\in [s_{u+i},s_{u+i+1}-1]\), \(i\in [0,p-1]\), then \(p^{n-1},p^{n-1}q,p^{n-1}r\notin \mathcal {Z}_{B}\). Hence, for any \(j_1\in [0,q-1],\ k_1\in [0,r-1]\) and \(a^{i_0}\in A_{j_1,k_1}\), we have \(a^{i_0+up^{n-1}}\notin A_{j,k}\) for all \(u\in [1,p-1]\), \((j,k)\ne (j_1,k_1)\). Note that \(qr\in \mathcal {Z}_{A}\). By Corollary 3.2 (4), \(\chi _{1,p^n}(\sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{j,k})=0\). Then we have \(\chi _{1,p^n}(A_{j,k})=0\) for all \(j\in [0,q-1],k\in [0,r-1]\). This implies A is a union of \(\mathbb {Z}_p\)-cosets, which is a contradiction.

Case 2: \(s_{u}=0\).

For this case, the nonempty sets \(B_{j,k}\) are as follows

$$\begin{aligned} \begin{array}{ccccccc} B_{0,s_{u}} &{} \cdots &{} B_{0,s_{u+1}-1} &{} \cdots &{} B_{0,s_{u+p-1}} &{} &{} B_{0,s_{u+p}-1} \\ \vdots &{} \vdots &{} \vdots &{} \cdots &{} \vdots &{} \vdots &{} \vdots \\ \cdots &{} \cdots &{} \cdots &{} \cdots &{} \cdots &{} \cdots &{} \cdots \\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots \\ B_{q-1,s_{u}} &{} \cdots &{} B_{q-1,s_{u+1}-1} &{} \cdots &{} B_{q-1,s_{u+p-1}} &{} &{} B_{q-1,s_{u+p}-1} \\ \end{array}, \end{aligned}$$

where \(0=s_{u}\le \cdots \le s_{u+p}=r\), and \(\{l\pmod {p}:\ a^{l}\in \cup _{j=0}^{q-1}B_{j,k}\}=\{i\}\) for \(k\in [s_{u+i},s_{u+i+1}-1]\), \(i\in [0,p-1]\).

If \(q\in \mathcal {Z}_{A}\), note that \(1,qr\in \mathcal {Z}_{A}\), by Lemma 3.3 (1) and (4), we have

$$\begin{aligned}&\chi _{1,p^n}(A_{j,k}-A_{j,0})=0 \text { for all }j\in [0,q-1], k\in [0,r-1],\\&\chi _{1,p^n}\left( \sum _{j=0}^{q-1}A_{j,k}\right) =0\text { for all }k\in [0,r-1]. \end{aligned}$$

Since \(r\notin \mathcal {Z}_{A}\), then there exist jk such that \(\chi _{1,p^n}(A_{j,k})\ne 0\). Hence, there exists \(a^{i_0}\in A_{j,k}\) but \(a^{i_0+up^{n-1}}\notin A_{j,k}\) for some \(u\in [1,p-1]\). Moreover, \(a^{i_0}\in A_{j,0}\) and \(a^{i_0+up^{n-1}}\in A_{j',k}\). This shows that \(p^{n-1},p^{n-1}r\in \mathcal {Z}_{B}\). By Lemma 3.3 (2), we have

$$\begin{aligned} \chi _{p^{n-1},p^n}(B_{j,k}-B_{0,k})=0. \end{aligned}$$

Thus \(|B_{j,k}|=|B_{0,k}|\) for \(k\in [s_{u},s_{u+p}-1]\). Therefore, \(|B|=\sum _{j,k}|B_{j,k}|=p^{t}qrm'\), and \(|B_{j,k}|=p^{t}m'\) for all \(j\in [0,q-1], k\in [0,r-1]\), which contradicts \(p^{n}r\notin \mathcal {Z}_{B}\). Hence, \(q\not \in \mathcal {Z}_{A}\).

Now the nonempty sets \(B_{j,k}\) are as follows

$$\begin{aligned} \begin{array}{cccccccccccccc} B_{0,s_{u}} &{} \cdots &{} B_{0,s_{u+1}-1} &{} &{} &{} &{} \\ \vdots &{} \ddots &{} \vdots &{} &{} &{} &{} \\ B_{j_{1},s_{u}} &{} \cdots &{} B_{j_{1},s_{u+1}-1} &{} &{} &{} &{} \\ &{} &{} &{} \ddots &{} &{} &{} \\ &{} &{} &{} &{} B_{j_{p-1}+1,s_{u+p-1}} &{} \cdots &{} B_{j_{p-1}+1,s_{u+p}-1} \\ &{} &{} &{} &{} \vdots &{} \ddots &{} \vdots \\ &{} &{} &{} &{} B_{j_{p},s_{u+p-1}} &{} \cdots &{} B_{j_{p},s_{u+p}-1} \\ \end{array}. \end{aligned}$$

Since \(\{l\pmod {p}:\ a^{l}\in \cup _{i=0}^{q-1}B_{j,k}\}=\{i\}\) for \(k\in [s_{u+i},s_{u+i+1}-1]\), \(i\in [0,p-1]\), then \(p^{n-1}q,p^{n-1}r\notin \mathcal {Z}_{B}\).

If \(p^{n-1}\in \mathcal {Z}_{B}\), by Corollary 3.2 (1), we have

$$\begin{aligned} \chi _{p^{n-1},p^n}(B_{j_{p-1}+1,s_{u+p-1}}-B_{j_{p-1}+1,0}-B_{0,s_{u+p-1}}+B_{0,0})=0. \end{aligned}$$

That is \(\chi _{p^{n-1},p^n}(B_{j_{p-1}+1,s_{u+p-1}}+B_{0,0})=0\). Note that \(\{i\pmod {p}:\ a^{i}\in B_{0,0}\}=\{0\}\) and \(\{i\pmod {p}:\ a^{i}\in B_{j_{p-1}+1,s_{u+p-1}}\}=\{p-1\}\). We deduce that \(p=2\) and \(|B_{j_{p-1}+1,s_{u+p-1}}|=|B_{0,0}|\). A similar discussion as above, we can get that all nonempty \(B_{j,k}\) have the same size. Hence \(j_p<q-1\). By Corollary 3.2 (1), we have

$$\begin{aligned} \chi _{p^{n-1},p^n}(B_{q-1,r-1}-B_{q-1,0}-B_{0,r-1}+B_{0,0})=0. \end{aligned}$$

This shows that \(\chi _{p^{n-1},p^n}(B_{0,0})=0\). This contradicts \(\{i\pmod {p}:\ a^{i}\in B_{0,0}\}=\{0\}\). Hence \(p^{n-1}\notin \mathcal {Z}_{B}\).

Note that \(p^{n-1}q,p^{n-1}r\notin \mathcal {Z}_{B}\). Then for any \(j_1\in [0,q-1],\ k_1\in [0,r-1]\), \(a^{i_0}\in A_{j_1,k_1}\), we have \(a^{i_0+up^{n-1}}\notin A_{j,k}\) for all \(u\in [1,p-1]\) and \((j,k)\ne (j_1,k_1)\). Since \(qr\in \mathcal {Z}_{A}\), by Corollary 3.2 (4),

$$\begin{aligned} \chi _{1,p^n}\left( \sum _{j=0}^{q-1}\sum _{k=0}^{r-1}A_{j,k}\right) =0. \end{aligned}$$

Then we have \(\chi _{1,p^n}(A_{j,k})=0\) for all \(j\in [0,q-1], k\in [0,r-1]\). This implies A is a union of \(\mathbb {Z}_p\)-cosets, which is a contradiction.

Case 3: \(s_{u}=r\).

For this case, the nonempty sets \(B_{j,k}\) are as follows

$$\begin{aligned} \begin{array}{ccccccc} B_{0,0}&{}\cdots &{}B_{0,s_{0}-1} &{} &{} &{} &{} \\ &{} &{} &{} \ddots &{} &{} &{} \\ &{} &{} &{} &{} B_{u,s_{u-1}}&{}\cdots &{}B_{u,s_{u}-1} \end{array}, \end{aligned}$$

where \(s_u=r\) and \(u\le q-1\). Then \(|B_{j,k}|=p^{t}m\) for \(j\in [0,u]\) and \(k\in [s_{j-1},s_{j}-1]\). By the pigeonhole principle, we have \(m=1\), \(|I_{1}|=t\), and \(|B_{j,k}|=p^{t}\) for \(j\in [0,u]\), \(k\in [s_{j-1},s_{j}-1]\). Hence \(|A|=|B|=p^{t}r\).

By Lemma 2.10, for all \(j\in [0,u]\) and \(k\in [s_{j-1},s_{j}-1]\), the elements of \(B_{j,k}\) have the form \(a^{\alpha _0+\alpha _1p+\cdots +\alpha _{n-1}p^{n-1}}\), where \(\alpha _i\in [0,p-1]\) satisfy the following conditions:

  1. 1.

    if \(i\in I_1\), then \(\alpha _i\) can take every value from \([0,p-1]\);

  2. 2.

    if \(j\notin I_1\), the value of \(\alpha _j\) depends solely on \(\alpha _0,\dots ,\alpha _{j-1}\).

For any \(i\in I_1\), let \(s=\{l\in I_1: l\ge i\}\), we can partition \(B_{j,k}\) into \(p^{t-s}\) parts, say \(P_1,P_2,\dots ,P_{p^{t-s}}\), such that for any \(a^{u},a^{v}\in P_{x}\), we have \(v_{p}(u-v)\ge i\). Then \(|P_{x}|=p^{s}\), \(x\in [1,p^{t-s}]\). Fix an element \(a^{u_0}\in P_x\), for each \(w\in [0,p-1]\), there are exactly \(p^{s-1}\)’s \(a^{v}\in P_x\) such that \(u_0-v\) has the form \(wp^i+\alpha _{i+1}p^{i+1}+\cdots +\alpha _{n-1}p^{n-1}\). Then we can compute to get that \(\chi _{p^{n-1-i},p^n}(B_{j,k})=\chi _{p^{n-1-i},p^n}(\sum _{x=1}^{p^{t-s}}P_x)=0\) for any \(i\in I_1\), \(j\in [0,q-1]\), \(k\in [0,r-1]\). Hence \(J_1=\{n-1-i: i\in I_1\}.\)

Claim: \(p^{n}\notin \mathcal {Z}_{B}\).

If \(p^{n}\in \mathcal {Z}_{B}\), then by Corollary 3.2 (1),

$$\begin{aligned} |B_{u,s_{u-1}}|-|B_{0,s_{u-1}}|-|B_{u,0}|+|B_{0,0}|=0. \end{aligned}$$

We have \(|B_{u,s_{u-1}}|+|B_{0,0}|=0\), which is a contradiction. Hence \(p^{n}\notin \mathcal {Z}_{B}\). This ends the proof of claim.

Claim: For \(i\in [0,n-1]\), \(p^{i}\in \mathcal {Z}_B\) if and only if \(p^{i}qr\in \mathcal {Z}_B\).

If \(p^{i}qr\in \mathcal {Z}_B\), that is \(i\in J_1\), from above discussion, we have \(\chi _{p^{i},p^n}(B_{j,k})=0\) for any \(j\in [0,q-1]\), \(k\in [0,r-1]\), and so \(p^{i}\in \mathcal {Z}_B\). Now we assume that \(p^{i}\in \mathcal {Z}_B\).

If \(u<q-1\), by Corollary 3.2 (1),

$$\begin{aligned} \chi _{p^i,p^n}(B_{u,s_{u-1}}-B_{u,0}-B_{q-1,s_{u-1}}+B_{q-1,0})=0. \end{aligned}$$

Then we get \(\chi _{p^i,p^n}(B_{u,s_{u-1}})=0\). Similarly, we can get that \(\chi _{p^i,p^n}(B_{j,k})=0\) for all \(j\in [0,q-1]\), \(k\in [0,r-1]\). Hence \(p^{i}qr\in \mathcal {Z}_B\).

If \(u=q-1\) and \(q\ge 3\), by Corollary 3.2 (1),

$$\begin{aligned} \chi _{p^i,p^n}(B_{u,s_{u-1}}-B_{u,0}-B_{u-1,s_{u-1}}+B_{u-1,0})=0. \end{aligned}$$

Then we get \(\chi _{p^i,p^n}(B_{u,s_{u-1}})=0\). Similarly, we can get that \(\chi _{p^i,p^n}(B_{j,k})=0\) for all \(j\in [0,q-1]\), \(k\in [0,r-1]\). Hence \(p^{i}qr\in \mathcal {Z}_B\).

If \(u=q-1\) and \(q=2\), by Corollary 3.2 (1),

$$\begin{aligned} \chi _{p^i,p^n}(B_{1,s_{0}}-B_{1,0}-B_{0,s_{0}}+B_{0,0})=0. \end{aligned}$$

That is

$$\begin{aligned} \chi _{p^i,p^n}(B_{1,s_{0}}+B_{0,0})=0. \end{aligned}$$

Then for any \(a^{u}\in B_{0,0}\), there exist at least two elements among \(a^{u}, a^{u+p^{n-1-i}+f(u,1)p^j}, a^{u+2p^{n-1-i}+f(u,2)p^j}\) that belong to \(B_{0,0}\) or \(B_{1,s_{0}}\), where f(u, 1), f(u, 2) are certain integers and \(j>n-1-i\). This implies \(n-1-i\in I_1\), which in turn implies \(i\in J_1\). That is \(p^{i}qr\in \mathcal {Z}_B\). This ends the proof of claim.

Subcase 3.1: \(r>q\).

Define

$$\begin{aligned} T=\{a^{\sum _{i\in [0,n-1]\backslash J_1}a_ip^i}(bc)^j:\ a_i\in [0,p-1],j\in [0,q-1]\}. \end{aligned}$$

Note that the elements of \(TT^{(-1)}\) have the form \((bc)^j\) or \(a^{l}(bc)^j\), where \(v_p(l)\in [0,n-1]\backslash J_1\), \(j\in [0,q-1]\). On the other hand, from above claims, \(p^{n}\notin \mathcal {Z}_B\) and \(p^{i},p^iqr\notin \mathcal {Z}_B\) for all \(i\in [0,n-1]\backslash J_1\). This implies \(AA^{(-1)}\cap TT^{(-1)}=\{e\}\) (note that the group is written multiplicatively, and this is the multiplicative version of Lemma 2.4 (d)). Since \(|A||T|=p^nqr\), by Lemma 2.4 (d), (AT) forms a tiling pair in \(\mathbb {Z}_{p^nqr}\), which is a contradiction.

Subcase 3.2: \(q>r\).

For this case, we have \(B_{q-1,k}=\emptyset \) for all \(k\in [0,r-1]\).

If \(p^ir\in \mathcal {Z}_{B}\), by Corollary 3.2 (3), we have

$$\begin{aligned} \chi _{p^i,p^n}\left( \sum _{k=0}^{r-1}(B_{j,k}-B_{q-1,k})\right) =0. \end{aligned}$$

that is \(\chi _{p^i,p^n}(\sum _{k=0}^{r-1}B_{j,k})=0\). Then we have \(\chi _{p^i,p^n}(\sum _{j=0}^{q-1}\sum _{k=0}^{r-1}B_{j,k})=0\). By Corollary 3.2 (4), \(p^{i}qr\in \mathcal {Z}_{B}\). Hence, we have proved that \(p^ir\notin \mathcal {Z}_{B}\) for all \(i\in [0,n-1]\backslash J_1\).

Define

$$\begin{aligned} T=\{a^{\sum _{i\in [0,n-1]\backslash J_1}a_ip^i}b^j:\ a_i\in [0,p-1],j\in [0,q-1]\}. \end{aligned}$$

Note that the elements of \(TT^{(-1)}\) have the form \(b^j\) or \(a^{l}b^j\), where \(v_p(l)\in [0,n-1]\backslash J_1\), \(j\in [0,q-1]\). On the other hand, \(p^nr\notin \mathcal {Z}_B\) and \(p^ir,p^iqr\notin \mathcal {Z}_B\) for all \(i\in [0,n-1]\backslash J_1\). This implies \(AA^{(-1)}\cap TT^{(-1)}=\{e\}\). Since \(|A||T|=p^nqr\), by Lemma 2.4 (d), (AT) forms a tiling pair in \(\mathbb {Z}_{p^nqr}\), which is a contradiction. \(\square \)

By Lemma 4.5, we have the following corollary.

Corollary 4.6

\(|I_2|+|J_2|\ge 2\).

Now we divide our discussion into 2 cases according to the size of \(I_2,J_2\).

4.1 \(|I_{2}|=2\) or \(|J_2|=2\)

Assume that \(|I_1|=t\), then we have \(p^{t}qr\mid |A|\). If \(|A|=|B|>p^{t}qr\), then there exist \(j\in [0,q-1], k\in [0,r-1]\) such that \(|B_{j,k}|>p^{t}\). By the pigeonhole principle, we have \(|I_{1}|\ge t+1\), which is a contradiction.

Now we assume that \(|A|=p^{t}qr\), then \(|J_{1}|\le t\). By the pigeonhole principle again, we have \(|A_{j,k}|=p^{t}\) for any \(j\in [0,q-1], k\in [0,r-1]\). Then \(|J_{1}|=t\). Denote

$$\begin{aligned} T:=\{a^{\sum _{i\in [0,n-1]\backslash J_{1}}x_{i}p^{i}}: x_{i}\in [0,p-1]\}. \end{aligned}$$

If \((AA^{(-1)})\cap (TT^{(-1)})\ne \{e\}\), then there exists \(i\in [0,n-1]\backslash J_{1}\), such that \(p^{i}qr\in \mathcal {Z}_{B}\), which is a contradiction. Hence \((AA^{(-1)})\cap (TT^{(-1)})=\{e\}\). By Lemma 2.4 (d), (AT) forms a tiling pair in \(\mathbb {Z}_{p^{n}qr}\), which contradicts the fact that A is not a tiling set.

4.2 \(|I_{2}|=|J_{2}|=1\)

By Lemma 4.5, WLOG, we assume that \(p^{n}q\in \mathcal {Z}_{A}\), \(p^{n}r\not \in \mathcal {Z}_{A}\), \(p^{n}r\in \mathcal {Z}_{B}\) and \(p^{n}q\not \in \mathcal {Z}_{B}\). Then \(qr\mid |A|\). Assume that \(|A|=p^{t}qrm\). A similar discussion as Sect. 4.1, we can get that \(m=1\), \(|A|=p^tqr\) and \(|A_{j,k}|=p^t\) for \(j\in [0,q-1], k\in [0,r-1]\). This shows that \(p^{n}q,p^nr\in \mathcal {Z}_{A}\), which is a contradiction.

Now we have proved that if (AB) is a spectral pair in \(\mathbb {Z}_{p^{n}qr}\), then A is a tiling set in \(\mathbb {Z}_{p^{n}qr}\).