Skip to main content
added SageMath code
Source Link
Max Alekseyev
  • 34.3k
  • 5
  • 74
  • 152

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Together they give all differences from $1$ to $\lfloor\frac{m-1}{2}\rfloor$.

Notice that all elements forming pairs in these sets are $\ne0,1$ and are distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{3m}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.


ADDED. Here is a SageMath code implementing the above construction. There is a sample call construct_a(16,11), which constructs vector $(a_1,\dots,a_n)$ for parameters $n=16$ and $m=11$.

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Together they give all differences from $1$ to $\lfloor\frac{m-1}{2}\rfloor$.

Notice that all elements forming pairs in these sets are $\ne0,1$ and are distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{3m}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Together they give all differences from $1$ to $\lfloor\frac{m-1}{2}\rfloor$.

Notice that all elements forming pairs in these sets are $\ne0,1$ and are distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{3m}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.


ADDED. Here is a SageMath code implementing the above construction. There is a sample call construct_a(16,11), which constructs vector $(a_1,\dots,a_n)$ for parameters $n=16$ and $m=11$.

clarified
Source Link
Max Alekseyev
  • 34.3k
  • 5
  • 74
  • 152

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Together they give all differences from $1$ to $\lfloor\frac{m-1}{2}\rfloor$.

Notice that all elements informing pairs ofin these sets are $\ne0,1$ and are distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{m+1}{2}\rfloor+\lfloor\frac{m+1}{4}\rfloor+1$$\lfloor\frac{3m}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Notice that all elements in pairs of these sets are $\ne0,1$ and distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{m+1}{2}\rfloor+\lfloor\frac{m+1}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Together they give all differences from $1$ to $\lfloor\frac{m-1}{2}\rfloor$.

Notice that all elements forming pairs in these sets are $\ne0,1$ and are distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{3m}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.

added 102 characters in body; added 8 characters in body
Source Link
Max Alekseyev
  • 34.3k
  • 5
  • 74
  • 152

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Notice that all elements in pairs of these sets are $\ne0,1$ and distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{m+1}{2}\rfloor+\lfloor\frac{m+1}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Notice that all elements in pairs of these sets are $\ne0,1$ and distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned value to any of yet unassigned $a_j$ with $j>\frac{n}2$.

Yes, such construction is always possible.

Consider two sets of pairs of values: $$\big\{ (2+t,m-t)\quad :\quad t=0\,..\,\lfloor\frac{m-1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $2,4,\dots,2\cdot\lfloor\frac{m-1}{4}\rfloor$, and $$\big\{ (\lfloor\frac{m+1}{2}\rfloor+t+1,\lfloor\frac{m+1}{2}\rfloor-t)\quad :\quad t=0\,..\,\lfloor\frac{m+1}{4}\rfloor-1\big\},$$ where differences of elements modulo $m$ are: $1, 3, \dots, 2\cdot\lfloor\frac{m+1}{4}\rfloor-1.$ Notice that all elements in pairs of these sets are $\ne0,1$ and distinct modulo $m$.

Therefore, it's enough to assign the values from these sets to the corresponding pairs $(a_j,a_{n+2-j})$, giving $2\cdot\lfloor\frac{m-1}{2}\rfloor$ nonzero $a_j$'s. If $m$ is even we need to assign one more yet unassigned nonzero value (which is $\lfloor\frac{m+1}{2}\rfloor+\lfloor\frac{m+1}{4}\rfloor+1$) to any of yet unassigned $a_j$ with $j>\frac{n}2$. The other unassigned $a_j$ are set to zero.

Source Link
Max Alekseyev
  • 34.3k
  • 5
  • 74
  • 152
Loading