We begin this article with the description of a magic trick. The magician displays seven cards with values ace, 2, 3, 4, 5, 6, 7 (the ace counts as 1). They are “shuffled” with the help of the audience. Then the magician puts them face down in a circle on the table, and a spectator is invited to perform a “walk” on this circle: First she chooses one of the cards and turns it face up (Figure 1).

Figure 1.
figure 1

A walk on a circle of seven cards.

She then takes as many steps as the number on the card indicates (three in our example) clockwise along the circle. The card at which she arrives is turned face up, and the procedure is repeated. Figure 1 shows some steps of the walk.

After the cards \(3\rightarrow 2\rightarrow 6\rightarrow 4\rightarrow 5\rightarrow 1\) have been visited, the next step would lead back to the first card, the three.

But what about the remaining card that is still face down? The magician turns it face up, and—lo and behold!—it turns out that it is the one card that was lying face up in another deck that was on the table from the beginning. How could this be after all those extensive “shuffles” and “random” choices?

The motivation behind the present article was to understand the mathematical background of this magic trick. Why seven cards? Why this special order? In the first section we introduce sequences with what we call nontrivial sums in \({\mathbb {Z}}\hspace{0.2mm}_{n}\), a definition that will be crucial for our investigations. The next section contains the result that such sequences always exist if n is odd. The proof will be elementary but somewhat involved. Then we resume the discussion of the magic trick described above, and we close with some remarks.

We note that in [3,4,5,6,7,8,9,10], the reader will find other articles by the author in which facts from various areas of mathematics are used to present magic tricks. The book [1] is a collection of rather elementary contributions written for the general public, and the book [2] contains fifteen chapters written for mathematicians. Abbreviated versions of some of the articles [3,4,5,6,7,8,9,10] are also included in that book.

Sequences with Nontrivial Sums

Let \(n>2\) be an integer. Suppose that we have a sequence of distinct nonzero elements \((a_{1},\ldots ,a_{n-1})\) in the ring \({\mathbb {Z}}\hspace{0.2mm}_{n}\), i.e., a permutation of \(1,\ldots ,n-1\). We say that \((a_{1},\ldots ,a_{n-1})\) has nontrivial sums if whenever one chooses at most \(n-2\) consecutive terms \(a_{k},a_{k+1},\ldots ,a_{k'}\), then \(\sum _{i=k}^{k'}a_{i}\ne 0\). In view of the origin of the motivation to study such sequences, we will be interested only in the case \(\sum _{i=1}^{n-1}a_{i}=0\). This happens if and only if n is odd, and in the sequel we will assume that \(n=2m+1\).

For example, in \({\mathbb {Z}}\hspace{0.2mm}_{5}\), the sequence \((1,2,4,3)_{5}\) has nontrivial sums, but \((1,2,3,4)_{5}\) fails to have such sums, since \(2+3=0\). (The subscript 5 indicates that the sequence is in \({\mathbb {Z}}\hspace{0.2mm}_{5}\). In this way, one could also write \((1,2,-1,-2)_{5}\) for the first example, a notation that would be ambiguous without the subscript.)

Let us collect some easy preliminary results.

Lemma 1.

Let n be an odd number and suppose that \((a_{1},\ldots ,a_{n-1})\) is a sequence of distinct elements of \(\{1,2,\ldots ,n-1\}\). If \((a_{1},\ldots ,a_{n-1})\) has nontrivial sums, then so do

  • the reverse sequence \((a_{n-1},a_{n-2},\ldots ,a_{1})\);

  • the multiples \((a\cdot a_{1},a\cdot a_{2},\ldots ,a\cdot a_{n-1})\) for invertible a;

  • the cyclic translations \((a_{k},a_{k+1},\ldots ,a_{n-1},a_{1},\ldots ,a_{k-1})\) for all k.

Proof.

The first two assertions are obviously true. For the third we use the fact that \(\sum _{i}a_{i}=0\). It follows that \(\sum _{i=k}^{k'}a_{i}=-\sum _{i\notin \{k,\ldots ,k'\}}a_{i}\), and this easily implies that all cyclic translations have nontrivial sums. \(\square \)

In the theory of combinatorial designs, one considers similar questions (see [13] and the references therein). Alspach’s conjecture plays an important role in the theory. The conjecture is that if A is a subset of \({\mathbb {Z}}\hspace{0.2mm}_{n}\setminus \{0\}\) with k elements such that \(\sum _{a\in A} a\ne 0\), then one can arrange the elements of A as \(a_{1},\ldots ,a_{k}\) such that \(\sum _{i=s}^{s'}a_{i}\ne 0\) for all \(s,s'\) with \(1\le s\le s'\le k\). Alspach’s conjecture remains open.

Many partial results are known. In particular, it is true for even n that \(A=\{1,\ldots ,n-1\}\) can be reordered as \((a_{1},\ldots ,a_{n-1})\) such that every sum \(\sum _{i=s}^{s'}a_{i}\) is different from zero [12, Theorem 1].

Here is a proof. Let n be even. We claim that \((1,-2,3,-4,\ldots ,2,-1)_{n}\) is a permutation of the set \({\mathbb {Z}}\hspace{0.2mm}_{n}\setminus \{0\}\) with the desired properties. It is visualized in Figure 2 for the case \(n=10\) by the red zigzag line,

Figure 2.
figure 2

A visualization of the \(a_i\) for \(n=10\).

Put \(S_{k}:=a_{1}+\cdots +a_{k}\) for \(k=1,\ldots ,n-1\). In our example \(n=10\), one obtains

$$\begin{aligned} \begin{array}{c|ccccccccc} k &{}1&{}2&{}3&{}4&{}5&{}6&{}7&{}8&{}9\\ \hline S_{k}&{}1&{}-1&{}2&{}-2&{}3&{}-3&{}4&{}-4&{}5 \end{array}\,. \end{aligned}$$

And in general, if \(n=2m\), one has

$$\begin{aligned} \{S_{k}\mid k=1,\ldots ,n-1\}=\{\pm 1,\pm 2,\ldots ,\pm (m-1),m\} \end{aligned}$$

as an easy consequence of the fact that \(a_{k}=k\) for odd k and \(a_{k}=-k\) for even k. It follows that the \(S_{k}\) are distinct, and this proves the claim.

The case \(A=\{1,\ldots ,n-1\}\) of Alspach’s conjecture for even n is in a sense complementary to the problem investigated here, since we are studying odd n, whereas in the theory of combinatorial designs, only even n are of interest.

Sequences with Nontrivial Sums Always Exist If n Is Odd

Proposition 2.

Every odd n admits a sequence with nontrivial sums.

Proof.

Let \(n=2m+1\) be given. We define a permutation of \(\{1,2,\ldots ,n-1\}\) as follows: \(a_{1}:=1\), \(a_{i}:=(-1)^{i}\,2(i-1)\) for \(i=1,\ldots ,m\), \(a_{m+1}:=-1\), and \(a_{m+1+i}:=-a_{m+1-i}\). Note that the \(a_{i}\) exhaust \(\{1,\ldots ,n-1\}\). The fact that

$$\begin{aligned} \{1,\ldots ,n-1\}= & {} \{1,-1\}\cup \{2i\mid i=1,\ldots ,m-1\}\\{} & {} \cup \{-2i\mid i=1,\ldots ,m-1\} \end{aligned}$$

holds is a consequence of the invertibility of 2 in \({\mathbb {Z}}\hspace{0.2mm}_{n}\).

As an example, consider the case \(n=11\). Here the \(a_{i}\) are defined by

$$\begin{aligned} (a_{1},\ldots ,a_{10})= & {} (1,2,-4,6,-8,-1,8,-6,4,-2)_{11}\\= & {} (1,2,7,6,3,10,8,5,4,9)_{11}\,. \end{aligned}$$

It will be helpful to visualize this sequence. The permutation is defined by the red zigzag line in Figure 3, which oscillates between \(\{2i\mid i=1,\ldots ,m\}\) and \(\{-2i\mid i=1,\ldots ,m\}\), beginning with –2m (i.e., –10 = 1, since here m = 5). \(\square \)

Figure 3.
figure 3

A visualization of the \(a_i\) for \(n=11\).

It remains to show that we have defined a sequence with nontrivial sums, i.e., that \(S_{k,k'}:=a_{k}+\cdots +a_{k'}\ne 0\) holds for \(1\le k\le k'\le n-1\) if \((k,k')\ne (1,n-1)\).

A special case will play a crucial role. As preparation consider the \(S_{k,k'}\) for \(2\le k\le k'\le 5\) when \(n=11\) (see Figure 3):

$$\begin{aligned} S_{2,2}&=2;\hspace{5.0pt}S_{2,3}=-2;\hspace{5.0pt}S_{2,4}=4;\hspace{5.0pt}S_{2,5}=-4;S_{3,3}=-4;\\ S_{3,4}&=2;\hspace{5.0pt}S_{3,5}=-6;\hspace{5.0pt}S_{4,4}=6;\hspace{5.0pt}S_{4,5}=-2;S_{5,5}=-8. \end{aligned}$$

None of these are in \(\{-1,0,1\}\), and this is always the case. Indeed, we claim that

$$S_{k,k'}\in A:=\{2i\mid i=1,\ldots ,m\}\cup \{-2i\mid i=1,\ldots ,m\}$$

for \(2\le k\le k'\le m\), and in particular, \(S_{k,k'}\notin \{-1,0,1\}\).

Proof of the claim.

Let \(k\in \{2,\ldots ,m\}\) and \(k'=k+t\) with \(k+t\le m\) be given. Then

$$\begin{aligned} S_{k,k+t}&=a_{k}+\cdots +a_{k+t} \\&=2(-1)^k[(k-1)-k+(k+1)-(k+2)\\&\quad +\cdots \pm (k+t-1)]. \end{aligned}$$

If \(t=2s+1\) is odd, the resulting number is \(2(-1)^k[-1-0+1-2+3-\cdots \pm (t-1)]\); here \(-1-0+1-2+3-\cdots \pm (t-1)\) equals \(-s-1\), so that \(S_{k,k+t}=2(-1)^k(-s-1)\), and in the case of even \(t=2s\), one obtains

$$\begin{aligned} 2(-1)^k[k-1+1+\cdots +1]=2(-1)^k(k+s-1)\,. \end{aligned}$$

Since \(-s-1\) and \(k+s-1\) lie in \(\{-(m-1),\ldots ,-2,-1,1,2,\ldots ,(m-1)\}\), the claim follows. \(\square \)

In this way we have settled the first of several cases:

  1. Case 1:

    \(S_{k,k'}\ne 0\) for \(2\le k\le k'\le m\).

    The remaining cases follow easily from the claim:

  2. Case 2:

    \(S_{1,k'}\ne 0\) for \(2\le k'\le m\). This follows from \(S_{1,k'}=1+S_{2,k'}\). By the claim, \(S_{2,k'}\in A\) and \(-1\notin A\).

  3. Case 3:

    \(S_{1,m+1}\ne 0\). This follows because \(S_{1,m+1}=S_{2,m}\), since \(a_{m+1}=-a_{1}\).

  4. Case 4:

    \(S_{1,m+1+k}\ne 0\). In this sum there occur summands \(a,-a\). It is equal to \(S_{2,m-k-1}\).

The other situations are treated similarly. Note, for instance, that \(S_{m+1+k,m+1+k'}=-S_{m+1-k',m+1-k}\) for \(1\le k\le k'\le m-1\), since \(a_{m+1+i}=-a_{m+1-i}\) for \(i=1,\ldots ,m-1\). \(\square \)

A Magic Trick Associated with Sequences with Nontrivial Sums

Recall that in the trick presented at the beginning of this paper, the spectator had visited the cards \(3\rightarrow 2\rightarrow 6\rightarrow 4\rightarrow 5\rightarrow 1\), and from there the next step would lead back to the first card, the three (Figure 1).

Note that these numbers have a surprising property: the spectator began at the three card, but starting at another number would have produced (a translation of) the same walk. For example, starting at four produces the walk \(4\rightarrow 5\rightarrow 1\rightarrow 3\rightarrow 2\rightarrow 6\rightarrow 4\).

Only one card was not turned face up, namely the 7, and a “walk” starting there would be rather boring: \(7\rightarrow 7\rightarrow 7\rightarrow \cdots \).

Phrased in mathematical terms, the situation is as follows. We have the permutation \((b_{0},\ldots ,b_{6})=(7, 2, 4, 6, 1, 3, 5)\) of \({\mathbb {Z}}\hspace{0.2mm}_{7}\), and these numbers give rise to walks in which one progressively steps from i to \(i+b_{i}\). There are, then, two types of walks: one that never leaves \(\{7\}\,(=\{0\})\) and another that visits all points in \(\{1,2,3,4,5,6\}\), regardless of where the walk starts.

The natural generalization to arbitrary n reads as follows:

Definition 3.

Let n be an odd positive integer and \((b_{0},\ldots ,b_{n-1})\) a permutation of \({\mathbb {Z}}\hspace{0.2mm}_{n}\). We say that \((b_{0},\ldots ,b_{n-1})\) has the long walk property (lwp for short) if the following holds: if a walk consists in always stepping from i to \(i+b_{i}\), then there are two types of walks, one that never leaves \(\{i_{0}\}\) (where \(b_{i_{0}}=0\)) and another that visits all points in \(\{i\mid i\ne i_{0}\}\) whenever one starts the walk in this subset.

Just before the preceding definition we introduced \((0,2,4,6,1,3,5)_{7}\), a sequence with the lwp. And here is an example in \(Z_{11}\): \((0,1,2,9,5,3,4,7,10,8,6)_{11}\). As a example of a sequence without lwp, consider \((0,4,3,2,1)_{5}\) in \({\mathbb {Z}}\hspace{0.2mm}_{5}\): all walks end in \(\{0\}\).

In the next proposition we show that lwp sequences and sequences with nontrivial sums are closely related.

Proposition 4.

Let n be an odd positive integer.

  1. (i)

    If \((b_{0},\ldots ,b_{n-1})\) is an lwp sequence, then the translations \((b_{k},b_{k+1},\ldots ,b_{n-1},b_{0},\ldots ,b_{k-1})\) are also lwp sequences for all k.

  2. (ii)

    Every sequence \((a_{1},\ldots ,a_{n-1})\) with nontrivial sums generates an lwp sequence.

  3. (iii)

    Every lwp sequence \((b_{0},b_{1},\ldots ,b_{n-1})\) generates a sequence with nontrivial sums.

Proof.

  1. (i)

    This fact is obvious.

  2. (ii)

    Let \((a_{1},\ldots ,a_{n-1})\) have nontrivial sums. We define the \(b_{i}\) as follows. \(b_{0}:=a_{1}\), \(b_{a_{1}}:=a_{2}\). Then \(b_{a_{1}+a_{2}}:=a_{3}\), and generally, \(b_{a_{1}+\cdots +a_{r}}:=a_{r+1}\) for \(r=0,\ldots ,n-2\). Since the \(a_i\) have nontrivial sums, the \(n-1\) points \(0,a_{1},a_{1}+a_{2},\ldots ,a_{1}+\cdots +a_{n-2}\) for which we have defined the \(b_{i}\) are distinct, so that we have fixed the \(b_{i}\) for \(n-2\) elements in \({\mathbb {Z}}\hspace{0.2mm}_{n}\). Consequently, precisely one \(i_{0}\) is missing, and we put \(b_{i_{0}}:=0\).

    It is routine to show that \((b_{0},\ldots ,b_{n-1})\) has the lwp. For example, a walk that starts at an \(i\ne i_{0}\) will be back at i after \(n-1\) steps, since \(\sum _{i}a_{i}=0\), and that there are no shorter walks is due to the fact that the \(a_i\) have nontrivial sums. As an example, consider \((2,5,3,4,1,7,8,6)_{9}\) in \({\mathbb {Z}}\hspace{0.2mm}_{9}\). This sequence generates the lwp sequence \((2,4,5,6,8,1,7,3,0)_{9}\).

  3. (iii)

    Now we begin with an lwp sequence \((b_{0},\ldots ,b_{n-1})\) in \({\mathbb {Z}}\hspace{0.2mm}_{n}\). Choose any \(i_{1}\) such that \(b_{i_{1}}\ne 0\). We know that the walk that starts at \(i_{1}\) meets \(n-1\) points. Put \(i_{k+1}:=i_{k}+b_{i_{k}}\) for \(k:=1,\ldots ,n-2\) (these are the points that are visited by the walk) and \(a_{k}:=b_{i_{k}}\) for \(k=1,\ldots ,n-1\).

    The \((a_{1},\ldots ,a_{n-1})\) have the following properties:

    • They are different from zero (because the walk starting at \({i_{1}}\) stays in the set \(\{i\mid b_{i}\ne 0\}\)).

    • They are distinct (because the walk visits all elements of the subset \(\{i\mid b_{i}\ne 0\}\) only once).

    • They have nontrivial sums (because all walks starting in \(\{i\mid b_{i}\ne 0\}\) are closed with length \(n-1\)).

    As an illustration consider \((b_{0},\ldots ,b_{8})=(0,2,3,5,7,1,4,6,8)_{9}\) and \(i_{1}:=1\). Then \((a_{1},\ldots ,a_{8})=(2,5,8,6,7,3,1,4)_{9}\).

\(\square \)

Sequences with the lwp fail to have the same permanence properties as sequences with nontrivial sums: \((0,1,2,3,4)_{5}\) has the lwp, but the sequence \(3\cdot (0,1,2,3,4)_{5}=(0,3,1,4,2)_{5}\) and the reverse sequence \((4,3,2,1,0)_{5}\) do not.

A Mathematical Magic Trick

After these preparations we can describe a mathematical magic trick that generalizes the trick we presented above. We first present the basic version of the trick we have in mind; later we will propose several refinements.

Step 1::

Choose an odd positive integer n and a sequence \((a_{1},\ldots ,a_{n-1})_{n}\) with nontrivial sums, and use them to generate an lwp sequence \((b_{0},b_{1},\ldots ,b_{n-1})_{n}\). Here we will illustrate the trick with \(n=7\), \((a_{1},\ldots ,a_{6})_{7}=(2,6,4,5,1,3)_{7}\), and the lwp sequence \((b_{0},\ldots ,b_{6})_{7}=(0,2,4,6,1,3,5)_{7}\).

Step 2::

Prepare a pack of cards with the numbers \(b_{0},b_{1},\ldots ,b_{n-1}\) (in that order, from top to bottom). If you begin with a set of blank cards, you can do this for any value of n, but with playing cards, n can be at most 13 (you can define the values of ace, jack, queen, king as \(1,11,12,13\,(=0)\)).

   Also prepare some mechanism for demonstrating that you knew in advance that the number \(n\,(=0)\) would play a particular role. For example, if you are working with \(n=7\) and have represented the 7 by the seven of diamonds, then write “seven of diamonds” on a sheet of paper and place it beforehand in an envelope on the table. Or prepare a seven of diamonds in another deck of cards as the only card that has been turned face up.

Step 3::

Place the deck of cards \((b_{0},\ldots ,b_{n-1})\) face down on the table. The audience might suspect that the cards have been prepared. (In fact, they have been!) In order to convince them that such is not the case, you should allow several cuts or even operations that look more complicated but also amount to nothing more than cutting the deck (such as false cuts or the Charlier shuffle; the reader is invited to search the internet for sites at which these terms are explained). After any such operations, the order of the deck will have changed by at most a translation of the original order.

Step 4::

Deal the cards one by one clockwise in a circle of n cards and then invite a member of the audience to select one of the cards, which is turned face up.

Case 1::

The card that represents \(n\,(=0)\) has been chosen. You exclaim: “Believe it or not, I knew in advance that you would choose precisely this card!” Then prove your assertion by revealing your prediction in the prepared envelope or deck of cards from step 2 above.

Case 2::

Another card is chosen. This case gives rise to a walk as described at the beginning of this section. Walk clockwise as many steps as the number appearing on the selected card. Turn the card at which you arrive face up and continue walking. There will eventually be \(n-1\) cards lying face up, and you then ask, “One card has refused to be turned face up! Which one could it be?” You turn it face up and then show that it is identical to the card in the prepared envelope or deck from step 2.

Refinements

It has to be emphasized that this is only a basic version. As a magician, you must summon your creativity in order to convince the audience that something truly magical has occurred. After all, the distinguished card survived the “shuffling” process, which surely disturbed the order of the cards!

Here are some concrete proposals for refinements.

  1. 1.

    Let us illustrate our first refinement with the simple sequence (1, 2, 3, 4, 5, 6, 7). If you duplicate it, you obtain (1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7), and this sequence is “7-periodic” in the following sense: for every element in the sequence, the same element occurs if you walk seven steps to the right, where the walk is to be taken cyclically. Note that a 7-periodic sequence has the following properties:

    • Every translation by k elements, e.g., (4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3) in the case \(k=3\), is again 7-periodic.

    • If you remove a total of seven cards, some (possibly zero) from the left end and the remainder from the right end, then the remaining sequence is a translation of the original seven-card sequence.

      For example, if you remove four cards from the left and three from the right, you end up with 5, 6, 7, 1, 2, 3, 4, a translation of (1, 2, 3, 4, 5, 6, 7).

    The truth of these facts is obvious, and it should be clear that one could replace 7 by any n and the simple order of the cards by any other.

    And here is the important consequence for mathematical magic. Suppose that you want to begin your magic trick with a pack of n cards in a certain order \((a_{0},a_{1},\ldots ,a_{n-1})\) such that any translation of this order would also work.

    Then you could begin your trick with 2n cards in the order \(a_{0},a_{1},\ldots ,a_{n-1},a_{0},a_{1},\ldots ,a_{n-1}\). You could then allow this deck to be cut several times by the spectators, and then one of them could remove n cards, some taken from the top and some from the bottom, and further cuts might follow. Your original order will have survived, modulo a possible translation. The trick can begin!

    As an example, suppose that we want to work with seven cards and the lwp sequence (4, 6, 1, 3, 5, 7, 2). We prepare a deck like the one in the top row of Figure 4. Note that when the cards are turned face down, as shown in the bottom row, the four of diamonds will be the top card, as required for our lwp sequence.

    As an example, suppose that we want to work with seven cards and the lwp sequence \((4,6,1,3,5,7,2)_{7}\). Then prepare a deck like the first one in Figure 4. (If you like, you may turn the deck face up, fan it out, and display it briefly to the audience. But take care that nobody notices that it is only the seven that has both cards of the same suit, here spades. That is because one of them will later be the distinguished card, which will be identified by both number and suit.)

    Figure 4.
    figure 4

    A “walk” on a circle of seven cards.

    Now seven cards can be removed from the left and/or right, some cuts can be allowed, and then the presentation can begin.

  2. 2.

    In \({\mathbb {Z}}\hspace{0.2mm}_{n}\) one has \(k=k+n\) for every k. So if you are representing numbers by cards, you may replace a card k by its equivalent \(k+n\). For example, if you are working with \(n=7\), you could replace here and there an ace, a two, or a three by respectively an eight, nine, or ten.

  3. 3.

    You can “personalize” the trick. In our example in which the seven of spades is the distinguished card, you could write something with special meaning on it, such as “Happy birthday!” if your presentation is at a birthday party. Needless to say, any such writing must not be visible when you fan out the cards.

Important note: The order of the cards is crucial. If, for example, you are working with the lwp sequence \((2,4,5,6,8,1,7,3,0)_{9}\) and the deck is shown face down, then it is absolutely necessary that the card after the two be the four. Were they to lie the other way round, the trick would not work. It is also important that everything happen clockwise, both in dealing the cards to obtain a circle and in taking the walk determined by a spectator’s choice of card. (To be sure, both actions could be changed to counterclockwise, but you must not mix the two.)

Concluding Remarks

  1. 1.

    Some time ago, a member of my magic circle presented a trick with seven cards that he found in the book Fast von selbst (Almost by itself), by Werner Miller [14]. The trick works because (0, 2, 4, 6, 1, 3, 5) has the lwp, and it was natural to ask whether there were other lwp sequences and whether one could present a similar trick with a different number of cards. It was those questions that motivated the present investigations.

  2. 2.

    Why did we restrict ourselves to odd n? Since we had in mind the application of our results to a magic trick, it was necessary to generate from \((a_{1},\ldots ,a_{n-1})\) an lwp sequence \((b_{0},\ldots ,b_{n-1})\), and that works only if \(\sum _{i=1}^{n-1}i=0\), i.e., if n is odd.

  3. 3.

    If one tries to find \((a_{1},\ldots ,a_{n-1})\) in \({\mathbb {Z}}\hspace{0.2mm}_{n}\) with nontrivial sums, one could proceed as follows:

    • Begin with any \(a_{1}\ne 0\).

    • If you have already constructed \(a_{1},\ldots ,a_{k}\), determine \(a_{k+1}\), as follows: In order to have the nontrivial sum condition satisfied, one has to guarantee that \(a_{k+1}\) is different from \(a_{1},\ldots ,a_{k}\) and that \(a_{j}+\cdots +a_{k}+a_{k+1}\ne 0\) for all \(j=1,\ldots ,k\). In other words, \(a_{k+1}\) must not be in

      $$\begin{aligned}{} & {} T_{a_{1},\ldots ,a_{k}}:=\{a_{1},\ldots ,a_{k}\} \\{} & {} \quad \cup \{-(a_{j}+\cdots +a_{k}) \mid j=1,\ldots ,k\}. \end{aligned}$$

      This will be easy for small k, but it nearly always happens that the “taboo set” \(T_{a_{1},\ldots ,a_{k}}\) is all of \(\{1,\ldots ,n-1\}\) for some \(k<n-2\). Note that this set contains at least \((a_{1},\ldots ,a_{k})\) and possibly k further elements, so that it tends to be “too big” when \(k>n/2\). Then this approach leads to a dead end.

    The main idea in the proof of Proposition 2 is to choose the \(a_{i}\) such that \(T_{a_{1},\ldots ,a_{k}}\) grows slowly as k approaches n/2, and it helps when these numbers contain as may pairs as possible of the form \(a,-a\). In fact, it was extensive computer experiments that led to the construction in the proof of the proposition.

  4. 4.

    Computer experiments show that there are sequences with nontrivial sums that are not of the form of the example in Proposition 2 or derived from that example by inversion, translation, or multiplication by an invertible element. In fact, for \(n\le 7\), all examples have this form, but already for \(n=9\) there are further sequences with nontrivial sums, for example \((1,3,7,5,8,6,2,4)_{9}\), which is not constructed from \((1,2,-4,6,-1,-6,4,-2)_{9}\), since there are no \(a_{i}\) such that \(a_{i+1}=-a_{i-1}\).

    Nevertheless, the proportion of sequences with nontrivial sums among the permutations of \(1,2,\ldots ,n-1\) becomes smaller and smaller with increasing n: about 2/100 for \(n=7\), 2/1000 for \(n=9\), and 2/10000 for \(n=11\).

  5. 5.

    It would be interesting to find recipes for finding sequences with nontrivial sums other than that used in the proof of Proposition 2.

  6. 6.

    If one weakens the requirement that the \((a_{1},\ldots ,a_{n-1})\) exhaust \(\{1,\ldots ,n-1\}\), then it is rather easy to find examples with \(\sum _{i=k}^{k'}a_{i}\ne 0\) for \((k,k')\ne (1,n-1)\) and \(\sum _{i=1}^{n-1}a_{i}=0\), also for even n. One simply can take \((1,1,\ldots ,1,1,2)_{n}\) (with the lwp sequence \((0,1,\ldots ,1,2)_{n}\)), but more complicated examples can also easily be found, for example \((4,3,2,5,4)_{6}\) (with 0, 4, 2, 4, 5, 3 as the associated lwp sequence). Such sequences can also be used for our magic trick.