1 Introduction

The following notations will be use in this paper.

  • Let \(F_q\) be the finite field of order q and \(F_q^*\) be its multiplicative group.

  • For a positive integer n, let \(Z_n\) be the residual-class ring of integers module n and \(nZ_{nr}\) the unique additive subgroup \(\{0,n,\ldots ,(r-1)n\}\) of order r in \(Z_{nr}\). Obviously, \(F_n\) is equal to \(Z_n\) if n is a prime.

  • Let \(W=\{w_1,\ldots , w_k\}\) be an ordering of a set of k positive integers with each \(w_j\ge 3\), and \(\eta =max\{w_j:1\le j\le k\}\).

  • Let \(Q=(q_1, \ldots , q_k)\) be a k-tuple of positive rational numbers with \(\sum _{j=1}^kq_j=1\).

  • Let \(N=\{n_0,n_1,\ldots ,n_{l-1}\}\) be a set of l positive integers and \(M=[m_0,m_1,\ldots ,m_{l-1}]\) be an multi-set of l positive integers.

  • For a non-empty subset of \(B\subset Z_n\), the list of differences of B is defined to be the multiset \(\Delta B=[b-b'\pmod {n}:(b',b)\in B\times B, b\ne b']\).

  • For non-empty subsets \(B_e\subset Z_{n_e}\) and \(B_s\subset Z_{n_s}\), the external difference list of ordered pair \((B_e,B_s)\) is defined to be the multiset \(\Delta _E(B_e,B_s)=[y-x\pmod {n_e}:(x,y)\in B_e\times B_s]\).

An (nW, 1) difference packing (briefly (nW, 1)-DP) is a family \({\mathscr {F}}\) of \(w_j\)-subsets (base blocks) of \(Z_n\) whose list of differences \(\Delta {\mathscr {F}}=\bigcup _{B\in {\mathscr {F}}}\Delta B\) covers every element of \(Z_n\setminus \{0\}\) at most once, where \(w_j\in W\). The number of base blocks in \({\mathscr {F}}\) is called its size. The difference leave of \({\mathscr {F}}\) is a proper subset \(Z_n\setminus \Delta {\mathscr {F}}\) of \(Z_n\), denoted by DL\(({\mathscr {F}})\). If \(Z_n\setminus \Delta {\mathscr {F}}\) forms an additive subgroup H of \(Z_n\) having order g, then \({\mathscr {F}}\) is said to be g-regular [32] or a relative difference family with parameters (ngW, 1) [6], shortly denoted by (ngW, 1)-DF. In this case, the difference list \(\Delta {\mathscr {F}}\) contains each element of \(Z_n\setminus H\) exactly once and no element from H. When \(W=\{w\}\), we will omit the braces. Many series of optimal constant-weight optical orthogonal codes (CWOOCs) were produced by (ngw, 1)-DFs, the interested reader may refer to [1, 4, 6, 11, 17, 32, 34] and the references therein. In particular, an (n, 1, w, 1)-DF is usually called a difference family and simply denoted by (nw, 1)-DF. For the existence of (nw, 1)-DFs, the interested reader may refer to [5, 9, 12, 13] and the references therein.

An (nW, 1, Q)-DP \({\mathscr {F}}\) is an (nW, 1)-DP with the property that the ratio of base blocks of size \(w_j\) is \(q_j\), \(1\le j\le k\). If the number of base blocks of size \(w_j\) is \(\frac{1}{k}|{\mathscr {F}}|\) for \(1\le j\le k\), then an (nW, 1)-DP is said to be balanced. Q is normalized if \(Q=(\frac{a_1}{b},\ldots ,\frac{a_k}{b})\) with gcd\((a_1,\ldots ,\) \(a_k)=1\). From the definition of an (nW, 1, Q)-DP with normalized Q, the largest size of \({\mathscr {F}}\) is upper bounded by

$$\begin{aligned} b\left\lfloor \frac{n-1}{\sum \limits _{j=1}^{k}a_jw_j(w_j-1)}\right\rfloor \end{aligned}$$

An (nW, 1, Q)-DP \({\mathscr {F}}\) is said to be optimal if the largest size of \({\mathscr {F}}\) reaches the upper bound. Optimal (nW, 1, Q)-DPs, which are related to optimal (nW, 1, Q) variable-weight OOCs, have been considered in several papers such as [10, 30, 36] and the references therein. Using standard techniques in design theory, the following result is clear.

Lemma 1

If \(1\le g\le \sum _{j=1}^ka_jw_j(w_j-1)\), then an (ngW, 1, Q)-DF is optimal, where \(Q=(\frac{a_1}{b},\ldots ,\frac{a_k}{b})\) is normalized.

Suppose that \(n_e\) and \(n_s\) are any two positive integers (\(n_e\) may be equal to \(n_s\)). We give the following definitions that are similar to the ones of [20]. For any non-empty subsets \(B_e\subset Z_{n_e}\) and \(B_s\subset Z_{n_s}\), the external difference list \(\Delta _E(B_e,B_s)\) contains a zero when \(|B_e\cap B_s|\ne 0\). Clearly, the number of occurrences of \(\theta \in Z_{n_e}\) in \(\Delta _E(B_e,B_s)\) is equal to

$$\begin{aligned} \Theta _{(B_e,B_s)}(\theta )=|(B_e\oplus _{e}\theta )\cap B_s|, \end{aligned}$$

where \(B_s\) can be regarded as a (multi) subset of \(Z_{n_e}\), and we call \(\Theta _{(B_e,B_s)}(\theta )\) the external difference function with respect to the ordered pair \((B_e,B_s)\) over \(Z_{n_e}\). For any pair \((\theta ,\theta ')\in Z_{n_e}\times Z_{n_s}\), if the following inequalities are satisfied:

$$\begin{aligned} \Theta _{(B_e,B_s)}(\theta )\le \lambda , \end{aligned}$$
(1)
$$\begin{aligned} \Theta _{(B_s,B_e)}(\theta ')\le \lambda , \end{aligned}$$
(2)

then \(B_e\) and \(B_s\) are said to be \(\lambda \)-compatible. Let \({\mathscr {B}}_e\) and \({\mathscr {B}}_s\) be an \((n_e,W,1,Q)\)-DP and an \((n_s,W,1,Q)\)-DP, respectively. We say that two DPs \({\mathscr {B}}_e\) and \({\mathscr {B}}_s\) are \(\lambda \)-compatible, if both (1) and (2) hold for any base blocks \(B_e\in {\mathscr {B}}_e\) and \(B_s\in {\mathscr {B}}_s\). From the definition, it is easy to obtain the following result.

Lemma 2

Two (nW, 1, Q)-DPs, say \({\mathscr {B}}_1\) and \({\mathscr {B}}_2\), are \(\lambda \)-compatible if and only if \(\Theta _{(B_1,B_2)}(\theta )\) cannot exceed \(\lambda \) for any \(\theta \in Z_n\), \(B_1\in {\mathscr {B}}_1\) and \(B_2\in {\mathscr {B}}_2\).

The following two results are from [35], which are analogous of those in [20].

Lemma 3

Let \({\mathscr {B}}\) be an (nW, 1, Q)-DP and \(-{\mathscr {B}}=\{-B:B\in {\mathscr {B}}\}\), then \({\mathscr {B}}\) and \(-{\mathscr {B}}\) are 2-compatible.

Lemma 4

Let \({\mathscr {B}}\) and \({\mathscr {B}}'\) be two (nW, 1, Q)-DPs. If \(\Delta (T)\ne \Delta (T')\) for any two base blocks \(B\in {\mathscr {B}}\), \(B'\in {\mathscr {B}}'\) and any triples \(T\subseteq B\), \(T'\subseteq B'\), then \({\mathscr {B}}\), \({\mathscr {B}}'\), \(-{\mathscr {B}}\) and \(-{\mathscr {B}}'\) are pairwise 2-compatible.

Research on pairwise \(\lambda \)-compatible (nW, 1, Q)-DPs has mainly concentrated on the case \(\lambda =2\) (the minimum nontrivial value). Previous studies have mainly focused on W as a single point set, that is, all blocks have the same size. In [2] and [3], Bao and Ji construct some series of pairwise 2-compatible (ngw, 1)-DFs for \(w=3,4\). For general W, as far as we know, there are few results about the existence of pairwise 2-compatible (ngW, 1, Q)-DFs except for some results on \(W=\{3,4\}\) in [35]. In this paper, in addition to further studying the case of \(W=\{3,4\}\), we also consider pairwise 2-compatible balanced (ngW, 1)-DFs for \(W=\{3,5\}\).

The remainder of this paper is organized as follows. In Sect. 2, a new consequence o Weil’s theorem on multiplicative character sums is presented. In Sect. 3, by using cyclotomic classes, we can get some direct constructions of pairwise 2-compatible balanced (ngW, 1)-DFs for \(W=\{3,4\},\{3,5\}\). Section 4 presents recursive constructions for compatible (NMW, 1, Q; 2) difference packing set systems by means of semicyclic group divisible designs. Consequently, several infinite classes of optimal multilength variable-weight optical orthogonal codes (MLVWOOCs) are produced in Sect. 5.

The paper contains many terminologies, for convenience, we summarize some of them in Table 1.

Table 1 Terminologies in this paper

2 A new consequence of Weil’s theorem on multiplicative character sums

Let \(q\equiv 1 \pmod m\) be prime power, once a primitive element \(\theta \) of \(F_q\) has been fixed, then \(C_0^m\) will denote the subgroup of \(F_q\) generated by \(\theta ^m\), we set \(C_i^m=\theta ^iC_0^m\), \(i=1,2,\ldots ,m-1\). We refer to the cosets \(C_0^m,C_1^m,\ldots ,C_{m-1}^m\) of \(C_0^m\) in \(F_q\) as the cyclotomic classes of index m. A transversal of \(C_0^m\) in \(F_q^*\), denoted by \(F_q^*/C_0^m\), is a complete system of representatives for the cosets of a subgroup \(C_0^m\) of \(F_q^*\).

We first recall that a multiplicative character of \(F_q\) is a map \(\chi \) from \(F_q\) to the complex field C such that \(\chi (0)=0\), \(\chi (1)=1\) and \(\chi (xy)=\chi (x)\chi (y)\) for any \(x,y\in F_q\). Here is the statement of the theorem of Weil on multiplicative characters sums (see Theorem 5.41 in [19]).

Theorem 1

[19] Let \(\chi \) be a multiplicative character of order \(m>1\) of \(F_q\) and let \(f\in F_q[x]\) be a polynomial that is not of the form \(ag^m\) for some pair \((a,g)\in F_q\times F_q[x]\). Then, we have:

$$\begin{aligned} \left| \sum \limits _{x\in F_q}\chi [f(x)]\right| \le (d-1)\sqrt{q} \end{aligned}$$

where d is the number of distinct roots of f in its splitting field over \(F_q\).

The following important theorem is a consequence of the theorem of Weil on multiplicative character sums.

Theorem 2

[8] Let \(q\equiv 1 \pmod m\) be a prime power, let \(A=\{a_1,a_2,\ldots ,a_r\}\) be an r-subset of \(F_q\), and \((\alpha _1,\alpha _2,\ldots ,\alpha _r)\) an element of \(Z_m^r\). Set \(X=\{x\in F_q: x+a_i\in C_{\alpha _i}^m, i=1,2,\ldots ,r\}\), then we have

\(|X|\ge \frac{q-U\sqrt{q}-rm^{r-1}}{m^r}\) and hence \(|X|>n\) as soon as \(q>\frac{1}{4}\left( U+\sqrt{U^2+4m^{r-1}(r+mn)}\right) ^2\),

where \(U=\sum \limits _{i=1}^r{r\atopwithdelims ()i}(m-1)^i(i-1)\).

For integers \(m\ge 2\), \(r\ge 1\), \(s\ge 1\) and \(n\ge 0\), let

$$\begin{aligned} Q(m,n,r,s)=\frac{1}{4}\left( U+\sqrt{U^2+4m^{r+s-1}(r+mn)}\right) ^2, \end{aligned}$$

where

$$\begin{aligned} U= & {} \sum \limits _{i=1}^r{r\atopwithdelims ()i}(m-1)^i(i-1)+\sum \limits _{j=1}^s{s\atopwithdelims ()j}(m-1)^j(2j-1)\\&+\sum \limits _{i=1}^r\sum \limits _{j=1}^s{r\atopwithdelims ()i}{s\atopwithdelims ()j}(m-1)^{i+j}(i+2j-1). \end{aligned}$$

In order to construct pairwise 2-compatible (ngW, 1, Q)-DFs with \(W=\{3,5\}\), we extend Theorem 2 to the following result.

Theorem 3

Let \(q\equiv 1 \pmod m\) be a prime power, \(A=\{a_1,a_2,\ldots ,a_r\}\) an r-subset of \(F_q\) and \(B=\{(b_1,c_1),(b_2,c_2),\ldots ,(b_s,c_s)\}\) an s-subset of \(F_q\times F_q\). For an r-tuple \((\alpha _1,\alpha _2,\ldots ,\alpha _r)\in Z_m^r\) and an s-tuple \((\beta _1,\beta _2,\ldots ,\beta _s)\in Z_m^s\). Set

$$\begin{aligned} X=\{x\in F_q: x+a_i\in C_{\alpha _i}^m \ \mathrm{for}\ i=1,2,\ldots ,r; x^2+b_jx+c_j\in C_{\beta _j}^m \ \mathrm{for}\ j=1,2,\ldots ,s\}, \end{aligned}$$

where each \(x^2+b_jx+c_j\) is not of the form \(g^m\) for some \(g\in F_p[x]\), \(x^2+b_jx+c_j\), \(j=1,2,\ldots ,s\), are pairwise coprime and gcd\((x+a_i,x^2+b_jx+c_j)=1\) for each pair (ij). Then we have

$$\begin{aligned} |X|\ge \frac{q-U\sqrt{q}-(r+s)m^{r+s-1}}{m^{r+s}}\, and\, hence \, |X|>n\, as\, soon\, as\, q>Q(m,n,r,s). \end{aligned}$$

Proof

Fix a primitive element \(\theta \) of \(F_q\) and fix a primitive complex mth root of unity \(\varepsilon \), let \(\chi \) be the multiplicative character of \(F_q\) of order m defined by

$$\begin{aligned} \chi (x)=\varepsilon ^l\hbox { for }x\in C_l^m, l=0,1,\ldots ,m-1; \chi (0)=0. \end{aligned}$$

For each \(i=1,2,\ldots ,r\) and each \(j=1,2,\ldots ,s\), let \(f_i(x), g_j(x)\in F_q[x]\) defined by \(f_i(x)=\theta ^{m-\alpha _i}(x+a_i)\) and \(g_j(x)=\theta ^{m-\beta _j}(x^2+b_jx+c_j)\), respectively. Clearly, \(x+a_i\in C_{\alpha _i}^m\) is equivalent to \(f_i(x)\in C_{0}^m\), and \(x^2+b_jx+c_j\in C_{\beta _j}^m\) is equivalent to \(g_j(x)\in C_{0}^m\). We then have

$$\begin{aligned} X=\{x\in F_q: f_i(x)\in C_{0}^m \ \mathrm{for}\ i=1,2,\ldots ,r; g_j(x)\in C_{0}^m \ \mathrm{for}\ j=1,2,\ldots ,s\}. \end{aligned}$$

For each \(x\in F_q\), each \(i=1,2,\ldots ,r\) and each \(j=1,2,\ldots ,s\), we have

$$\begin{aligned} 1+\chi [f_i(x)]+\cdots +\chi [f_i^{m-1}(x)]=\left\{ \begin{array}{ll} m, &{} \mathrm{if } \ f_i(x)\in C_0^m;\\ 0, &{} \mathrm{if } \ f_i(x)\in F_q^*\setminus C_0^m;\\ 1, &{} \mathrm{if } \ f_i(x)=0.\\ \end{array} \right. \end{aligned}$$

and

$$\begin{aligned} 1+\chi [g_j(x)]+\cdots +\chi [g_j^{m-1}(x)]=\left\{ \begin{array}{ll} m, &{} \mathrm{if } \ g_j(x)\in C_0^m;\\ 0, &{} \mathrm{if } \ g_j(x)\in F_q^*\setminus C_0^m;\\ 1, &{} \mathrm{if } \ g_j(x)=0.\\ \end{array} \right. \end{aligned}$$

Now we consider the sum

$$\begin{aligned} S=\sum \limits _{x\in F_q}(\prod \limits _{i=1}^r(1+\chi [f_i(x)]+\cdots +\chi [f_i^{m-1}(x)])\prod \limits _{j=1}^s(1+\chi [g_j(x)]+\cdots +\chi [g_j^{m-1}(x)])). \end{aligned}$$

It is not difficult to see that the contribution to S of a given element \(x\in F_q\), namely the product

$$\begin{aligned} \prod \limits _{i=1}^r(1+\chi [f_i(x)]+\cdots +\chi [f_i^{m-1}(x)])\prod \limits _{j=1}^s(1+\chi [g_j(x)]+\cdots +\chi [g_j^{m-1}(x)]) \end{aligned}$$

is given by:

  1. (1)

    \(m^{r+s}\) if \(f_i(x)\in C_0^m\) for each i and \(g_j(x)\in C_0^m\) for each j, that is the case \(x\in X\).

  2. (2)

    \(m^{r+s-1}\) if \(f_l(x)=0\), \(f_i(x)\in C_0^m\) for \(i\in \{1,\ldots ,r\}\setminus \{l\}\) and \(g_j(x)\in C_0^m\) for \(j\in \{1,\ldots ,s\}\); or \(f_i(x)\in C_0^m\) for \(i\in \{1,\ldots ,r\}\), \(g_l(x)=0\), \(g_j(x)\in C_0^m\) for \(j\in \{1,\ldots ,s\}\setminus \{l\}\). This is because \(f_l(x)=0\) implies that all other \(f_i(x)\ne 0\), and all \(g_j(x)\ne 0\) since \(a_1,a_2,\ldots ,a_r\) are pairewise distinct, \(x^2+b_jx+c_j\), \(j=1,2,\ldots ,s\) are pairwise coprime, and gcd\((x+a_i,x^2+b_jx+c_j)=1\) for each pair (ij). The case for \(g_l(x)=0\) is similar.

  3. (3)

    0 in every other case. It follows that

    $$\begin{aligned} m^{r+s}|X|\le |S|\le m^{r+s}|X|+(r+s)m^{r+s-1}. \end{aligned}$$

    Based on the notation of [8], we identify the set \(\{0,1,\ldots ,m-1\}^r\) with \(Z_m^r\). For each \(\overline{\alpha }=(\alpha _1,\ldots ,\alpha _r)\in Z_m^r\) and each \(\overline{\beta }=(\beta _1,\ldots ,\beta _s)\in Z_m^s\), let \(f_{\overline{\alpha }}(x)=f_1^{\alpha _1}(x)f_2^{\alpha _2}(x)\cdots f_r^{\alpha _r}(x)\) and \(g_{\overline{\beta }}(x)=g_1^{\beta _1}(x)g_2^{\beta _2}(x)\cdots g_s^{\beta _s}(x)\) be the polynomials of \(F_q[x]\). Obviously, expanding S we get

    $$\begin{aligned} S=\sum \limits _{(\overline{\alpha },\overline{\beta })\in Z_m^r\times Z_m^s}\sum \limits _{x\in F_q}\chi (f_{\overline{\alpha }}(x)g_{\overline{\beta }}(x)) \end{aligned}$$

    If \(\overline{0}\) is the all zero r-tuple of \(Z_m^r\), we have \(f_{\overline{0}}(x)=1\). Similarly, \(g_{\overline{0}}(x)=1\). It follows that \(\chi (f_{\overline{0}}(x)g_{\overline{0}}(x))=1\) for each x so that \(\sum _{x\in F_q}\chi (f_{\overline{0}}(x)g_{\overline{0}}(x))=q\). So, we can write

    $$\begin{aligned} S-q=\sum \limits _{(\overline{\alpha },\overline{\beta })\in (Z_m^r\times Z_m^s)\setminus \{(\overline{0},\overline{0})\}}\sum \limits _{x\in F_q}\chi (f_{\overline{\alpha }}(x)g_{\overline{\beta }}(x)). \end{aligned}$$

    Now, for each \(\overline{\alpha }\in Z_m^r\setminus \{\overline{0}\}\), we denote by \(w(\overline{\alpha })\) the weight of \(\overline{\alpha }\), namely the number of nonzero coordinates of \(\overline{\alpha }\). It is obvious that each \(f_{\overline{\alpha }}(x)\) and each \(g_{\overline{\beta }}(x)\) have exactly \(w(\overline{\alpha })\) and \(2w(\overline{\beta })\) distinct roots in their splitting fields over \(F_q\), respectively. By Theorem 1, we have

    $$\begin{aligned} \left| \sum \limits _{x\in F_q}\chi (f_{\overline{\alpha }}(x)g_{\overline{\beta }}(x))\right| \le (w(\overline{\alpha })+2w(\overline{\beta })-1)\sqrt{q}\,\, \hbox {for any pair }(\overline{\alpha },\overline{\beta })\in (Z_m^r\times Z_m^s)\setminus \{(\overline{0},\overline{0})\}. \end{aligned}$$

    So, we have

    $$\begin{aligned}&q-|S|\le |S-q|\le \sum \limits _{(\overline{\alpha },\overline{\beta })\in (Z_m^r\times Z_m^s)\setminus \{(\overline{0},\overline{0})\}}\left| \sum \limits _{x\in F_q}\chi (f_{\overline{\alpha }}(x)g_{\overline{\beta }}(x))\right| \\&\quad \le \sum \limits _{(\overline{\alpha },\overline{\beta })\in (Z_m^r\times Z_m^s)\setminus \{(\overline{0},\overline{0})\}}(w(\overline{\alpha })+2w(\overline{\beta })-1)\sqrt{q} \end{aligned}$$

    which gives

    $$\begin{aligned} |S|\ge q-\sum \limits _{(\overline{\alpha },\overline{\beta })\in (Z_m^r\times Z_m^s)\setminus \{(\overline{0},\overline{0})\}}(w(\overline{\alpha })+2w(\overline{\beta })-1)\sqrt{q}. \end{aligned}$$

    When \(w(\overline{\alpha })\ne 0\) and \(w(\overline{\beta })=0\). For every fixed \(i\in \{1,2,\ldots ,r\}\), the number of elements of \(Z_m^r\setminus \{\overline{0}\}\) such that \(w(\overline{\alpha })=i\) is \({r\atopwithdelims ()i}(m-1)^i\).

    When \(w(\overline{\alpha })=0\) and \(w(\overline{\beta })\ne 0\). For every fixed \(j\in \{1,2,\ldots ,s\}\), the number of elements of \(Z_m^s\setminus \{\overline{0}\}\) such that \(w(\overline{\beta })=j\) is \({s\atopwithdelims ()j}(m-1)^j\).

    When \(w(\overline{\alpha })\ne 0\) and \(w(\overline{\beta })\ne 0\). For every fixed \(i\in \{1,2,\ldots ,r\}\) and every fixed \(j\in \{1,2,\ldots ,s\}\), the number of elements of \((Z_m^r\setminus \{\overline{0}\})\times (Z_m^s\setminus \{\overline{0}\})\) such that \(w(\overline{\alpha })+w(\overline{\beta })=i+j\) is \({r\atopwithdelims ()i}{s\atopwithdelims ()j}(m-1)^{i+j}\). So, we have

    $$\begin{aligned} m^{r+s}|X|+(r+s)m^{r+s-1}\ge |S|\ge q-U\sqrt{q}, \end{aligned}$$

    where

    $$\begin{aligned} U= & {} \sum \limits _{i=1}^r{r\atopwithdelims ()i}(m-1)^i(i-1)+\sum \limits _{j=1}^s{s\atopwithdelims ()j}(m-1)^j(2j-1)\\&+\sum \limits _{i=1}^r\sum \limits _{j=1}^s{r\atopwithdelims ()i}{s\atopwithdelims ()j}(m-1)^{i+j}(i+2j-1). \end{aligned}$$

    The assertion immediately follows. \(\square \)

It is easy to see that \(x^2+x+1\) is not the form of \(g^2\) for \(g\in Z_p[x]\) when \(p\ne 3\). Applying Theorem 3 with \(m=2\), \(n=5\), \(r=3\) and \(s=1\), one can obtain the following result.

Corollary 1

If \(p\equiv 1\pmod {2}\) is a prime and \(p>834\). Set \(X=\{x\in Z_p: x\in C_{1}^2, x-1\in C_{0}^2, x+1\in C_{1}^2, x^2+x+1\in C_0^2\}\), then \(|X|>5\).

3 Direct constructions via cyclotomic classes

For \(W=\{3,4\}\), some direct constructions for pairwise 2-compatible balanced (ngW, 1)-DFs are obtained in [35]. However, it is difficult to construct pairwise 2-compatible balanced (ngW, 1)-DFs when \(\eta \ge 5\). In this section, in addition to further investigating direct constructions of pairwise 2-compatible balanced (ngW, 1)-DFs for \(W=\{3,4\}\), we also consider the case of \(W=\{3,5\}\).

The definition of a strong difference family was introduced by M. Buratti [7]. An \((n,W,\mu )\) strong difference family, or \((n,W,\mu )\)-SDF in short, is a family \({\mathscr {F}}\) of \(w_j\)-subsets of \(Z_n\) whose list of differences \(\Delta {\mathscr {F}}=\bigcup _{B\in {\mathscr {F}}}\Delta B\) covers every element of \(Z_n\) exactly \(\mu \) times, where \(w_j\in W\). An \((n,W,\mu )\)-SDF is said to be balanced if the number of blocks of size \(w_j\) is \(\frac{1}{k}|{\mathscr {F}}|\) for \(1\le j\le k\). Strong difference families are very useful tools for constructing relative difference families (see [7, 8, 21]).

Lemma 5

Let \(p\equiv 1\pmod {18}\) be a prime. If there exist d elements (xy) of \(Z_p^2\) satisfying one of the following conditions:

  1. (1)

    \(x\in C_1^9\), \(x-1\in C_4^9\), \(x+1\in C_3^9\), \(y\in C_5^9\) and \(y^3-y\in C_8^9 \);

  2. (2)

    \(x\in C_2^9\), \(x-1\in C_8^9\), \(x+1\in C_6^9\), \(y\in C_1^9\) and \(y^3-y\in C_7^9\);

  3. (3)

    \(x\in C_5^9\), \(x-1\in C_2^9\), \(x+1\in C_6^9\), \(y\in C_7^9\) and \(y^3-y\in C_4^9\);

  4. (4)

    \(x\in C_7^9\), \(x-1\in C_1^9\), \(x+1\in C_3^9\), \(y\in C_2^9\) and \(y^3-y\in C_4^9\),

where those \(x'\)s are pairwise distinct and \(y'\)s are also pairwise distinct, then there are 2d pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs.

Proof

We can identify \(Z_{2p}\) with \(Z_{2}\times Z_p\) since gcd(p, 2) = 1. We first construct a balanced \((2,\{3,4\},18)\)-SDF as follows: \(B_1=\{0,0,0,1\}\), \(B_2=\{0,0,1,1\}\), \(B_3=\{0,0,1\}\), \(B_4=\{0,0,0\}\).

Let \(V=\{(x,y): x\in C_1^9, x-1\in C_4^9, x+1\in C_3^9, y\in C_5^9, y^3-y\in C_8^9\}\). If condition (1) is satisfied, then \(V\ne \emptyset \). For \((x,y)\in V\), let \({\mathscr {B}}(x,y)=\bigcup _{i=1}^3\{B_{(i,x,t)}:t\in C_0^9/\{-1,1\}\}\bigcup \{B_{(y,t)}:t\in C_0^9/\{-1,1\}\}\), where

$$\begin{aligned} B_{(1,x,t)}= & {} \{(0,0),(0,t),(0,xt),(1,x^2t)\},\\ B_{(2,x,t)}= & {} \{(0,0),(0,x^2t),(1,x^3t),(1,x^4t)\},\\ B_{(3,x,t)}= & {} \{(0,0),(0,x^3t),(1,xt)\},\\ B_{(y,t)}= & {} \{(0,0),(0,yt),(0,y^3t)\}. \end{aligned}$$

We have \(\bigcup \limits _{i=1}^3\Delta B_{(i,x,t)}\bigcup \Delta B_{(y,t)}=\bigcup _{j=0}^1\{j\}\times (\{1,-1\}\cdot \Delta _j\cdot t)\), where

$$\begin{aligned}&\Delta _0=\{1,x,x-1,x^2,x^4-x^3,x^3,y,y^3,y^3-y\},\\&\Delta _1=\{x^2,x^2-1,x^2-x,x^3,x^3-x^2,x^4,x^4-x^2,x,x^3-x\}. \end{aligned}$$

If condition (1) is satisfied, each \(\Delta _{j}\) forms a transversal of \(Z_p^*/C_0^9\). We have

$$\begin{aligned} \Delta {\mathscr {B}}(x,y)&=\bigcup \limits _{t\in C_0^9/\{-1,1\}}(\bigcup \limits _{i=1}^3\Delta B_{(i,x,t)}\bigcup \Delta B_{(y,t)})\\&=\bigcup \limits _{t\in C_0^9/\{-1,1\}}\bigcup _{j=0}^1\{j\}\times (\{1,-1\}\cdot \Delta _j\cdot t)\\&=\bigcup _{j=0}^1\{j\}\times (Z_p\setminus \{0\})=Z_{2}\times (Z_p\setminus \{0\}), \end{aligned}$$

hence each \({\mathscr {B}}(x,y)\) and each \(-{\mathscr {B}}(x,y)\)(=\((-1,-1)\cdot {\mathscr {B}}(x,y)\)) is a balanced \((2p,2,\{3,4\},1)\)-DF. It is left to show that all \({\mathscr {B}}(x,y)\), \(-{\mathscr {B}}(x,y)\) are pairwise 2-compatible.

For any two elements \((u,v),(x,y)\in V\), we will prove that \(B\in {\mathscr {B}}(x,y)\) and \(B'\in {\mathscr {B}}(u,v)\) are 2-compatible. Taking any base blocks \(B_{(1,x,t)}\in {\mathscr {B}}(x,y)\) and \(B_{(1,u,t')}\in {\mathscr {B}}(u,v)\), we have \(\Delta _E(B_{(1,x,t)},B_{(1,u,t')})\) as follows.

$$\begin{aligned} \begin{array}{ccccccccc} (0,0)&{}(0,t)&{}(0,xt)&{}(1,x^2t)\\ (0,-t')&{}(0,t-t')&{}(0,xt-t')&{}(1,x^2t-t')\\ (0,-ut')&{}(0,t-ut')&{}(0,xt-ut')&{}(1,x^2t-ut')\\ (1,-u^2t')&{}(1,t-u^2t')&{}(1,xt-u^2t')&{}(0,x^2t-u^2t')\\ \end{array} \end{aligned}$$

Obviously, the four differences in every row and every column are pairwise distinct. Each element with the first coordinate being 1 occurs at most twice in \(\Delta _E(B_{(1,x,t)},B_{(1,u,t')})\). In the following, we discuss elements with the first coordinate being 0. Clearly, \(-1\in C_0^9\) when \(p\equiv 1\pmod {18}\) is a prime. Note that \(t,t'\in C_0^9\), \(x,u\in C_1^9\), \(x-1,u-1\in C_4^9\), \(x+1,u+1\in C_3^9\), one can see that:

  1. (1)

    An equality of the form \(x^\alpha t=-u^\beta t'\) where \(\alpha , \beta \in \{0,1\}\) is possible only for \(\alpha =\beta \).

  2. (2)

    An equality of the form \(x^\alpha t=x^\beta t-u^\gamma t'\) with \(\alpha ,\beta ,\gamma \in \{0,1\}\), \(\alpha \ne \beta \) is impossible; both \(x^\alpha t=x^2t-u^2t'\) and \(-u^\alpha t'=x^2t-u^2t'\) with \(\alpha \in \{0,1\}\) are impossible; \(x^2t-u^2t'=x^\alpha t-u^\beta t'\) with \(\alpha ,\beta \in \{0,1\}\) and \(\alpha \ne \beta \) is impossible.

  3. (3)

    Assume that \(t-t'=0\), then \(t=t'\). If \(xt-ut'=0\), we have \(xt=ut'\), then \(x=u\), that is a contradiction since \(x\ne u\). If \(x^2t-u^2t'=0\), we have \(x=-u\). It follows that \(x-1=-(u+1)\), that is a contradiction since \(x-1\in C_3^9\) and \(-(u+1)\in C_4^9\). Similarly, it is showed that \(\{t-t', xt-ut', x^2t-u^2t'\}\) contains at most one element which is equal to 0.

  4. (4)

    Assume that \(t-t'=xt-ut'\), then \((x-1)t=(u-1)t'\). If \(t-t'=x^2t-u^2t'\), we have \(x=u\), that is a contradiction. Following a similar argument, we can show that the equations \(t-ut'=xt-t'\) and \(t-ut'=x^2 t-u^2 t'\) can not established simultaneously.

The above four observations almost immediately imply that the list of external differences \(\Delta _E(B_{(1,x,t)},B_{(1,u,t')})\) cannot contain any element more than twice. Similarly, it is proved that \(\Delta _E(B_{(i,x,t)},B_{(i,u,t')})\), \(\Delta _E(B_{(i,x,t)},B_{(j,u,t')})\), \(\Delta _E(B_{(i,x,t)},B_{(v,t')})\) and \(\Delta _E(B_{(y,t)},B_{(v,t')})\) cannot contain any element more than twice, where \(i,j=1,2,3\) and \(i\ne j\). Then, \({\mathscr {B}}(x,y)\) and \({\mathscr {B}}(u,v)\) are 2-compatible from Lemma 2.

For any two elements \((u,v),(x,y)\in V\), a similar discussion shows that \(-{\mathscr {B}}(x,y)\) and \(-{\mathscr {B}}(u,v)\) are 2-compatible and that \({\mathscr {B}}(x,y)\) and \(-{\mathscr {B}}(u,v)\) are 2-compatible. So, we have the conclusion.

Similarly, we can show that the conclusion is true when other conditions are satisfied. \(\square \)

Lemma 6

If \(p\equiv 1\pmod {18}\) is a prime, then there are four pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs.

Proof

When \(p>1478889\), there are at least two elements \(x\in Z_p\) satisfying \(x\in C_{1}^9\), \(x-1\in C_4^9\), \(x+1\in C_3^9\) in Lemma 5 by Theorem 2. For each fixed element x, we can pick at least two elements y in such a way that \(y\in C_5^9\) and \(y^3-y\in C_8^9\). Therefore, there exist two elements (xy) of \(Z_p^2\) satisfying the condition (1) of Lemma 5. By Lemma 5, there are four pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs.

With the aid of computer, there are at least two elements (xy) of \(Z_p^2\) satisfying one of the conditions in Lemma 5 for \(p<1478889\), and \(p\not \in \{19,37,73, 127,163,181,199,\) 271, 307, 379,  \(397,523,919\}\). Those two elements (xy) of \(Z_p^2\) are listed in Table 2 of Appendix A for \(109\le p\le 991\). Thus, there exist four pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs from Lemma 5.

For \(p\in \{19,37,73\}\), the set \({\mathscr {B}}_{p}\) of base blocks of a balanced \((2p,2,\{3,4\},1)\)-DF over \(Z_{2p}\) is displayed below. For \(0\le i\le ord(\xi )-1\), \(\xi ^i{\mathscr {B}}_p\) is also a balanced \((2p,2,\{3,4\},1)\)-DF where ord\((\xi )\) stands for the order of \(\xi \) in the multiplier group of \(Z_{2p}\). We verify that \(\xi ^i{\mathscr {B}}_{p}\), \(i=0,1,2,3\), form four pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs for \((p,\xi , ord(\xi ))=(19,5,9)\), and \(\xi ^i{\mathscr {B}}_{p}\), \(i=0,1,\ldots ,8\), form nine pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs for \((p,\xi , ord(\xi ))=(37,7,9),(73,37,9)\).

$$\begin{aligned} {\mathscr {B}}_{19}&=\{\{0,1,3,8\}, \{0,4,13,24\}, \{0,6,21\}, \{0,10,22\}\}.\\ {\mathscr {B}}_{37}&=\{\{0,1,3,7\}, \{0,5,13,22\}, \{0,10,21,33\}, \{0,14,29\} \{0,16,34\}, \{0,19,39\}\}.\\&{\mathscr {B}}_{73}=\{\{0,26,34,56\}, \{0,122,140\}, \{0,135,139\}, \{0,9,10,75\}, \{0,91,93,141\},\{0,37,64,97\},\\&\quad \{0,38,52\}, \{0,115,134\}, \{0,16,111\}, \{0,3,39\}, \{0,13,72,92\}, \{0,25,40,83\},\\&\quad \{0,41,125\}, \{0,23,68,100\}, \{0,28,57,104\} \{0,17,61\}\}. \end{aligned}$$

For \(p\in \{127,163,181,199,271,307,397,523,919\}\), we identify \(Z_{2p}\) with \(Z_2\times Z_{p}\). The base blocks \({\mathscr {B}}_p\) are listed in Appendix B, \(\{(1,\theta ^i t)\cdot {\mathscr {B}}_p:t\in C_0^9/\{-1,1\}\}\) and \(\{(-1,-\theta ^i t)\cdot {\mathscr {B}}_p:t\in C_0^9/\{-1,1\}\}\), \(i=0,1\), form four pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs, where \(\theta \) is a primitive root of \(Z_p\). Thus, there exist four pairwise 2-compatible balanced \((2p,2,\{3,4\},1)\)-DFs from Lemma 5. \(\square \)

Lemma 7

Let \(p\equiv 11\pmod {12}\) be a prime. If there exist d elements x of \(Z_p\) satisfying \(x\in C_1^2\), \(x-1\in C_0^2\), \(x+1\in C_1^2\), \(x^2+x+1\in C_0^2\), then there are 2d pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs.

Proof

We can identify \(Z_{13p}\) with \(Z_{13}\times Z_p\) since gcd(p, 13) = 1. We first construct a balanced \((13,\{3,5\},2)\)-SDF as follows: \(B_1=\{0,0,1,4,6\}\), \(B_2=\{0,2,5\}\). Clearly, \(B_1\) and \(B_2\) are 2-compatible.

Denote by X the set of elements \(x\in C_1^2\) such that \(x-1\in C_0^2\), \(x+1\in C_1^2\) and \(x^2+x+1\in C_0^2\). If the conditions in this Lemma are satisfied, then \(X\ne \emptyset \). For \(x\in X\), let \({\mathscr {B}}(x)=\{B_{(i,x,t)}:i=1,2,t\in C_0^2\}\), where

$$\begin{aligned}&B_{(1,x,t)}=\{(0,0),(0,t),(1,xt),(4,x^2t),(6,x^3t)\},\\&B_{(2,x,t)}=\{(0,0),(2,xt),(5,x^3t)\}. \end{aligned}$$

We have \(\bigcup _{i=1}^2\Delta B_{(i,x,t)}=\bigcup _{j\in Z_{13}}\{j\}\times (\Delta _j\cdot t)\), where

$$\begin{aligned}&\Delta _0=\{-1,1\}, \Delta _1=\{x,x-1\}, \Delta _2=\{x^3-x^2,x\}, \Delta _3=\{x^2-x,x^3-x\},\\&\Delta _4=\{x^2, x^2-1\}, \Delta _5=\{x^3-x,x^3\}, \Delta _6=\{x^3,x^3-1\}, \Delta _j=-\Delta _{13-j}, 7\le j\le 12. \end{aligned}$$

If the conditions in this Lemma are satisfied, each \(\Delta _{j}\) forms a transversal of \(Z_p^*/C_0^2\). We have

$$\begin{aligned}&\Delta {\mathscr {B}}(x)=\bigcup \limits _{t\in C_0^2}\bigcup \limits _{i=1}^2\Delta B_{(i,x,t)}=\bigcup \limits _{t\in C_0^2}\bigcup \limits _{j\in Z_{13}}\{j\}\times (\Delta _j\cdot t)\\&\quad =\bigcup \limits _{j\in Z_{13}}\{j\}\times (Z_p\setminus \{0\})=Z_{13}\times (Z_p\setminus \{0\}), \end{aligned}$$

hence each \({\mathscr {B}}(x)\) and each \(-{\mathscr {B}}(x)\) is a balanced \((13p,13,\{3,5\},1)\)-DF. It is left to show that all \({\mathscr {B}}(x)\), \(-{\mathscr {B}}(x)\) are pairwise 2-compatible.

For any two elements \(x,y\in X\), since \(B_1\) and \(B_2\) are 2-compatible, \(B_{(i,x,t)}\in {\mathscr {B}}(x)\) and \(B_{(j,y,t')}\in {\mathscr {B}}(y)\) are 2-compatible for \(i,j\in \{1,2\}\) and \(i\ne j\). In the following, we will prove that \(B_{(i,x,t)}\in {\mathscr {B}}(x)\) and \(B_{(i,y,t')}\in {\mathscr {B}}(y)\) are 2-compatible for \(i=1,2\). Taking any two base blocks \(B_{(1,x,t)}\in {\mathscr {B}}(x)\) and \(B_{(1,y,t')}\in {\mathscr {B}}(y)\), we have \(\Delta _E(B_{(1,x,t)},B_{(1,y,t')})\) as follows.

$$\begin{aligned} \begin{array}{ccccccccc} (0,0)&{}(0,t)&{}(1,xt)&{}(4,x^2t)&{}(6,x^3t)\\ (0,-t')&{}(0,t-t')&{}(1,xt-t')&{}(4,x^2t-t')&{}(6,x^3t-t')\\ (-1,-yt')&{}(-1,t-yt')&{}(0,xt-yt')&{}(3,x^2t-yt')&{}(5,x^3t-yt')\\ (-4,-y^2t')&{}(-4,t-y^2t')&{}(-3,xt-y^2t')&{}(0,x^2t-y^2t')&{}(2,x^3t-y^2t')\\ (-6,-y^3t')&{}(-6,t-y^3t')&{}(-5,xt-y^3t')&{}(-2,x^2t-y^3t')&{}(0,x^3t-y^3t')\\ \end{array} \end{aligned}$$

Obviously, the five differences in every row and every column are pairwise distinct. Each element with the first coordinate being \(i\ne 0\) occurs at most twice in \(\Delta _E(B_{(1,x,t)},B_{(1,y,t')})\), we only need to discuss elements with the first coordinate being 0. Since \(p\equiv 11\pmod {12}\) is a prime, \(-1\in C_1^2\) and \(3\in C_0^2\). Note that \(t,t'\in C_0^2\), \(x,y\in C_1^2\), \(x-1,y-1\in C_0^2\), \(x+1,y+1\in C_1^2\), \(x^2+x+1,y^2+y+1\in C_0^2\), one can see that:

  1. (1)

    An equality of the form \(t=x^\alpha t-y^\alpha t'\) where \(\alpha \in \{1,2,3\}\) is impossible since \(x^\alpha t-t\in C_i^2\) and \(y^\alpha t'\in C_{i+1}^2\), \(i=0\) or 1.

  2. (2)

    An equality of the form \(-t'=x^\alpha t-y^\alpha t'\) where \(\alpha \in \{1,2,3\}\) is impossible since \(y^\alpha t'-t'\in C_i^2\) and \(x^\alpha t\in C_{i+1}^2\), \(i=0\) or 1.

  3. (3)

    Assume that \(t-t'=0\), then \(t=t'\). If \(xt-yt'=0\), then \(x=y\), that is a contradiction since \(x\ne y\). If \(x^2t-y^2t'=0\), we have \(x^2-y^2=0\), then \(y=-x\), that is a contradiction since \(-x\in C_0^2\), \(y\in C_1^2\). If \(x^3t-y^3t'=0\), we have \(x^3-y^3=0\), then \((x-y)^2=-3xy\), that is a contradiction since \((x-y)^2\in C_0^2\) and \(-3xy\in C_1^2\). For fixed \(\alpha \in \{0,1,2,3\}\), if \(x^\alpha t-y^\alpha t'=0\), we can similarly prove that \(x^\beta t-y^\beta t'\ne 0\) for \(\beta \in \{0,1,2,3\}\) and \(\beta \ne \alpha \).

  4. (4)

    Assume that \(t-t'=xt-yt'\), then \((x-1)t=(y-1)t'\). If \(t-t'=x^2t-y^2t'\), we have \(x=y\), that is a contradiction, hence the equations \(t-t'=xt-yt'\) and \(t-t'=x^2t-y^2t'\) can not hold simultaneously. If \(t-t'=x^3t-y^3t'\), we have \(x=-(y+1)\), that is a contradiction since \(x\in C_1^2\) and \(-(y+1)\in C_0^2\). So, the equations \(t-t'=xt-yt'\) and \(t-t'=x^3t-y^3t'\) can not hold simultaneously. Following a similar argument, one can show that the equations \(xt-yt'=x^2t-y^2 t'\) and \(xt-yt'=x^3 t-y^3 t'\) can not hold simultaneously.

The above four observations immediately imply that the list of external differences \(\Delta _E(B_{(1,x,t)},\) \(B_{(1,y,t')})\) cannot contain any element more than twice. Similarly, it is proved that \(\Delta _E(B_{(2,x,t)},B_{(2,y,t')})\) cannot contain any element more than twice. Then, \({\mathscr {B}}(x)\) and \({\mathscr {B}}(y)\) are 2-compatible from Lemma 2.

For any two elements \(x,y\in X\), a similar discussion shows that \(-{\mathscr {B}}(x)\) and \(-{\mathscr {B}}(y)\) are 2-compatible and that \({\mathscr {B}}(x)\) and \(-{\mathscr {B}}(y)\) are 2-compatible. So, we have the conclusion. \(\square \)

Lemma 8

If \(p\equiv 11\pmod {12}\) is a prime, then there are ten pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs.

Proof

When \(p>834\), there are at least five elements \(x\in Z_p\) satisfying \(x\in C_{1}^2\), \(x-1\in C_{0}^2\), \(x+1\in C_{1}^2\), \(x^2+x+1\in C_0^2\) from Corollary 1. By Lemma 7, there are ten pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs.

With the aid of computer, there are five elements \(x\in Z_p\) satisfying \(x\in C_{1}^2\), \(x-1\in C_{0}^2\), \(x+1\in C_{1}^2\), \(x^2+x+1\in C_0^2\) for \(23<p<834\) and \(p\not \in \{47,59,71\}\). Those five elements x of \(Z_p\) are listed in Table 3 of Appendix A. So, there are ten pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs from Lemma 7.

For \(p\in \{47,59,71\}\), there are three elements \(x\in Z_p\) satisfying \(x\in C_{1}^2\), \(x-1\in C_{0}^2\), \(x+1\in C_{1}^2\), \(x^2+x+1\in C_0^2\). Those three elements are listed as follow: \((p;x's)=(47;10,22,29),(59;23,30,54),(71;21,33,41)\). By Lemma 7, \({\mathscr {B}}(x)\) and \(-{\mathscr {B}}(x)\) form six pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs. Let \(\theta \) be a primitive root of \(Z_p\). It is easy to see that \((1,\theta )\cdot {\mathscr {B}}(x)\) and \(-(1,\theta )\cdot {\mathscr {B}}(x)\) form six pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs. We check that \({\mathscr {B}}(x)\), \(-{\mathscr {B}}(x)\), \((1,\theta )\cdot {\mathscr {B}}(x)\), \(-(1,\theta )\cdot {\mathscr {B}}(x)\) form twelve pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs.

For \(p=11\), the set \({\mathscr {B}}\) of base blocks of a balanced \((13p,13,\{3,5\},1)\)-DF is displayed below. We take \(\xi =14\), and ord\((\xi )=5\) stands for the order of \(\xi \) in the multiplier group of \(Z_{13p}\). For \(0\le i\le \)ord\((\xi )-1\), each \(\xi ^i{\mathscr {B}}\) and each \(-\xi ^i{\mathscr {B}}\) is also a balanced \((13p,13,\{3,5\},1)\)-DF. We check that these ten balanced \((13p,13,\{3,5\},1)\)-DFs are pairwise 2-compatible.

$$\begin{aligned}&{\mathscr {B}}=\{\{0,86,94\}, \{0,37,118\}, \{0,39,42\}, \{0,5,9,80,98\}, \{0,78,142\}, \{0,7,112,114,129\},\\&\quad \{0,28,41,60,87\}, \{0,10,58,92,127\}, \{0,6,30,53,73\}, \{0,12,52\} \}. \end{aligned}$$

For \(p=23\), we identify \(Z_{13p}\) with \(Z_{13}\times Z_{p}\). The base blocks \({\mathscr {A}}'s\) listed below and \(\{(1,t)\cdot {\mathscr {A}}:t\in C_0^2\}\) forms a balanced \((13p,13,\{3,5\},1)\)-DF, hence we verify that \(\{(1,\theta ^i t)\cdot {\mathscr {A}}:t\in C_0^2\}\) and \(\{(-1,-\theta ^i t)\cdot {\mathscr {A}}:t\in C_0^2\}\), \(i=0,1\), form sixteen pairwise 2-compatible balanced \((13p,13,\{3,5\},1)\)-DFs, where \(\theta \) is a primitive root of \(Z_p\).

$$\begin{aligned}&\{\{(0,0),(0,1),(1,14),(4,12),(6,7)\}, \{(0,0),(2,14),(5,7)\}\};\\&\{\{(0,0),(0,1),(1,19),(4,16),(6,5)\}, \{(0,0),(2,19),(5,5)\}\};\\&\{\{(0,0),(0,1),(7,7),(9,12),(12,14)\}, \{(0,0),(8,7),(11,14)\}\};\\&\{\{(0,0),(0,1),(7,5),(9,16),(12,19)\}, \{(0,0),(8,5),(11,19)\}\}. \end{aligned}$$

\(\square \)

Lemma 9

Let \(p\equiv 1\pmod {26}\) be a prime. If \(\{x_1,x_2,x_3,x_4,x_5,x_1-1,x_2-1,x_3-1,x_2-x_1,x_3-x_1,x_3-x_2,x_5-x_4\}\) are in different cosets among \(\{C_1^{13},C_2^{13},\ldots ,C_{12}^{13}\}\), then there are two pairwise 2-compatible balanced \((p,\{3,5\},1)\)-DFs.

Proof

Let \({\mathscr {B}}=\{B_{(i,t)}:i=1,2,t\in C_0^{13}/\{-1,1\}\}\), where \(B_{(1,t)}=\{0,t,x_1t,x_2t,x_3t\}\), \(B_{(2,t)}=\{0,x_4t,x_5t\}\). We have \(\Delta B_{(1,t)}\cup \Delta B_{(2,t)}=\{-1,1\}\cdot \Delta \cdot t\), where \(\Delta =\{1,x_1,x_2,x_3,\) \(x_4,x_5,x_1-1,x_2-1,x_3-1,x_2-x_1,x_3-x_1,x_3-x_2,x_5-x_4\}\). If the condition in this Lemma is satisfied, then \(\Delta \) forms a transversal of \(Z_p^*/C_0^{13}\). We have

$$\begin{aligned} \Delta {\mathscr {B}}=\bigcup \limits _{t\in C_0^{13}/\{-1,1\}}(\Delta B_{(1,t)}\cup \Delta B_{(2,t)})=\bigcup \limits _{t\in C_0^{13}/\{-1,1\}} (\{-1,1\}\cdot \Delta \cdot t)=Z_p\setminus \{0\}, \end{aligned}$$

hence \({\mathscr {B}}\) is a balanced \((p,\{3,5\},1)\)-DF. Clearly, \(-{\mathscr {B}}\) is also a balanced \((p,\{3,5\},1)\)-DF. Therefore, \({\mathscr {B}}\) and \(-{\mathscr {B}}\) are 2-compatible from Lemma 3. \(\square \)

Lemma 10

If \(p\equiv 1\pmod {26}\) is a prime, then there exist two pairwise 2-compatible balanced \((p,\{3,5\},1)\)-DFs.

Proof

When \(p>6.046652751\times 10^9\), by Theorem 2 there exists a 5-tuple \((x_1,\ldots ,x_5)\) of \(Z_p\) satisfying the condition of Lemma 9, hence there exist two pairwise 2-compatible balanced \((p,\{3,5\},1)\)-DFs by Lemma 9.

With the aid of computer, there exist a 5-tuple \((x_1,\ldots ,x_5)\) of \(Z_p\) satisfying the condition of Lemma 9 for any prime \(p\equiv 1\pmod {26}\) with \(53\le p<6.046652751\times 10^9\). These 5-tuple \((x_1,\ldots ,x_5)'\)s are listed only for the first 18 values of p in Table 4 of Appendix A. \(\square \)

4 Recursive constructions

In this section, we are mainly trying to establish recursive constructions for (NMW, 1,  Q; 2)-CDP set systems by using semicyclic group divisible designs (SCGDDs).

4.1 Preliminaries

For any positive integer r and any subset \(B\subseteq Z_{nr}\), we define the projection on \(Z_n\) of B to be the subset \(\overline{B}\subseteq Z_n\) obtained by taking each element of B modulo n. It must be an multi-subset of \(Z_n\). It is clear that \(\overline{B}=B\) when \(r=1\). For a family \({\mathscr {F}}\) of subsets of \(Z_{nr}\), we define the projection on \(Z_n\) of \({\mathscr {F}}\) as the collection of the all projections of its subsets.

As we know, we allow l pairwise 2-compatible DPs to be defined on the same cyclic group. In order to distinguish, let \(n_0,n_1,\ldots ,n_{l-1}\) be l pairwise distinct positive integers. Let \({\mathscr {B}}=\{{\mathscr {B}}_0,{\mathscr {B}}_1,\ldots ,{\mathscr {B}}_{l-1}\}\) be l pairwise 2-compatible DPs in which \({\mathscr {B}}_i\) is an \((n_i,W,1,Q)\)-DP of size \(m_i\), \(0\le i\le l-1\), then we say that \({\mathscr {B}}\) is an (NMW, 1, Q; 2)-CDP set system (or briefly a CDP set system if there is no need to list the parameters). If \({\mathscr {B}}_i\) is a balanced \((n_i,W,1)\)-DP for each i, then \({\mathscr {B}}\) is said to be balanced. When each \({\mathscr {B}}_i\) is an \((n_i,g_i,W,1,Q)\)-DF, we make use of the notation CDF instead of CDP and denoted by \(N=\{(n_0,g_0),(n_1,g_1),\ldots ,(n_{l-1},g_{l-1})\}\). The size of \({\mathscr {B}}\) is the sum \(\sum _{i=0}^{l-1}m_i\). In the following, we will state some known recursive constructions via cyclic difference matrices.

A (uh, 1) cyclic difference matrix ((uh, 1)-CDM in short) is an \(h\times u\) matrix \(D=(d_{ij})\ (0\le i\le h-1, 0\le j\le u-1)\) whose each entry is an integer of \(Z_u\) such that for any two distinct rows \(i_1\) and \(i_2\), the list of \(d_{i_1j}-d_{i_2j} \ (j =0, 1, \ldots u-1)\) contains each integer of \(Z_u\) exactly once. Difference matrices have been studied extensively, see [14] and the references therein. Here is one typical example.

Lemma 11

[14] Let u and h be integers with \(u\ge h\ge 3\). If u is odd and the least prime factor of u is not less than h, then there exists a (uh, 1)-CDM. Especially, there exists a (u, 4, 1)-CDM for any positive integer u with gcd\((u,6) = 1\).

Construction 4

[35] Let \(r_{1},r_2,\ldots ,r_{l-1}\) be \(l-1\) distinct positive integers such that an \((r_i,\eta , 1)\)-CDM exists for \(i=1,2\ldots ,l-1\). Suppose that there exist l pairwise 2-compatible (ngW, 1, Q)-DFs.

(1):

Then, there exists an (NMW, 1, Q; 2)-CDF set system, where \(N=\{(n,g),\) \((nr_1, gr_1),\) \(\ldots ,(nr_{l-1},gr_{l-1})\}\) and \(M=\left[ t,tr_1,\ldots ,tr_{l-1}\right] \).

(2):

Suppose further that there is a \((\{gr_1, gr_2,\ldots , gr_{l-1}\}, [m_1,m_2,\ldots ,m_{l-1}],W,1,\) Q; 2)-CDP set system and each base block contains at most two elements which are congruent modulo g, then there is an \((N',M',W,1,Q;2)\)-CDP set system of size \(t+\sum \limits _{i=1}^{l-1}\left( tr_i+m_i\right) \), where \(N'=\{n,nr_1,\ldots ,nr_{l-1}\}\) and \(M'=\left[ t, tr_1+m_1, \ldots ,tr_{l-1}+m_{l-1}\right] .\)

Corollary 2

[35] Suppose that there are l pairwise 2-compatible (ngW, 1, Q)-DFs. Let \(r_1,r_2,\ldots ,r_s\) be s positive integers for which an \((r_i,\eta , 1)\)-CDM exists and there are l pairwise 2-compatible \((gr_i,g,W, 1,Q)\)-DFs for \(1\le i\le s\). Then, there are l pairwise 2-compatible \((nr_1\cdots r_s,g,W, 1,Q)\)-DFs.

Construction 5

[35] Let \(r_1,r_2,\ldots ,r_{l-1},g\) be positive integers such that gcd\((r_1r_2\) \(\cdots r_{l-1},g)=1\), there are l pairwise 2-compatible (ngW, 1, Q)-DFs and \(l-i\) pairwise 2-compatible \((nr_i,g,W,1,Q)\)-DFs for \(1\le i\le l-1\) and such that an \((r_i,\eta ,1)\)-CDM exists for \(1\le i\le l-1\). If each base block of each \((gr_i, g,W, 1,Q)\)-DF, \(1\le i\le l-1\), does not contain three elements which are congruent modulo g, then there is an (NMW, 1, Q; 2)-CDF set system, where

$$\begin{aligned} N =\{(n,g), (nr_1, g), (nr_1r_2, g),\ldots , (nr_1r_2\cdots r_{l-1}, g)\} \end{aligned}$$

and

$$\begin{aligned} M=\left[ \frac{b(n-g)}{\sum _{j=1}^ka_jw_j(w_j-1)},\frac{b(nr_1-g)}{\sum _{j=1}^ka_jw_j(w_j-1)},\ldots ,\frac{b(nr_1\ldots r_{l-1}-g)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right] . \end{aligned}$$

4.2 Recursive constructions via SCGDDs

A group divisible design K-GDD is a triple \(({\mathscr {V}},{\mathscr {G}},{\mathscr {B}})\) satisfying the following properties:

  1. (1)

    V is a v-set of points;

  2. (2)

    \({\mathscr {G}}\) is a partition of V into subsets called groups;

  3. (3)

    \({\mathscr {B}}\) is a collection of k-subsets of V called blocks, \(k\in K\), such that a group and a block contain at most one common point;

  4. (4)

    every pair of points from distinct groups occurs in exactly one block.

The group type of the GDD is the list \((|G| : G\in {\mathscr {G}})\). The usual exponential notation will be used to describe types. Thus, a GDD of type \(u_1^{h_1}u_2^{h_2}\ldots u_s^{h_s}\) is one in which there are \(h_i\) groups of size \(u_i\) for each i.

A semi-cyclic K-GDD was introduced by Yin for constructing optimal difference packings [33]. Given positive integers h and u, define \(I_h=\{0,1,\ldots ,h-1\}\) and \(V=I_h\times Z_u\). The elements of V are denoted by (ia), where \(i\in I_h\) and \(a\in Z_u\). A K-GDD of type \(u^h\) on \(I_h\times Z_u\) with the group set \({\mathscr {G}}=\{\{i\}\times Z_u : i\in I_h\}\) and the block set \({\mathscr {B}}\) is said to be semi-cyclic, denoted by K-SCGDD of type \(u^h\), if for any \(B\in {\mathscr {B}}\), adding \(1\in Z_u\) successively to the second coordinate of each point of \(B\in {\mathscr {B}}\) modulo u always gives u distinct blocks of B. A (WQ)-SCGDD of type \(u^h\) is a W-SCGDD of type \(u^h\) with the property that the fraction of blocks of size \(w_j\) is \(q_j\), \(1\le j\le k\). A balanced W-SCGDD of type \(u^h\) is simply a (WQ)-SCGDD of type \(u^h\) with \(Q=(\frac{1}{k},\cdots , \frac{1}{k})\). Assume that \({\mathscr {B}}^*\) is the family of all base blocks of a (WQ)-SCGDD of type \(u^h\). Define the multiset

$$\begin{aligned} \Delta _{ij}{\mathscr {B}}^*=[b-a\pmod u:(i,a),(j,b)\in B,(i,a)\ne (j,b),B\in {\mathscr {B}}^*]. \end{aligned}$$

When \(i=j\), \(\Delta _{ii}{\mathscr {B}}^*\) is the multiset of all pure (ii)-differences of \({\mathscr {B}}^*\). When \(i\ne j\), \(\Delta _{ij}{\mathscr {B}}^*\) is the multiset of all mixed (ij)-differences of \({\mathscr {B}}^*\). For any \((i, j)\in I_h\times I_h\), it is easy to verify that \(\Delta _{ij}{\mathscr {B}}^*=Z_u\) if \(i\ne j\) or \(\emptyset \) if \(i=j\). When \(W=\{w\}\) and \(Q=(1)\), this SCGDD is simply denoted by w-SCGDD of type \(u^h\), such a SCGDD is called a \(GD^*(w,1,u;hu)\) in [32]. For the existence of a w-SCGDD of type \(u^h\), the interested reader can refer to [28, 29] and the references therein. There are some examples of balanced W-SCGDDs of type \(u^h\) exhibited in the following lemma, which are very useful.

Lemma 12

There exists a balanced \(\{3,4\}\)-SCGDD of type \(u^4\) for \(u=6,12,18,24\).

Proof

The desired base blocks of a balanced \(\{3,4\}\)-SCGDD of type \(u^4\) are displayed in Appendix C. \(\square \)

Proposition 1

Let \(Q=(\frac{a_1}{b},\ldots ,\frac{a_k}{b})\) be normalized. Suppose that there exist an (nh, 1)-DP of size t and a (WQ)-SCGDD of type \(u^{h}\), then there exists an (nuW, 1, Q)-DP of size \(\frac{bh(h-1)ut}{\sum _{i=1}^ka_iw_i(w_i-1)}\). If the difference leave of the given DP is L, then the difference leave of the derived DP is

$$\begin{aligned} L'=\bigcup \limits _{i\in L}\{i+nj\pmod {nu}:0\le j\le u-1\}. \end{aligned}$$

Moreover, if the given DP is an (ngh, 1)-DF and there exists an optimal (guW, 1, Q)-DP, then there exist an optimal (nuW, 1, Q)-DP and an (nuguW, 1, Q)-DF.

Proof

Let \({\mathscr {A}}\) and \({\mathscr {B}}\) be, respectively, the family of all base blocks of the given (nh, 1)-DP and (WQ)-SCGDD of type \(u^{h}\) over \(I_{h}\times Z_u\) with the group set \(\{\{x\}\times Z_u:x\in I_{h}\}\). For any \(A=\{x_0, x_1,\ldots , x_{h-1}\}\in {\mathscr {A}}\) and \(B=\{(l_0, y_0),(l_1, y_1),\ldots ,\) \((l_{w_i-1}, y_{w_i-1})\}\in {\mathscr {B}}\), we construct

$$\begin{aligned} F_{A}(B)=\{x_{l_0}+ny_{0},x_{l_1}+ny_{1},\ldots ,x_{l_{w_i-1}}+ny_{w_i-1}\}. \end{aligned}$$

Let \({\mathscr {F}}_{A}=\bigcup _{B\in {\mathscr {B}}}F_{A}(B)\). It is readily calculated that

$$\begin{aligned} \Delta {\mathscr {F}}_{A}&=\{x_{l_b}-x_{l_a}+n(y_b-y_a):(l_a,y_a),(l_b,y_b)\in B, B\in {\mathscr {B}}, 0\le a,b\le w_i-1, a\ne b\}\\&=\{x_{l_b}-x_{l_a}+n\beta :l_a,l_b\in I_{h},l_a\ne l_b, \beta \in \Delta _{l_al_b}{\mathscr {B}}\}\\&=\{x_{l_b}-x_{l_a}+n\beta :l_a,l_b\in I_{h},l_a\ne l_b, \beta \in Z_u\}\\&=\{\alpha +n\beta :\alpha \in \Delta A, \beta \in Z_u\}. \end{aligned}$$

Let \({\mathscr {F}}=\bigcup _{A\in {\mathscr {A}}}{\mathscr {F}}_{A}\), then we have

$$\begin{aligned} \Delta {\mathscr {F}}&=\{\alpha +n\beta :\alpha \in \Delta {\mathscr {A}}, \beta \in Z_u\}\\&=\{\alpha +n\beta :\alpha \in Z_n\setminus L, \beta \in Z_u\}. \end{aligned}$$

It is readily known that each element in \( Z_{nu}\setminus L'\) occurs in \(\Delta {\mathscr {F}}\) exactly once, while any element in \(L'\) is not covered at all. Hence, \({\mathscr {F}}\) is the required (nuW, 1, Q)-DP of size \(\frac{bh(h-1)ut}{\sum _{i=1}^ka_iw_i(w_i-1)}\). In the following, we will prove the second part.

By assumption, there exists an (ngh, 1)-DF, we have an (nuguW, 1, Q)-DF \({\mathscr {F}}\) according to the above constructions. Let \({\mathscr {F}}'\) be an optimal (guW, 1, Q)-DP, then \({\mathscr {F}}\bigcup (\frac{n}{g}\cdot {\mathscr {F}}')\) forms an optimal (nuW, 1, Q)-DP. \(\square \)

Applying Proposition 1 with \(n=56\), \(g=8\), \(W=\{3,4\}\), \(Q=\{\frac{2}{3},\frac{1}{3}\}\), \(h=4\) and \(u=4\), we have the following example.

Example 1

Consider a (56, 8, 4, 1)-DF, \({\mathscr {A}}=\{A_1,A_2,A_3,A_4 \}\) where \(A_1=\{0,1,3,9\}\), \(A_2=\{0,4,15,38\}\), \(A_3=\{0,5,24,36\}\), \(A_4=\{0,10,26,39\}\). The difference leave of \({\mathscr {A}}\) is the unique additive subgroup \(\{0,7,14,21,28,35,42,49\}\) of order 8 in \(Z_{56}\), denoted by L. The base blocks of a \((\{3,4\},(\frac{2}{3},\frac{1}{3}))\)-SCGDD of type \(4^4\) are displayed below:

$$\begin{aligned}&\{( 0,0),(1,0),(2,0),(3,0)\}, \{(0,0),(1,1),(2,2),(3,3)\}, \{(0,0),( 1,2),(2,1)\},\\&\{(0,0),(1,3),(3,2)\}, \{(0,0),(2,3),(3,1)\}, \{(1,0),(2,2),(3,1)\}. \end{aligned}$$

Applying Proposition 1, we obtain a \((224,32,\{3,4\},1,(\frac{2}{3},\frac{1}{3}))\)-DF denoted by \({\mathscr {F}}\) from the above \({\mathscr {A}}\). Here, \({\mathscr {F}}\) consists of the following 24 blocks over \(Z_{224}\):

$$\begin{aligned}&\left\{ \begin{array}{lllll} F_{11}=\{0+0\cdot 56,1+0\cdot 56,3+0\cdot 56,9+0\cdot 56\}=\{0,1,3,9\},\\ F_{12}=\{0+0\cdot 56,1+1\cdot 56,3+2\cdot 56,9+3\cdot 56\}=\{0,57,115,177\},\\ F_{13}=\{0+0\cdot 56,1+2\cdot 56,3+1\cdot 56\}=\{0,113,59\},\\ F_{14}=\{0+0\cdot 56,1+3\cdot 56,9+2\cdot 56\}=\{0,169,121\},\\ F_{15}=\{0+0\cdot 56,3+3\cdot 56,9+1\cdot 56\}=\{0,171,65\},\\ F_{16}=\{1+0\cdot 56,3+2\cdot 56,9+1\cdot 56\}=\{1,115,65\}; \end{array} \right. \end{aligned}$$
(3)
$$\begin{aligned}&\left\{ \begin{array}{lllll} F_{21}=\{0+0\cdot 56,4+0\cdot 56,15+0\cdot 56,38+0\cdot 56\}=\{0,4,15,38\},\\ F_{22}=\{0+0\cdot 56,4+1\cdot 56,15+2\cdot 56,38+3\cdot 56\}=\{0,60,127,206\},\\ F_{23}=\{0+0\cdot 56,4+2\cdot 56,15+1\cdot 56\}=\{0,116,71\},\\ F_{24}=\{0+0\cdot 56,4+3\cdot 56,38+2\cdot 56\}=\{0,172,150\},\\ F_{25}=\{0+0\cdot 56,15+3\cdot 56,38+1\cdot 56\}=\{0,183,94\},\\ F_{26}=\{4+0\cdot 56,15+2\cdot 56,38+1\cdot 56\}=\{4,127,94\}; \end{array} \right. \end{aligned}$$
(4)
$$\begin{aligned}&\left\{ \begin{array}{lllll} F_{31}=\{0+0\cdot 56,5+0\cdot 56,24+0\cdot 56,36+0\cdot 56\}=\{0,5,24,36\},\\ F_{32}=\{0+0\cdot 56,5+1\cdot 56,24+2\cdot 56,36+3\cdot 56\}=\{0,61,136,204\},\\ F_{33}=\{0+0\cdot 56,5+2\cdot 56,24+1\cdot 56\}=\{0,117,110\},\\ F_{34}=\{0+0\cdot 56,5+3\cdot 56,36+2\cdot 56\}=\{0,173,148\},\\ F_{35}=\{0+0\cdot 56,24+3\cdot 56,36+1\cdot 56\}=\{0,192,92\},\\ F_{36}=\{5+0\cdot 56,24+2\cdot 56,36+1\cdot 56\}=\{5,136,92\}; \end{array} \right. \end{aligned}$$
(5)
$$\begin{aligned}&\left\{ \begin{array}{lllll} F_{41}=\{0+0\cdot 56,10+0\cdot 56,26+0\cdot 56,39+0\cdot 56\}=\{0,10,26,39\},\\ F_{42}=\{0+0\cdot 56,10+1\cdot 56,26+2\cdot 56,39+3\cdot 56\}=\{0,66,138,207\},\\ F_{43}=\{0+0\cdot 56,10+2\cdot 56,26+1\cdot 56\}=\{0,122,82\},\\ F_{44}=\{0+0\cdot 56,10+3\cdot 56,39+2\cdot 56\}=\{0,178,151\},\\ F_{45}=\{0+0\cdot 56,26+3\cdot 56,39+1\cdot 56\}=\{0,194,95\},\\ F_{46}=\{10+0\cdot 56,26+2\cdot 56,39+1\cdot 56\}=\{10,138,95\}. \end{array} \right. \end{aligned}$$
(6)

The difference leave of \({\mathscr {F}}\) is

$$\begin{aligned} L'=\{i+56j\pmod {224}:i\in L,j\in Z_4\}=7\cdot Z_{224} \end{aligned}$$

which is the unique additive subgroup of order 32 in \(Z_{224}\) and isomorphic to \(Z_{32}\). For an optimal \((224, \{3,4\},1,(\frac{2}{3},\frac{1}{3}))\)-DP, we construct an optimal \((32, \{3,4\}, 1, (\frac{2}{3},\frac{1}{3}))\)-DP over \(L'\) which contains three base blocks \(7\cdot \{0,1,3,7\}\), \(7\cdot \{0,5,13\}\), \(7\cdot \{0,9,20\}\). These base blocks together with the above 24 base blocks give us an optimal \((224, \{3,4\},1,\) \((\frac{2}{3},\frac{1}{3}))\)-DP.

\(\square \)

In Example 1, let \(A_{ij}\) be the projection on \(Z_{n}\) \((n=56)\) of \(F_{ij}\), \(i\in \{1,2,3,4\}\) and \(j\in \{1,\ldots ,6\}\). The projections on \(Z_n\) of the resultant six base blocks in (3) are \(A_{11}=\{0,1,3,9\}\), \(A_{12}=\{0,1,3,9\}\), \(A_{13}=\{0,1,3\}\), \(A_{14}=\{0,1,9\}\), \(A_{15}=\{0,3,9\}\), \(A_{16}=\{1,3,9\}\), hence the union of these 6 sets is \(\bigcup _{j=1}^6A_{1j}=\{0,1,3,9\}=A_1\). While the union of the projections on \(Z_n\) of the six base blocks in (4) is \(\bigcup _{j=1}^6A_{2j}=\{0,4,15,38\}=A_2\). Similarly, \(\bigcup _{j=1}^6A_{3j}=\{0,5,24,36\}=A_3\), \(\bigcup _{i=1}^6A_{4j}=\{0,10,26,39\}\) \(=A_4\). It is easy to see that \(\{\bigcup _{j=1}^6A_{ij}:i=1,2,3,4\}=\{A_i:1\le i\le 4\}={\mathscr {A}}\). This is the case. There are \(\frac{bh(h-1)u}{\sum _{i=1}^ka_iw_i(w_i-1)}\) blocks of the resultant (nuW, 1, Q)-DP \({\mathscr {F}}\) in Proposition 1 such that the union of the projection on \(Z_n\) of these blocks is equal to \(A\in {\mathscr {A}}\) according to the construction given in Proposition 1. By using this method, we obtain t unions from the projections on \(Z_n\) of the resultant (nuW, 1, Q)-DP \({\mathscr {F}}\) since \(|{\mathscr {F}}|=\frac{bh(h-1)ut}{\sum _{i=1}^ka_iw_i(w_i-1)}\). It is obvious that the derived family of t unions is identical to the initial (nh, 1)-DP \({\mathscr {A}}\). Then, the two DPs \({\mathscr {A}}\) and \({\mathscr {F}}\) are not 2-compatible. For convenience, these t unions are said to be the family of unions from the projections on \(Z_n\) of \({\mathscr {F}}\). In order to extend Proposition 1 to construct CDP set systems, we require the following result.

Lemma 13

Let u and \(u'\) be any positive integers. Suppose that \({\mathscr {F}}\) and \({\mathscr {F}}'\) are an (nuW, 1, Q)-DP and an \((nu',W,1,Q)\)-DP whose the families of unions from the projections on \(Z_n\) of \({\mathscr {F}}\) and \({\mathscr {F}}'\) are denoted by \({\mathscr {A}}\) and \({\mathscr {A}}'\), respectively. If \({\mathscr {A}}\) and \({\mathscr {A}}'\) form a pair of 2-compatible (nh, 1)-DPs, then \({\mathscr {F}}\) and \({\mathscr {F}}'\) are also 2-compatible.

Proof

Assume that \({\mathscr {F}}\) and \({\mathscr {F}}'\) are not 2-compatible. By definition, there must be base blocks \(F\in {\mathscr {F}}\) and \(F'\in {\mathscr {F}}'\) such that \(\Theta _{(F,F')}(\theta )\ge 3\) or \(\Theta _{(F',F)}(\theta ')\ge 3\) for certain elements \(\theta \in Z_{nu}\) and \(\theta '\in Z_{nu'}\). Denote by B and \(B'\) the projection on \(Z_n\) of F and \(F'\), respectively. Then, there exist \(A\in {\mathscr {A}}\) and \(A'\in {\mathscr {A}}'\) such that \(B\subseteq A\) and \(B'\subseteq A'\). Write \(\vartheta ,\vartheta '\in Z_n\) such that \(\vartheta \equiv \theta \pmod n\) and \(\vartheta '\equiv \theta '\pmod n\). Further, we have \(\Theta _{(A,A')}(\vartheta )\ge 3\) or \(\Theta _{(A',A)}(\vartheta ')\ge 3\) from the above two inequalities. It follows that A and \(A'\) would not be 2-compatible, that is a contradiction. Hence, \({\mathscr {F}}\) and \({\mathscr {F}}'\) are 2-compatible. \(\square \)

Construction 6

Let n, g and h be the given positive integers with \(h\ge 3\), \(n=h(h-1)t+g\) and \(g\le h(h-1)\). Let \(u_{1},u_{2},\ldots ,u_{l}\) be l distinct positive integers such that a (WQ)-SCGDD of type \(u_j^{h}\) exists, where \(Q=(\frac{a_1}{b},\ldots ,\frac{a_k}{b})\) is normalized and \(j=1,2,\ldots ,l\). Suppose that there exist l pairwise 2-compatible (ngh, 1)-DFs.

(1):

Then there exists an (NMW, 1, Q; 2)-CDF set system, where \(N=\{(nu_1, gu_1),\) \((nu_2, gu_2),\ldots ,(nu_{l},gu_{l})\}\) and

$$\begin{aligned} M=\left[ \frac{bh(h-1)u_1t}{\sum _{i=1}^ka_iw_i(w_i-1)},\frac{bh(h-1)u_2t}{\sum _{i=1}^ka_iw_i(w_i-1)},\ldots ,\frac{bh(h-1)u_lt}{\sum _{i=1}^ka_iw_i(w_i-1)}\right] . \end{aligned}$$
(2):

Suppose further that there is a \((\{gu_1, gu_2,\ldots , gu_{l}\}, [m_1,m_2,\ldots ,m_{l}],W,1,Q; 2)\)-CDP set system and each base block contains at most two elements which are congruent modulo g. Then, there exists an \((N',M',W,1,Q;2)\)-CDP set system of size \(\sum \limits _{j=1}^{l}(m_j+\) \(\frac{bh(h-1)u_jt}{\sum _{i=1}^ka_iw_i(w_i-1)}\), where \(N'=\{nu_1,nu_2,\ldots ,nu_{l}\}\) and

$$\begin{aligned} M'=\left[ m_1+\frac{bh(h-1)u_1t}{\sum _{i=1}^ka_iw_i(w_i-1)},m_2+\frac{bh(h-1)u_2t}{\sum _{i=1}^ka_iw_i(w_i-1)},\ldots ,m_l+\frac{bh(h-1)u_lt}{\sum _{i=1}^ka_iw_i(w_i-1)}\right] . \end{aligned}$$

Proof

Let \({\mathscr {A}}_j\), \(1\le j\le l\), be the given l pairwise 2-compatible (ngh, 1)-DFs. Write \(H=\frac{n}{g}Z_{n}\) for the unique additive subgroup of order g in \(Z_n\). Due to the uniqueness of additive subgroups in \(Z_{n}\) for given order g, the g-regularity implies that the l difference families \({\mathscr {A}}_1\), \({\mathscr {A}}_2\),..., \({\mathscr {A}}_{l}\) share the subgroup H as their difference leave. They are of optimal size t since \(g\le h(h-1)\). For each j with \(1\le j\le l\), we apply Proposition 1 with \({\mathscr {A}}_j\) and a (WQ)-SCGDD of type \(u_j^{h}\) to get an \((nu_j,gu_j,W,1,Q)\)-DF \({\mathscr {F}}_j\) of size \(\frac{bh(h-1)u_jt}{\sum _{i=1}^ka_iw_i(w_i-1)}\). Its difference leave is the unique addition subgroup \(H_j=\frac{n}{g}Z_{nu_j}\) of \(Z_{nu_j}\). Further, as observed following Example 1, the family of unions from the projection on \(Z_n\) of \({\mathscr {F}}_j\) is \({\mathscr {A}}_j\). From Lemma 13 and the hypothesis, we see that \({\mathscr {F}}=\{{\mathscr {F}}_1,{\mathscr {F}}_2,\ldots ,{\mathscr {F}}_{l}\}\) is an (NMW, 1, Q; 2)-CDF set system. The first conclusion then follows. From Construction 4, we have the second conclusion. \(\square \)

Construction 6 tell us that, by using SCGDDs, a CDP set system with multiple block sizes can be obtained from pairwise 2-compatible relative difference families with constant size. We illustrate the idea of Construction 6 in the following example.

Example 2

Let \({\mathscr {A}}_0=\{\{0,1,3,11,20\}\}\) and \({\mathscr {A}}_1=\{\{0,4,13,21,23\}\}\), then \({\mathscr {A}}_0\), \({\mathscr {A}}_1\) form a pair of 2-compatible (24, 4, 5, 1)-DFs. These two relative difference families share the unique additive subgroup \(H=6\cdot Z_{24}\) in \(Z_{24}\) as their difference leave. The base blocks of a \((\{3,4\},(\frac{2}{3},\frac{1}{3}))\)-SCGDD of type \(u^5\) for \(u=6,12\) are displayed in Appendix D. Now applying Proposition 1, as presented in Example 1, we have a (144, 24,  \(\{3,4\},1, (\frac{2}{3},\frac{1}{3}))\)-DF \({\mathscr {F}}_0\) and a (288, 48,  \(\{3,4\},1, (\frac{2}{3},\frac{1}{3}))\)-DF \({\mathscr {F}}_1\), where \({\mathscr {F}}_0\) and \({\mathscr {F}}_1\) are displayed below. We check that \(\{{\mathscr {F}}_0,{\mathscr {F}}_1\}\) forms a \((\{(144,24), (288,48)\}, \{15,30\}, \{3,4\},\) \(1, (\frac{2}{3},\frac{1}{3});\) 2)-CDF set system. Let \({\mathscr {B}}_1=\){{0,1,4,6}, {0,8,17},{0,10,21}}, then \({\mathscr {B}}_1\) forms a \((48,\{3,4\},\) \(1,(\frac{2}{3},\frac{1}{3}))\)-DP of size 3 and each base block contains at most two elements which are congruent modulo 4, we check that \(\{{\mathscr {F}}_0,{\mathscr {F}}_1\bigcup (6\cdot {\mathscr {B}}_1)\}\) forms a \((\{(144,288\}, \{15,33\}, \{3,4\},1,\) \( (\frac{2}{3},\frac{1}{3}); 2)\)-CDP set system of size 48.

$$\begin{aligned}&{\mathscr {F}}_0: \{96,25,75,83\}, \{72,49,75,116\}, \{72,99,35,44\}, \{0,1,35,92\}, \{1,99,11,116\}, \{24,35,20\},\\&\quad \{73,11,92\}, \{1,123,107\}, \{0,97,83\}, \{0,99,59\}, \{1,75,44\}, \{120,1,140\},\{24,99,82\},\\&\quad \{72,121,123\}, \{75,107,140\}.\\&{\mathscr {F}}_1: \{0,4,61,237\}, \{4,13,69,239\}, \{13,21,71,216\},\{21,23,48,220\}, \{23,0,52,229\},\\&\quad \{0,28,181,285\}, \{4,37,189,287\}, \{13,45,191,264\}, \{21,47,168,277\}, \{0,196,37\},\\&\quad \{4,205,45\}, \{13,213,47\}, \{21,215,24\}, \{23,192,28\}, \{0,220,13\}, \{4,229,21\}, \{13,237,23\},\\&\quad \{21,239,0\}, \{23,216,4\}, \{0,124,109\}, \{4,133,117\}, \{13,141,119\}, \{21,143,96\},\\&\quad \{23,120,100\}, \{0,157,117\}, \{4,165,119\}, \{13,167,96\}, \{21,144,100\}, \{23,148,109\}. \end{aligned}$$

\(\square \)

5 Applications to multilength variable-weight OOCs

Optical code division multiple access (OCDMA) has received much attention as an attractive way of satisfying the need of more reliable and faster communication systems and sharing the huge optical bandwidth among users. A key towards an effective OCDMA system is the choice of optical codes with good correlation properties. As a result, a special class of unipolar (0,1) codes called optical orthogonal codes (OOCs) has been used for OCDMA [15, 25, 26]. When these (constant-weight) OOCs are applied for multimedia applications, their correlation properties can be change. Therefore, Yang introduced multimedia OCDMA systems employing (constant-length) variable-weight OOCs to support multiple quality of service (QoS) requirements [31]. An (nW, 1, Q) variable-weight optical orthogonal code \({\mathscr {C}}\) ((nW, 1, Q)-VWOOC in short) is a family of binary n-tuples such that the following three properties hold:

  1. (1)

    Weight Distribution: Each n-tuple of \({\mathscr {C}}\) has a Hamming weight contained in W; moreover, there are precisely \(q_j|{\mathscr {C}}|\) codewords of Hamming weight \(w_j\), \(j\in \{1,2,\ldots ,k\}\).

  2. (2)

    Auto-correlation Constraint: For any \(\mathbf{x}=(x_0, x_1,\ldots ,\) \( x_{n-1})\in {\mathscr {C}}\) with Hamming weight \(w_j\in W\) and any integer \(\theta , \ 0<\theta <n\),

    $$\begin{aligned} \sum \limits _{r=0}^{n-1}x_rx_{r-\theta }\le 1. \end{aligned}$$
    (7)
  3. (3)

    Cross-correlation Constraint: For any \(\mathbf{x}=(x_0, x_1, \ldots ,\) \(x_{n-1})\in {\mathscr {C}}\), \(\mathbf{y}=(y_0, y_1, \) \(\ldots , y_{n-1})\in {\mathscr {C}}\), \(\mathbf{x}\ne \mathbf{y}\) and any integer \(\theta , \ 0\le \theta <n\),

    $$\begin{aligned} \sum \limits _{r=0}^{n-1}x_ry_{r-\theta }\le 1, \end{aligned}$$
    (8)

    where all subscripts here are taken modulo n. If the number of codewords of Hamming weight \(w_j\) equals \(\frac{1}{k}|{\mathscr {C}}|\) for each j, namely \(Q=(\frac{1}{k},\ldots ,\frac{1}{k})\), we say that \({\mathscr {C}}\) is a balanced (nW, 1)-VWOOC. Let \(\Phi (n,W,1,Q)\) denote the largest size of an (nW, 1, Q)-VWOOC. The following upper bound on the \(\Phi (n,W,1,Q)\) has been stated in [10]:

    $$\begin{aligned} \Phi (n,W,1,Q)\le b\left\lfloor \frac{n-1}{\sum \limits _{j=1}^{k}a_jw_j(w_j-1)}\right\rfloor \end{aligned}$$
    (9)

    where \(Q=(\frac{a_1}{b},\ldots ,\frac{a_k}{b})\) is normalized. An (nW, 1, Q)-VWOOC is called optimal if \(\Phi (n,W,1,Q)\) meets the bound (9). Optimal (nW, 1, Q)-VWOOCs have been studied extensively for some years, the interested reader can refer to [10, 16, 30, 36] and the references therein. Variable-weight Optical orthogonal codes are closely related to some combinatorial configurations, see [30].

Lemma 14

[30] An (nW, 1, Q)-VWOOC of size t is equivalent to an (nW, 1, Q)-DP of size t. Furthermore, an optimal (nW, 1, Q)-VWOOC is equivalent to an optimal (nW, 1, Q)-DP.

In an multimedia OCDMA system, variable-weight OOCs are designed for supporting multiple QoS requirements. However, the rate of each user in a network is supposed identical. In [18, 22], multilength OOCs are mainly designed for supporting multirate systems, where longer and shorter codewords are provided to mainly support lower and higher services, respectively. However, these codes show limited number of services and multiple access interference or high cross-correlation in the networks. In order to solve the problems of limited number of services in the multilength OOCs and constant rate in the VWOOCs, multilength variable-weight OOCs (MLVWOOCs) are proposed for supporting multirate and integrated multimedia services in OCDMA networks [23, 24]. It allows the systems with multirate multimedia services in an OCDMA network where some services may have lower date rate and the other some services may have higher date rate with different performance and QoS.

Under certain specified correlation constraints, an MLVWOOC can be seen simply as a set of some constant length variable-weight OOCs of pairwise distinct lengths. More precisely, let \(\lambda \) be a positive integer, \(N=\{n_0,n_1,\ldots ,n_{l-1}\}\) a set of l positive integers and an multiset \(M=[m_0,m_1,\ldots ,m_{l-1}]\) such that an \((n_i,W, 1,Q)\)-VWOOC \({\mathscr {C}}_i\) exists with \(m_i=| {\mathscr {C}}_i|\), where \(i\in \{0,1,\ldots ,l-1\}\), \(l\ge 2\) is an integer. We say that \({\mathscr {C}}=\{{\mathscr {C}}_0,{\mathscr {C}}_1,\ldots ,{\mathscr {C}}_{l-1}\}\) is an \((N,M,W,1,Q;\lambda )\)-MLVWOOC, if the following two intercross-correlation constraints are held: for any \(\mathbf{x}=(x_0, x_1,\ldots , x_{n_e-1})\in {\mathscr {C}}\) of length \(n_e\), \(\mathbf{y}=(y_0, y_1, \ldots , y_{n_s-1})\in {\mathscr {C}}\) of length \(n_s\), then

$$\begin{aligned} \sum \limits _{r=0}^{n_s-1}x_{r\ominus _e\theta }y_{r}\le \lambda \hbox { for any integer }0\le \theta <n_e, \end{aligned}$$
(10)
$$\begin{aligned} \sum \limits _{r=0}^{n_e-1}x_{r}y_{r\ominus _s\theta }\le \lambda \hbox { for any integer }0\le \theta <n_s, \end{aligned}$$
(11)

where \(\ominus _i\) and \(\oplus _i\) denote the subtraction and addition modulo \(n_i\) , respectively. For each given \(n_i\), the above definition indicates that all codewords in \({\mathscr {C}}\) of the length \(n_i\) satisfy the correlation constraints (7) and (8) which are said to be the auto-correlation constraint and the intracross-correlation constraint, respectively, of the MLVWOOC. The size of the MLVWOOC is the number of codewords in \({\mathscr {C}}\), i.e. \(| {\mathscr {C}}|=\sum _{i=0}^{l-1}m_i\).

If \(W=\{w\}\) and \(Q=(1)\), we say that \({\mathscr {C}}\) is an \((N,M,w,1;\lambda )\)-MLOOC (multilength OOC). For the existence of optimal (NMw, 1; 2)-MLOOCs, the interested reader may refer to [2, 3, 20, 27]. If \({\mathscr {C}}_i\) is a balanced \((n_i,W,1)\)-VWOOC for each i, then \({\mathscr {C}}=\{{\mathscr {C}}_0,\ldots ,{\mathscr {C}}_{l-1}\}\) is said to be a balanced \((N,M,W,1;\lambda )\)-MLVWOOC. As far as we know, there are few known results about optimal MLVWOOCs. In [35], some infinite classes of optimal balanced (NMW, 1; 2)-MLVWOOCs with \(W=\{3,4\}\) are obtained and the relationship between an MLVWOOC and a CDP set system is described.

Proposition 2

[35] Let \({\mathscr {C}}_i\) be an \((n_i,W,1,Q)\)-VWOOC of size \(m_i\) and \({\mathscr {B}}_i\) the corresponding \((n_i,W,1,Q)\)-DP for \(0\le i\le l-1\), \({\mathscr {C}}=\{{\mathscr {C}}_0,{\mathscr {C}}_1,\ldots ,{\mathscr {C}}_{l-1}\}\) is an (NMW, 1, Q\(\lambda )\)-MLVWOOC if and only if \({\mathscr {B}}=\{{\mathscr {B}}_0,{\mathscr {B}}_1,\ldots ,{\mathscr {B}}_{l-1}\}\) is an \((N,M,W,1,Q;\lambda )\)-CDP set system.

5.1 Upper bounds on code size

In this section, let \(Q=(\frac{a_1}{b},\ldots ,\frac{a_k}{b})\) be normalized and \(n=\frac{t}{b}\sum _{j=1}^ka_jw_j(w_j-1)+g\) such that g and t are positive integers with b|t and \(1\le g\le \sum _{j=1}^ka_jw_j(w_j-1)\).

We use \(\Phi (N,W,1,Q;\lambda )\) to denote the largest size \(\sum _{i=0}^{l-1}m_i \) of an \((N,M,W,1,Q;\lambda )\)-MLVWOOC. From the bound (9), we have the following inequality:

$$\begin{aligned} \Phi (N,W,1,Q;\lambda )\le b\sum \limits _{i=0}^{l-1}\left\lfloor \frac{n_i-1}{\sum \limits _{j=1}^{k}a_jw_j(w_j-1)}\right\rfloor . \end{aligned}$$
(12)

This bound has nothing to do with the intercross-correlation constraint \(\lambda \), then may in general not be tight for small values of \(\lambda \). It is easy to see that the function \(\Phi (N,W,1,Q;\lambda )\) decreases with the decrease of \(\lambda \), then the following inequality is obvious.

$$\begin{aligned} \Phi (N,W,1,Q;1)\le b\left\lfloor \frac{n_{l-1}-1}{\sum \limits _{j=1}^{k}a_jw_j(w_j-1)}\right\rfloor \end{aligned}$$

where \(n_{l-1}=max\{n_0,n_1,\ldots ,n_{l-1}\}\). So, we can construct an (NMW, 1, Q; 1)-MLVWOOC of size meeting this bound from an optimal \((n_{l-1},W,1,Q)\)-VWOOC. When \(\lambda =\eta \), the trivial bound (12) is tight and by combining l optimal \((n_i,W,1,Q)\)-VWOOC’s \((i=0,1,\ldots ,l-1)\), we can obtain an optimal \((N,M,W,1,Q;\lambda )\)-MLVWOOC of size meeting this bound. Clearly, the intercross-correlation holds for any two codewords for \(\lambda \ge \eta \) since each codeword has weight no more than \(\lambda \). In [35], some upper bounds on balanced \((N,M,\{3,4\},\) \(1;\lambda )\)-MLVWOOCs are obtained with \(\lambda =2\), the least value among the nontrivial intercross correlation. In this section, we consider the upper bounds on (NMW, 1, Q; 2)-MLVWOOCs for general W and Q. We can get the following theorem, which can be used to establish some upper bounds on the code size.

Theorem 7

For any \((\{n,nr\},[t,m],W,1,Q;2)\)-MLVWOOC, if \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j(w_j-1)-1}{\sum _{j=1}^ka_jw_j}\right\rfloor \), the following inequality holds:

$$\begin{aligned} m\le b\left\lfloor \frac{nr-1-\varphi (r)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor =rt+b\left\lfloor \frac{gr-1-\varphi (r)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor , \end{aligned}$$

where \(r\ge 2\) is an integer and

$$\begin{aligned} \varphi (r)=r-1-2\left\lfloor \frac{(g-1)r}{\sum _{j=1}^ka_j(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )}\right\rfloor \sum _{j=1}^ka_j\lfloor \frac{w_j}{2}\rfloor . \end{aligned}$$

Proof

Let \({\mathscr {C}}=\{{\mathscr {C}}_0,{\mathscr {C}}_1\}\) be an \((\{n,nr\},\{t,m\},W,1,Q;2)\)-MLVWOOC and \({\mathscr {A}}_0\) the DP of size t representing \({\mathscr {C}}_0\). Since \(n=\frac{t}{b}\sum _{j=1}^ka_jw_j(w_j-1)+g\) and \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j(w_j-1)-1}{\sum _{j=1}^ka_jw_j}\right\rfloor \), we have

$$\begin{aligned} t=b\cdot \frac{n-g}{\sum _{j=1}^ka_jw_j(w_j-1)}=b\left\lfloor \frac{n-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor . \end{aligned}$$

Then, \({\mathscr {A}}_0\) is an optimal (nW, 1, Q)-DP. Its difference leave DL\(({\mathscr {A}}_0)\) consists of g elements including zero. Now let \({\mathscr {A}}_1\) be the (nrW, 1, Q)-DP of size m representing \({\mathscr {C}}_1\). So, \({\mathscr {F}}=\{{\mathscr {A}}_0,{\mathscr {A}}_1\}\) is an \((\{n,nr\},[t,m],W,1,Q;2)\)-CDP set system from Proposition 2. The unique additive subgroup of order r in \(Z_{nr}\) is denoted by H, i.e., \(H=nZ_{nr}\). Let \(H_i=H_0+i\) \((i=0,1,\ldots ,n-1)\) be the n additive cosets of H in \(Z_{nr}\), where \(H_0=H\) and \(H_0+i=\{nj+i\pmod {nr}:0\le j\le r-1\}\). Then, every element of \(H_i\) has projection i on \(Z_n\). Assume that there exists a base block \(B\in {\mathscr {A}}_1\) containing a triple \(\{b_1,b_2,b_3\}\) of a certain coset \(H_i\), we have

$$\begin{aligned} b_1-d\equiv b_2-d\equiv b_3-d\equiv \theta -d\pmod n \end{aligned}$$

for any \(A\in {\mathscr {A}}_0\) and any \(d\in A\), hence \(\Theta _{(A,B)}(\theta -d)\ge 3\), that is a contradiction since \({\mathscr {A}}_0\), \({\mathscr {A}}_1\) are 2-compatible. So, for each base block \(B\in {\mathscr {A}}_1\) and each coset \(H_i\), we have \(|B\cap H_i|\le 2\). Define

\({\mathscr {T}}_j=\{B\in {\mathscr {A}}_1\cap {Z_{nr}\atopwithdelims (){w_j}}:|B\cap H_i|=2\) for at least one \(i\in Z_n\}\), \(j=1,2,\ldots ,k\),

$$\begin{aligned} {\mathscr {T}}=\bigcup _{j=1}^k{\mathscr {T}}_j. \end{aligned}$$

Without loss of generality, we assume that \({\mathscr {T}}_j=\frac{a_j}{b}|{\mathscr {T}}|\), \(j=1,2,\ldots ,k\). So, \(|H\cap \Delta ({\mathscr {T}})|\) is the number of elements of \(H\setminus \{0\}\) included in \(\Delta {\mathscr {A}}_1\), i.e. \(|H\cap \Delta ({\mathscr {A}}_1)|=|H\cap \Delta ({\mathscr {T}})|\). Obviously, every block \(B\in {\mathscr {T}}\) with \(|B|=w_j\) contains at most \(\lfloor \frac{w_j}{2}\rfloor \) pairs of elements from \(\lfloor \frac{w_j}{2}\rfloor \) distinct cosets of H, every being a 2-subset of a certain coset. Then, the difference list \(\Delta (B)\) contains at most \(2\lfloor \frac{w_j}{2}\rfloor \) elements from \(H\setminus \{0\}\), that is, \(\Delta (B)\) contains at least \(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor \) elements from \(Z_{nr}\setminus H\). We have

$$\begin{aligned} |H\cap \Delta ({\mathscr {T}}_j)|\le 2\lfloor \frac{w_j}{2}\rfloor |{\mathscr {T}}_j|, j=1,2,\ldots ,k; \end{aligned}$$
(13)
$$\begin{aligned} \sum _{j=1}^k[(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )|{\mathscr {T}}_j|]\le |\Delta ({\mathscr {T}})\cap (Z_{nr}\setminus H)|. \end{aligned}$$
(14)

For each \(d\in \) DL\(({\mathscr {A}}_0)\), there are precisely r elements (from a certain coset of H) having projection d on \(Z_n\). Then, there are precisely \((g-1)r\) elements in \(Z_{nr}\setminus H\) whose projections on \(Z_n\) is contained in DL\(({\mathscr {A}}_0)\setminus \{0\}\). This indicates that

$$\begin{aligned} |\Delta ({\mathscr {T}})\cap (Z_{nr}\setminus H)|\le (g-1)r. \end{aligned}$$
(15)

In fact, if (15) is incorrect, then \(\Delta ({\mathscr {T}})\) must consist of more than \((g-1)r\) elements not congruent to 0 \((\mathrm{mod}\ n)\). This follows that there exist at least one base block \(B=\{h,h',b_1,\ldots ,b_{w_j-2}\}\) \(\in {\mathscr {T}}\) such that \(b_i-h\pmod n\not \in \) DL\(({\mathscr {A}}_0)\) where \(h,h'\in H_s\) for some \(s\in Z_n\), \(b_i\in Z_{nr}\setminus H_s\). It leads that there exists a unique base block \(A=\{a_1,a_2,a_3,\ldots \}\in {\mathscr {A}}_0\) such that \(a_2-a_1\equiv b_i-h\equiv b_i-s\pmod n\). Then we have \(h-a_1\equiv h'-a_1\equiv b_i-a_2\equiv s-a_1\pmod n\). Therefore \(\Theta _{(A,B)}(s-a_1)\ge 3\), that is a contradiction since \({\mathscr {T}}\subseteq {\mathscr {A}}_1\) and \({\mathscr {A}}_0\), \({\mathscr {A}}_1\) are 2-compatible. By combining (14) and (15), we have

$$\begin{aligned} \sum _{j=1}^k[(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )|{\mathscr {T}}_j|]\le (g-1)r, \end{aligned}$$

then

$$\begin{aligned} \sum _{j=1}^k(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )\frac{a_j}{b}|{\mathscr {T}}|\le (g-1)r, \end{aligned}$$

and hence

$$\begin{aligned} \frac{|{\mathscr {T}}|}{b}\sum _{j=1}^ka_j(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )\le (g-1)r. \end{aligned}$$

Since \(|{\mathscr {T}}|\) is divisible by b, we have

$$\begin{aligned} \frac{|{\mathscr {T}}|}{b}\le \left\lfloor \frac{(g-1)r}{\sum _{j=1}^ka_j(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )}\right\rfloor . \end{aligned}$$

It is clear that

$$\begin{aligned}&|H\cap \Delta ({\mathscr {A}}_1)|=|H\cap \Delta ({\mathscr {T}})|=\sum _{j=1}^k|H\cap \Delta ({\mathscr {T}}_j)|\\&\quad \le \sum _{j=1}^k2\lfloor \frac{w_j}{2}\rfloor |{\mathscr {T}}_j|=2\frac{|{\mathscr {T}}|}{b}\sum _{j=1}^ka_j\lfloor \frac{w_j}{2}\rfloor \\&\quad \le 2\left\lfloor \frac{(g-1)r}{\sum _{j=1}^ka_j(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )}\right\rfloor \sum _{j=1}^ka_j\lfloor \frac{w_j}{2}\rfloor . \end{aligned}$$

This implies that there are at least \(\varphi (r)\) elements of \(H\setminus \{0\}\) which are not covered by \(\Delta ({\mathscr {A}}_1)\). The proof is then complete. \(\square \)

The restriction \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j(w_j-1)-1}{\sum _{j=1}^ka_jw_j}\right\rfloor \) in Theorem 7 is necessary. It guarantees that \(\varphi (r)\) is a non-negative integer-valued function and \(\varphi (r)\le r-1\) for any given integer r. This is because

$$\begin{aligned}&0\le 2\left\lfloor \frac{(g-1)r}{\sum _{j=1}^ka_j(w_j(w_j-1)-2\lfloor \frac{w_j}{2}\rfloor )}\right\rfloor \sum _{j=1}^ka_j\lfloor \frac{w_j}{2}\rfloor \le \left\lfloor \frac{(g-1)r}{\sum _{j=1}^ka_jw_j(w_j-2)}\right\rfloor \sum _{j=1}^ka_jw_j\nonumber \\&\quad \le \left\lfloor \frac{(g-1)r\sum _{j=1}^ka_jw_j}{\sum _{j=1}^ka_jw_j(w_j-2)}\right\rfloor =\left\lfloor r-\frac{\sum _{j=1}^ka_jw_j(w_j-g-1)}{\sum _{j=1}^ka_jw_j(w_j-2)}\cdot r\right\rfloor \le r-1. \end{aligned}$$
(16)

From the property of the function \(\lfloor x\rfloor \), we have

$$\begin{aligned} b\left\lfloor \frac{nr-1-\varphi (r)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \le b\left\lfloor \frac{nr-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor -b\left\lfloor \frac{\varphi (r)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor , \end{aligned}$$

hence Theorem 7 tells us that the size m is less by \(b\left\lfloor \frac{\varphi (r)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \) than the trivial bound (12). By using Theorem 7, the following upper bounds on the code size are obtained.

Corollary 3

For any \((\{n,nr_1,\ldots ,nr_{l-1}\},M,W,1,Q;2)\)-MLVWOOC with \(m_0=t\), if \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j(w_j-1)-1}{\sum _{j=1}^ka_jw_j}\right\rfloor \), the following inequality holds:

$$\begin{aligned}&\Phi (\{n,nr_1,\ldots ,nr_{l-1}\},W,1,Q;2)\le t\nonumber \\&\quad + b\sum \limits _{i=1}^{l-1}\left( \left\lfloor \frac{nr_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor - \left\lfloor \frac{\left\lceil \frac{r_i}{\sum _{j=1}^ka_jw_j(w_j-2)}\right\rceil -1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \right) \end{aligned}$$
(17)

where \(r_1,r_2,\ldots ,r_{l-1}\) are \(l-1\) arbitrary distinct integers and each \(r_i\ge 2\).

Proof

Let \({\mathscr {C}}=\{{\mathscr {C}}_0,{\mathscr {C}}_1,\ldots ,{\mathscr {C}}_{l-1}\}\) be an \((\{n,nr_1,\ldots ,nr_{l-1}\},M,W,1,Q;2)\)-MLVWOOC. By the assumption, we have

$$\begin{aligned} t=b\cdot \frac{n-g}{\sum _{j=1}^ka_jw_j(w_j-1)}=b\left\lfloor \frac{n-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor , \end{aligned}$$

Let us assume that \({\mathscr {C}}_0\) is an optimal (nW, 1, Q)-VWOOC. Clearly, \(\{{\mathscr {C}}_0,{\mathscr {C}}_i\}\) is an \((\{n,nr_i\},\{t,m_i\},\) W, 1, Q; 2)-MLVWOOC for every i with \(1\le i\le l-1\). According to the definition of \(\varphi (r)\) and (16), we have

$$\begin{aligned}&\varphi (r_i)\ge r_i-1-\left( r_i-\frac{\sum _{j=1}^ka_jw_j(w_j-g-1)}{\sum _{j=1}^ka_jw_j(w_j-2)}\cdot r_i\right) =\frac{\sum _{j=1}^ka_jw_j(w_j-g-1)}{\sum _{j=1}^ka_jw_j(w_j-2)}\cdot r_i-1\\&\quad \ge \frac{\sum _{j=1}^ka_jw_j(w_j-1)-\frac{\sum _{j=1}^ka_jw_j(w_j-1)-1}{\sum _{j=1}^ka_jw_j}\cdot \sum _{j=1}^ka_jw_j}{\sum _{j=1}^ka_jw_j(w_j-2)}\cdot r_i-1=\frac{r_i}{\sum _{j=1}^ka_jw_j(w_j-2)}-1. \end{aligned}$$

Since \(\varphi (r_i)\ge 0\) is an integer-valued function, we have

$$\begin{aligned} \varphi (r_i)\ge \left\lceil \frac{r_i}{\sum _{j=1}^ka_jw_j(w_j-2)}\right\rceil -1. \end{aligned}$$

Then,

$$\begin{aligned}&m_i\le b\left\lfloor \frac{nr_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor -b\left\lfloor \frac{\varphi (r_i)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \\&\quad \le b\left\lfloor \frac{nr_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor -b\left\lfloor \frac{\left\lceil \frac{r_i}{\sum _{j=1}^ka_jw_j(w_j-2)}\right\rceil -1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \end{aligned}$$

from Theorem 7. The inequality in the corollary is obtained. \(\square \)

It is clear that the upper bound (17) is less by

$$\begin{aligned} b\sum \limits _{i=1}^{l-1} \left\lfloor \frac{\left\lceil \frac{r_i}{\sum _{j=1}^ka_jw_j(w_j-2)}\right\rceil -1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \end{aligned}$$

than the trivial bound (12), which increases quickly with l and \(r_i\)’s increasing for the given set W. Therefore, the bound (17) is a noticeable improvement from the bound (12). The values of the function \(\varphi (r)\) defined in Theorem 7 become large when the values of g decrease, we can further simplify this bound for small values of g. Especially, if we restrict to \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j^2}{2\sum _{j=1}^ka_jw_j}\right\rfloor \), then we can get the following meaningful corollary.

Corollary 4

For any \((\{n,nr_1,\ldots ,nr_{l-1}\},M,W,1,Q;2)\)-MLVWOOC with \(m_0=t\), if \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j^2}{2\sum _{j=1}^ka_jw_j}\right\rfloor \), the following inequality holds:

$$\begin{aligned}&\Phi (\{n,nr_1,\ldots ,nr_{l-1}\},W,1,Q;2)\le t\nonumber \\&\quad + b\sum \limits _{i=1}^{l-1}\left( \left\lfloor \frac{nr_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor - \left\lfloor \frac{\left\lceil \frac{r_i}{2}\right\rceil -1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \right) \end{aligned}$$
(18)

where \(r_1,r_2,\ldots ,r_{l-1}\) are \(l-1\) arbitrary distinct integers and each \(r_i\ge 2\).

Proof

This proof is analogous of the proof of Corollary 3. By the assumption \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j^2}{2\sum _{j=1}^ka_jw_j}\right\rfloor \), we have

$$\begin{aligned}&\varphi (r_i)\ge \frac{\sum _{j=1}^ka_jw_j(w_j-g-1)r_i}{\sum _{j=1}^ka_jw_j(w_j-2)}-1=\frac{\sum _{j=1}^ka_jw_j(w_j-1)-g\sum _{j=1}^ka_jw_j}{\sum _{j=1}^ka_jw_j(w_j-2)}\cdot r_i-1\\&\quad \ge \frac{\sum _{j=1}^ka_jw_j(w_j-1)-\frac{\sum _{j=1}^ka_jw_j^2}{2\sum _{j=1}^ka_jw_j}\cdot \sum _{j=1}^ka_jw_j}{\sum _{j=1}^ka_jw_j(w_j-2)}\cdot r_i-1=\frac{r_i}{2}-1, \end{aligned}$$

i.e., \(\varphi (r_i)\ge \left\lceil \frac{r_i}{2}\right\rceil -1\). Therefore, the inequality (18) holds from Theorem 7. \(\square \)

Applying Theorem 7 with \(g=1\), we can obtain the following upper bound on code size.

Corollary 5

For any \((\{n,nr_1,\ldots ,nr_{l-1}\},M,W,1,Q;2)\)-MLVWOOC with \(m_0=t\) and \(g=1\), the following inequality holds:

$$\begin{aligned}&\Phi (\{n,nr_1,\ldots ,nr_{l-1}\},W,1,Q;2)\nonumber \\&\quad \le t+ b\sum \limits _{i=1}^{l-1}\left( \left\lfloor \frac{nr_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor - \left\lfloor \frac{r_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \right) =t+\sum _{i=1}^{l-1}tr_i\nonumber \\ \end{aligned}$$
(19)

where \(r_1,r_2,\ldots ,r_{l-1}\) are \(l-1\) arbitrary distinct integers and each \(r_i\ge 2\).

Proof

Similarly to the proof of Corollary 3, let \({\mathscr {C}}=\{{\mathscr {C}}_0,{\mathscr {C}}_1,\ldots , {\mathscr {C}}_{l-1}\}\) be an \((\{n,nr_1,\ldots ,\) \(nr_{l-1}\},M,W,1,Q;2)\)-MLVWOOC. When \(g=1\), we have \(\varphi (r)=r-1\) from Theorem 7. Applying Theorem 7 with \(g=1\), we get

$$\begin{aligned} m_i\le & {} b\left\lfloor \frac{nr_i-1-\varphi (r_i)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \le b\left\lfloor \frac{nr_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \\&-b\left\lfloor \frac{r_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor =tr_i \end{aligned}$$

for each i with \(1\le i\le l-1\). Thus, we have the conclusion. \(\square \)

Corollaries 35 give us upper bounds on \(\Phi (\{n,nr_1,\ldots ,nr_{l-1}\},W,1,Q;2)\). To be more precise, the following theorem is obtained.

Theorem 8

For any \((\{n,nr\},\{t,m\},W,1,Q;2)\)-MLVWOOC with integer \(r\ge 2\), then

$$\begin{aligned} \Phi (\{n,nr\},W,1,Q;2)\le b\left\lfloor \frac{n-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor + b\left( \left\lfloor \frac{nr-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor - 1\right) \nonumber \\ \end{aligned}$$
(20)

if one of the following conditions is satisfied:

  1. (1)

    \(r\ge \sum _{j=1}^ka_jw_j(w_j-2)\sum _{j=1}^ka_jw_j(w_j-1)+1\) and \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j(w _j-1)-1}{\sum _{j=1}^ka_jw_j}\right\rfloor \);

  2. (2)

    \(r\ge 2\sum _{j=1}^ka_jw_j(w_j-1)+1\) and \(g\le \left\lfloor \frac{\sum _{j=1}^ka_jw_j^2}{2\sum _{j=1}^ka_jw_j}\right\rfloor \);

  3. (3)

    \(r\ge \sum _{j=1}^ka_jw_j(w_j-1)+1\) and \(g=1\).

Proof

Let \({\mathscr {C}}=\{{\mathscr {C}}_0,{\mathscr {C}}_1\}\) be an \((\{n,nr\},\{t,m\},W,1,Q;2)\)-MLVWOOC. By the assumption, we have \(g\le \sum _{j=1}^ka_jw_j(w_j-1)\) and

$$\begin{aligned} t=b\cdot \frac{n-g}{\sum _{j=1}^ka_jw_j(w_j-1)}=b\left\lfloor \frac{n-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor . \end{aligned}$$

Let us assume that \({\mathscr {C}}_0\) is an optimal (nW, 1, Q)-VWOOC. By the assumption and applying Corollaries 3-5 with \(l=2\), we have

$$\begin{aligned} m\le & {} b\left( \left\lfloor \frac{nr-1}{\sum _{j=1}^ka_jw_j(w _j-1)}\right\rfloor -\left\lfloor \frac{\varphi (r)}{\sum _{j=1}^ka_jw_j(w _j-1)}\right\rfloor \right) \\\le & {} b\left( \left\lfloor \frac{nr-1}{\sum _{j=1}^ka_jw_j(w _j-1)}\right\rfloor -1\right) . \end{aligned}$$

It follows that

$$\begin{aligned} t+m\le t+b\left( \left\lfloor \frac{nr-1}{\sum _{j=1}^ka_jw_j(w _j-1)}\right\rfloor -1\right) . \end{aligned}$$

This inequality obviously holds also when \({\mathscr {C}}_0\) is not optimal, i.e., the size of \({\mathscr {C}}_0\) does not exceed \(t-b\), since \(m\le b\left\lfloor \frac{nr-1}{\sum _{j=1}^ka_jw_j(w _j-1)}\right\rfloor \) from the bound (9). \(\square \)

It is not difficult to see that Theorem 8 can be generalized to the following result.

Corollary 6

For any \((\{n,nr_1,\ldots ,nr_{l-1}\},M,W,1,Q;2)\)-MLVWOOC with \(l-1\) distinct integers \(r_i\ge 2\) \((i=1,2,\ldots , l-1)\), \(m_0=t\), the following inequality holds:

$$\begin{aligned} \Phi (\{n,nr_1,\ldots ,nr_{l-1}\},W,1,Q;2)\le t+ b\left( \sum \limits _{i=1}^{l-1}\left\lfloor \frac{nr_i-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor - 1\right) \end{aligned}$$
(21)

if there exist at least one \(r\in \{r_1,r_2,\ldots ,r_{l-1}\}\) such that one of the three conditions presented in Theorem 8 is satisfied.

It is easy to find that the value \(b\left\lfloor \frac{nr-1-\varphi (r)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \) is enlarged when we use Theorem 7 to get Corollaries 35, so the lower bound on r stated in Theorem 8 is sufficient but not necessary condition to get the inequality (20). For the given set W and the value g, we can decide whether the inequality (20) holds or not by comparing the values of \(b\left\lfloor \frac{nr-1}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \) and \(b\left\lfloor \frac{nr-1-\varphi (r)}{\sum _{j=1}^ka_jw_j(w_j-1)}\right\rfloor \) for those integers r below the bound. The cases where \(W=\{3,4\},\{3,5\}\) and \(2\le g\le \left\lfloor \frac{a_1w_1^2+a_2w_2^2}{2(a_1w_1+a_2w_2)}\right\rfloor \) are presented in the following result for convenience of later use.

Theorem 9

Let \(W=\{3,4\},\{3,5\}\), \(Q=(\frac{1}{2},\frac{1}{2})\) and \(n=\frac{t}{2}\sum _{j=1}^2w_j(w_j-1)+2\) such that t is even. For any \(l-1\) distinct integers \(r_i\ge 2\) \((i=1,2,\ldots , l-1)\), the following inequality holds:

$$\begin{aligned} \Phi (\{n,nr_1,\ldots ,nr_{l-1}\},W,1,Q;2)\le t+ 2\left( \sum \limits _{i=1}^{l-1}\left\lfloor \frac{nr_i-1}{\sum _{j=1}^kw_j(w_j-1)}\right\rfloor - 1\right) \end{aligned}$$
(22)

if there exist at least one \(r\in \{r_1,r_2,\ldots ,r_{l-1}\}\) taken from the values of the following table.

W

n

The desired values of r

{3,4}

\(9t+2\)

\(r\ge 37\) or \(r\in \{10,11,19-23,28-35\}\)

{3,5}

\(13t+2\)

\(r\ge 53\) or \(r\in \{14-19,27-52\}\)

5.2 New infinite classes of MLVWOOCs

In this section, several infinite classes of optimal MLVWOOCs are yielded by using pairwise 2-compatible (ngW, 1)-DFs and recursive constructions.

Theorem 10

If n is a positive integer whose prime factors are congruent to 1 modulo 12, then there is a balanced \((N,M,\{3,4\},1;2)\)-MLVWOOC of size \(\frac{20(n-1)}{3}\), where \(N=\{6n,12n,18n,24n\}\) and \(M=[\frac{2(n-1)}{3},\frac{4(n-1)}{3},2(n-1),\frac{8(n-1)}{3}]\).

Proof

From Lemma 12, a balanced \(\{3,4\}\)-SCGDD of type \(u^{4}\) exists for \(u\in \{6,12,18,24\}\), and there exist four pairwise 2-compatible (n, 4, 1)-DFs from Corollary 4.4 in [3], hence we have a balanced \((N',M,\{3,4\},1;2)\)-CDF set system with size \(\frac{20(n-1)}{3}\) from Construction 6, where \(N'=\{(6n,6),(12n,\) \(12),(18n,18),(24n,24)\}\). The corresponding balanced \((N,M,\{3,4\},1;2)\)-MLVWOOC with size \(\frac{20(n-1)}{3}\) does not reach the upper bound 12 by missing two codewords (One of the codewords has a weight of 3 and the other has a weight of 4). \(\square \)

Theorem 11

If n is a positive integer whose prime factors are congruent to 1 modulo 6 and greater than 13, then there is a balanced \((N,M,\{3,4\},1;2)\)-MLVWOOC of size \(10n-7\) attaining the upper bound (12), where \(N=\{12n,24n,36n,48n\}\) and \(M=[\frac{2n-2}{3},\frac{8n-8}{3},4n-2,\frac{16n-4}{3}]\).

Proof

From Lemma 12, a balanced \(\{3,4\}\)-SCGDD of type \(u^{4}\) exists for \(u\in \{6,12,18,24\}\), and there exist four pairwise 2-compatible (2n, 2, 4, 1)-DFs from the proof of Theorem 4.9 in [3]. Let \({\mathscr {B}}_{12}=\{\{0,1,3,10\}, \{0,5,11\}\}\), \({\mathscr {B}}_{18}=\{\{0,-1,-3,-10\}, \{0,-5,-11\}\}\), \({\mathscr {B}}_{24}=\){{0,1,4,9}, {0,6,13,23},{0,11,27},{0,14,29}}, then \({\mathscr {B}}_{u}\) forms a balanced (2u\(\{3,4\},1)\)-DP for \(u\in \{12,18,24\}\). We verify that the balanced \((24,\{3,4\},1)\)-DP, the balanced \((36,\{3,4\},1)\)-DP, the balanced \((48,\{3,4\},1)\)-DP are pairwise 2-compatible and each base block contains at most two elements which are congruent modulo 2. So, we have a balanced \((N,M,\{3,4\},1;2)\)-CDP with size \(10n-7\) from Construction 6. The corresponding balanced \((N,M,\{3,4\},1;2)\)-MLVWOOC is optimal since the size reaches the upper bound (12). \(\square \)

Theorem 12

If n is a positive integer whose prime factors are congruent to 1 modulo 4 and greater than 17, then there is a balanced \((N,M,\{3,4\},1;2)\)-MLVWOOC of size \(20n-8\) attaining the upper bound (12), where \(N=\{18n,36n,54n,72n\}\) and \(M=[2n-2,4n-2,6n-2,8n-2]\).

Proof

From Lemma 12, a balanced \(\{3,4\}\)-SCGDD of type \(u^{4}\) exists for \(u\in \{6,12,18,24\}\), and there exist four pairwise 2-compatible (3n, 3, 4, 1)-DFs from Corollary 4.13 of [3]. Let \({\mathscr {B}}_{12}=\{\{0,1,5,11\}, \{0,2,16\}\}\), \({\mathscr {B}}_{18}=\{\{0,-1,-3,-7\}, \{0,-5,-13,-22\},\{0,\) \(-12,-28\},\) \(\{0,-15,\) \(-34\}\}\), \({\mathscr {B}}_{24}=\){{0,1,3,7}, {0,5,13,22},{0,10,21,35},{0,12,28},{0,15, 34},{0,18,41}}, then \({\mathscr {B}}_{u}\) forms a balanced \((3u,\{3,4\},1)\)-DP for \(u\in \{12,18,24\}\). It is not difficult to check that the balanced \((36,\{3,4\},1)\)-DP, the balanced \((54,\{3,4\},1)\)-DP, the balanced \((72,\{3,4\},1)\)-DP are pairwise 2-compatible and each base block contains at most two elements which are congruent modulo 3. So, we have a balanced \((N,M,\{3,4\},1;2)\)-CDP with size \(20n-8\) from Construction 6. The corresponding balanced \((N,M,\{3,4\},1;\) 2)-MLVWOOC is optimal since the size reaches the upper bound (12). \(\square \)

Lemma 15

If n is a positive integer whose prime factors are congruent to 1 modulo 18, then there are four pairwise 2-compatible balanced \((2n,2,\{3,4\},1)\)-DFs.

Proof

Let \(n=p_1^{a_1}p_2^{a_2}\cdots p_s^{a_s}\) be the factorization of n where each \(p_i\ge 19\) be prime and each integer \(a_i\ge 1\). For each prime \(p_i\), there are four pairwise 2-compatible balanced \((2p_i,2, \{3,4\},1)\)-DFs from Lemma 6. Since there is a \((p_i,4;1)\)-CDM from Lemma 11, applying Corollary 2 with \(g=2\), we can get four pairwise 2-compatible balanced \((2p_1p_i,2,\{3,4\},1)\)-DFs. Repeat the process to get four pairwise 2-compatible balanced \((2n,2,\{3,4\},1)\)-DFs. \(\square \)

Theorem 13

If n is a positive integer whose prime factors are congruent to 1 modulo 18, then there is an optimal balanced \((N,M,\{3,4\},1;2)\)-MLVWOOC with the size meeting the upper bound (22) where \(N=\{2n,10n,14n,22n\}\), \(M=[\frac{2n-2}{9},\frac{10n-10}{9},\frac{14n-14}{9},\) \(\frac{22n-22}{9}]\).

Proof

There exist four pairwise 2-compatible balanced \((2n,2,\{3,4\},1)\)-DFs from Lemma 15 and an (r, 4, 1)-CDM from Lemma 11, \(r=5,7,11\), hence there is a balanced \((N',M,\{3,4\},\) 1; 2)-CDF set system by Construction 4, where \(N'=\{(2n,2),(10n,10),\) (14n, 14),  \((22n,22)\}\). The corresponding balanced \((N,M,\{3,4\},\) 1; 2)-MLVWOOC is optimal since the size meets the upper bound (22). \(\square \)

Lemma 16

If n is a positive integer whose prime factors are congruent to 11 modulo 12, then there are ten pairwise 2-compatible balanced \((13n,13,\{3,5\},1)\)-DFs and each base block contains at most two elements which are congruent modulo 13.

Proof

Let \(n=p_1^{a_1}p_2^{a_2}\cdots p_s^{a_s}\) be the factorization of n where each \(p_i\ge 23\) be prime and each integer \(a_i\ge 1\). For each prime \(p_i\), there are ten pairwise 2-compatible balanced \((13p_i,13, \{3,5\},1)\)-DFs from Lemma 8. Along the lines of the proof of Lemma 15, we have ten pairwise 2-compatible balanced \((13n,13,\{3,5\},1)\)-DFs and each base block contains at most two elements which are congruent modulo 13 from the construction. \(\square \)

Theorem 14

If \(n_0,n_1,\ldots ,n_{9}\) are positive integers whose prime factors are congruent to 11 modulo 12, then there exists an optimal balanced \((N,M,\{3,5\},1;2)\)-MLVWOOC with the size attaining the upper bound (12), where \(N=\{13n_0,13n_0n_1,\ldots ,\) \(13n_0n_1\cdots \) \(n_{9}\}\) and \(M=[n_0-1,n_0n_1-1,\ldots ,n_0n_1\cdots n_{9}-1]\).

Proof

For each prime factor \(n_i\), there are ten pairwise 2-compatible balanced \((13n_i,13,\) \(\{3,5\},1)\)-DFs and each base block contains at most two elements which are congruent modulo 13 from Lemma 16, hence there exists a balanced \((N',M,\{3,5\},1;2)\)-CDF set system from Construction 5, where \(N'=\{(13n_0,13),(13n_0n_1,13),\ldots ,\) \((13n_0n_1\) \(\cdots n_{9},13)\}\) and \(M=[n_0-1,n_0n_1-1,\ldots ,n_0n_1\cdots n_{9}-1]\). The corresponding balanced \((N,M,\{3,5\},\) 1; 2)-MLVWOOC is optimal since the size reaches the upper bound (12). \(\square \)

Theorem 15

If n is a positive integer whose prime factors are congruent to 11 modulo 12, then there is an optimal balanced \((N,M,\{3,5\},1;2)\)-MLVWOOC with the size meeting the upper bound (12), where \(N=\{13n,65n,91n\}\) and \(M=[n-1,5n-1,7n-1]\).

Proof

There are three pairwise 2-compatible balanced \((13n,13,\{3,5\},1)\)-DFs from Lemma 16, and an (r, 5, 1)-CDM from Lemma 11, \(r\in \{5,7\}\), hence we have a balanced \((N',M',\{3,5\},\) 1; 2)-CDF set system from Construction 4, where \(N'=\{(13n,13),(65n,\) \(65),(91n,91)\}\) and \(M'=[n-1,5n-5,7n-7]\).

Let \({\mathscr {B}}_{5}=\){{0,1,3,7,12}, {0,8,18,31,45}, {0,15,32}, {0,16,35}} and \({\mathscr {B}}_{7}=\){{0,10,40,64,84}, {0,57,59,60,73}, {0,11,46,50,69}, {0,5,43}, {0,26,62}, {0,6,76}}, then \({\mathscr {B}}_r\) forms a balanced \((13r,\{3,5\},1)\)-DP, \(r=5,7\). We check that the balanced \((65,\{3,5\},1)\)-DP, the balanced \((91,\{3,5\},1)\)-DP are 2-compatible and each base block contains at most two elements which are congruent modulo 13, hence we have a balanced \((N,M,\{3,5\},1;2)\)-CDP set system from Construction 4, where \(N=\{13n,65n,91n\}\) and \(M=[n-1,5n-1,7n-1]\). The corresponding balanced \((N,M,\{3,5\},1;2)\)-MLVWOOC is optimal since the size meets the upper bound (12). \(\square \)

Lemma 17

If n is a positive integer whose prime factors are congruent to 1 modulo 26, then there are two pairwise 2-compatible balanced \((n,\{3,5\},1)\)-DFs.

Proof

Let \(n=p_1^{a_1}p_2^{a_2}\cdots p_s^{a_s}\) be the factorization of n where each \(p_i\ge 53\) be prime and each integer \(a_i\ge 1\). For each prime \(p_i\), there are two pairwise 2-compatible balanced \((p_i, \{3,5\},1)\)-DFs from Lemma 10. Along the lines of the proof of Lemma 15, we have two pairwise 2-compatible balanced \((n,\{3,5\},1)\)-DFs. \(\square \)

Theorem 16

If n is a positive integer whose prime factors are congruent to 1 modulo 26 greater than 53, then there exists an optimal balanced \((N,M,\{3,5\},1;2)\)-MLVWOOC with the size meeting the upper bound (19) where \(N=\{n,rn\}\), \(M=[\frac{n-1}{13},\frac{rn-r}{13}]\), r is odd and the least prime factor of r is not less than 5.

Proof

There exist two pairwise 2-compatible balanced \((n,\{3,5\},1)\)-DFs from Lemma 17 and an (r, 5, 1)-CDM from Lemma 11, hence we can obtain a balanced \((N',M,\) \(\{3,5\},1;2)\)-CDF set system from Construction 4, where \(N'=\{(n,1),\) \((rn,r)\}\) and \(M=[\frac{n-1}{13},\frac{rn-r}{13}]\). The corresponding balanced \((N,M,\{3,5\},1;2)\)-MLVWOOC is optimal since the size attains the upper bound (19). \(\square \)

6 Conclusion

In this paper, on the one hand some recursive constructions for compatible difference packing set systems are obtained by using (WQ)-SCGDDs of type \(u^h\). By using some (WQ)-SCGDDs of type \(u^h\), we can get some series of compatible difference packing set systems with multiple blocks sizes from compatible difference packing set systems with constant block size, then some infinite classes of optimal MLVWOOCs with weights 3 and 4 are produced. A (WQ)-SCGDD of type \(u^h\) is closely related to a 2-D variable-weight OOC with AM-OPPW. So, it is worthy of constructing (WQ)-SCGDDs of type \(u^h\) for some W and Q. On the other hand, a new consequence of the theorem of Weil on multiplicative character sums is given, and several infinite classes of (NMW, 1, Q; 2)-CDP set systems with \(W=\{3,4\},\{3,5\}\) are produced via the new consequence and cyclotomic classes. These (NMW, 1, Q; 2)-CDP set systems are used to yield some infinite classes of optimal balanced MLVWOOCs with \(W=\{3,4\},\{3,5\}\). Therefore, the following problems are worth of studying.

Problem 1 Construct optimal balanced (NMW, 1; 2)- MLVWOOCs for \(W=\{4,5\},\) \(\{3,4,5\}\).

Problem 2 Construct optimal (NMW, 1, Q; 2)-MLVWOOCs for \(Q\ne (\frac{1}{2},\frac{1}{2})\).