# The death prism

One day, you are caught by a evil wizard. He presents you with a prism, and says, "You can ask me to turn this prism to any $$n$$-angled right prism. Then you shall fill in $$1$$ to $$3n$$ with no repetition on each edge of the prism such that the edges that surround each face should have a same sum. If you think there is no such way, tell me the reason. If you are wrong, you will be my crocodile's dinner! But if you get this correct, you will be freed."

What should you do?

This question is not original, and I rephrased it (a lot).

First, a divisibility condition for $$n$$.

Denote the shared sum to be $$S$$. Then by considering all $$n+2$$ sides of the prism, we get the following equality: $$S(n+2)=(3n)(3n+1)$$, as each side is counted in exactly two face sums. We can divide the RHS by $$n+2$$ as follows: $$S(n+2)=9n^2+3n=9n^2+18n-15n=9n(n+2)-15n-30+30=(9n-15)(n+2)+30$$.
Since $$9n-15$$ is an integer, it follows that $$n+2$$ divides $$30$$.

We now derive a bound.

Consider the $$2n$$ smallest numbers in $${1,2,\dots,3n}$$. They sum to $$n(2n+1)$$. This is a minimum bound for $$2S$$. Likewise the $$2n$$ largest numbers, summing to $$n(4n+1)$$, is an upper bound. We can relax our bounds slightly to $$\frac{n(2n+2/3)}{2}. This will make calculations a bit nicer.

We can now plug it into our first equality:

This gives $$\frac{n(2n+2/3)(n+2)}{2}<(3n)(3n+1) \rightarrow (n+2)<9 \rightarrow n<7$$ and $$\frac{n(4n+4/3)(n+2)}{2}>(3n)(3n+1) \rightarrow (n+2)>\frac{9}{2} \rightarrow n>2.5$$.
$$n = 5,6$$ are ruled out from the earlier divisible condition. Thus we can narrow down our possibilities to $$n = 3,4$$. This corresponds to sums $$S = 18, 26$$ respectively.

Now it gets somewhat messy.

Let's deal with $$n = 3$$ first. The graph looks like this: We do have one more tool that we can use: the parity of numbers. Since our target sum is $$18$$, it follows that every face must border an even number of odd numbers. We have to place 5 odd numbers. Is it possible for one of the triangles to not contain an odd number? If so, 5 of the remaining 6 edges are odd, and in particular, the other triangle contains one even number. So we have this: 2 of the square faces contain 3 odd edges so this is bad. Therefore both triangles contain 2 odd numbers. There are effectively two configurations that this can happen. If their even edge go to the same square face, then everything cancels out, which is bad because we still need to place one more odd edge. Otherwise, it does work out because the net result is that two square faces have an odd number of edges, where we can place the last odd number. Therefore this is the configuration: Now that we have this condition:

We need to determine all possible triples of triangles that sum up to $$18$$, with the stipulation that every triple contains two odd numbers. Here they are: $$(1,8,9),(3,7,8),(3,6,9),(5,6,7),(4,5,9),(2,7,9)$$. Two of these triples cannot work with any other triple as they share a number with every other triple: $$(3,6,9), (2,7,9)$$. The others form two possible pairs: $$(1,8,9),(5,6,7)$$ and $$(3,7,8),(4,5,9)$$.
Both cases fizzle out quickly. Therefore, we can conclude that $$n=3$$ is invalid.  Ok, let's do $$n=4$$ now.

This turns out to be an already solved problem. Therefore the only valid solution is $$n=4$$, and you can pick any of the solutions in the link provided.

Let's say you turn this prism to $$n$$-angled prism, one $$n$$-gon face has edges filled by $$a_1, a_2, \cdots, a_n$$; the other $$n$$-gon face has edges filled by $$c_1, c_2, \cdots, c_n$$; then the rectangle face consists of edges $$a_i$$ and $$c_i$$ also has edges $$b_i$$ and $$b_{i+1}$$ (with $$b_{n+1}$$ is defined as $$b_1$$).

Let's say each face should have a same sum which is $$s$$.

Now, we have:

$$a_1 + a_2 + \cdots + a_n = c_1 + c_2 + \cdots + c_n = s$$

Also we have:

$$a_1 + c_1 + b_1 + b_2 = \cdots = a_n + c_n + b_n + b_1 = s$$

Can we find $$b_1 + b_2 + \cdots + b_n$$?

Let: $$b_1 + b_2 + \cdots + b_n = t$$ Because all $$a$$'s, $$b$$'s, and $$c$$'s are integers from $$1$$ to $$3n$$, thus: $$(a_1 + a_2 + \cdots + a_n) + (b_1 + b_2 + \cdots + b_n) + (c_1 + c_2 + \cdots + c_n) = \frac{3n(3n+1)}{2}$$ $$s + t + s = \frac{3n(3n+1)}{2}$$ $$t = \frac{9n^2+3n}{2} - 2s$$

Now, what if we go back one step.

If we double the sum of $$b$$'s we will have: $$2b_1 + 2b_2 + \cdots + 2b_n = 2t$$ $$(b_1 + b_2) + (b_2 + b_3) + \cdots + (b_n + b_1) = 2t$$ $$(s - a_1 - c_1) + (s - a_2 - c_2) + \cdots + (s - a_n - c_n) = 2t$$ $$sn - (a_1 + a_2 + \cdots + a_n) - (c_1 + c_2 + \cdots + c_n) = 2t$$ $$sn - 2s = 2t$$ We know the $$t$$ here, so: $$sn - 2s = 9n^2 + 3n - 4s$$ $$9n^2 + (3-s)n - 2s = 0$$

So, what's next?

Using abc-formula: $$n = \frac{-(3-s) \pm \sqrt{(3-s)^2-4\cdot9\cdot(2s)}}{2\cdot9}$$ $$n = \frac{s-3 \pm \sqrt{s^2-6s+9-72s}}{18}$$ $$n = \frac{s-3 \pm \sqrt{s^2-80s+9}}{18}$$

From here, because $$n$$ must be an integer, thus:

$$\sqrt{s^2-80s+9}$$ must be an integer. I have to admit I use WolframAlpha here, that the integer solutions are only when: $$s \in \{-756,0,80,836\}$$

Of course, $$s$$ be a positive integer, therefore:

If we put $$s = 80$$, we have $$n = \frac{80-3 \pm \sqrt{80^2-80\cdot80+9}}{18}$$ $$n = \frac{77 \pm 3}{18}$$ Here, $$n$$ is not an integer in either cases. If we put $$s = 836$$ instead: $$n = \frac{836-3 \pm \sqrt{836^2-80\cdot836+9}}{18}$$ $$n = \frac{833 \pm 795}{18}$$ here, also $$n$$ is not an integer in either cases.

Finally:

We have shown that there is no such possible $$n$$.

• Oof, thanks for reviewing this @humn ! >< phenomist got the correct answer, nevertheless! – athin Apr 29 '20 at 21:05

Partial solution

We have n+2 sums all adding up to the same sum, suppose this is s.

Add all the sums together to get (n+2)s. This means each edge has been counted exactly twice.

(n+2)s = (1+2+..3n)*2 = 3n(n+1)

s = 3n(n+1)/(n+2) < 3n

Now we need two sums of n distinct numbers that both add up to s. Add both sums. Let's take the first 2n numbers, this is gives a lower limit on s.

2s ≥ (1+2+..2n)

s ≥ n(n+1)/4

Combining these gives n≤10

We also need n sums of 4 numbers each, all of which add up to s. These 4n numbers are basically the numbers 1 through 3n, with n repeats. Add the n sums. We get an upper bound by assuming the repeats are exactly 2n+1 through 3n.

ns ≤ (1+...2n) + 2(2n+1 + .. 3n) = 2(1+...3n) - (1+..2n) = 3n(3n+1) - n(2n+1)

s ≤ 3(3n+1) - (2n+1) = 7n + 2

(Useless condition)

• Combining these limits with @athin's approach seems to reduce n to just 3 possibilities, the first of which is quickly eliminated by hand. – humn Apr 29 '20 at 15:50