Lambdia

Nine Digits, Four Windows, and a Middle That Cannot Move

Nine slots hold the digits 1 to 9 and four overlapping windows each add to 20. One subtraction pins the centre digit to 5 with no search at all, and the same structure classifies every arrangement: there are 96 of them, falling into 48 mirror pairs. Change the target and the centre is forced to an odd digit that sometimes admits nothing.

Nine slots sit in a row. Into them go the digits 1 through 9, each used exactly once. Four windows of consecutive slots are marked on the row, and every window has to add up to 20: slots 1 to 4, slots 2 to 6, slots 4 to 8, and slots 6 to 9. The usual phrasing then asks what the values are.

There are 96 answers. That is the first thing worth saying, because the phrasing invites you to hunt for the arrangement, and hunting is the wrong move. Swap two digits, recheck four sums, swap again. It works eventually and it teaches nothing. The four conditions do not pin down a row. They pin down a skeleton, and one slot inside that skeleton is nailed to a single value in all 96 cases. Finding that slot takes one subtraction and no search whatsoever.

Two windows that miss the middle

Write s1,,s9s_1, \dots, s_9 for the digits in the nine slots. The conditions are

s1+s2+s3+s4=20s2+s3+s4+s5+s6=20s4+s5+s6+s7+s8=20s6+s7+s8+s9=20\begin{aligned} s_1 + s_2 + s_3 + s_4 &= 20 \\ s_2 + s_3 + s_4 + s_5 + s_6 &= 20 \\ s_4 + s_5 + s_6 + s_7 + s_8 &= 20 \\ s_6 + s_7 + s_8 + s_9 &= 20 \end{aligned}
(1)

Now look only at the first window and the last one. Slots 1 to 4, and slots 6 to 9. They share no slot at all, and between them they cover eight of the nine positions. The one position they both miss is slot 5. Because they are disjoint, adding their two equations counts eight distinct digits once each, with nothing double counted:

(s1+s2+s3+s4)+(s6+s7+s8+s9)=20+20=40(s_1 + s_2 + s_3 + s_4) + (s_6 + s_7 + s_8 + s_9) = 20 + 20 = 40
(2)

The nine digits together add to 45, the ninth triangular number. Slot 5 is whatever is left over:

s5=4540=5s_5 = 45 - 40 = 5
(3)

That is the entire argument for the middle digit. No case analysis, no trial, and no appeal to the two inner windows. It is forced rather than merely consistent, which is a distinction worth being pedantic about: the derivation used only the two window sums and the fact that each digit appears once, so nothing else could have gone there.

The choice of windows is doing real work. Try the same trick on the two inner windows, slots 2 to 6 against slots 4 to 8. They overlap in slots 4, 5 and 6, so adding them triple counts three digits and the resulting 40 tells you nothing about anything. Disjointness is the load bearing property, and among the four windows there is exactly one disjoint pair.

Fig. 1 — The first and last windows share nothing and cover everything but the centre, so 45 minus their combined 40 lands on slot 5.

Subtracting neighbours

Two more relations fall out of the overlaps, and they are what turn one forced digit into a complete classification. The second window contains the first one minus slot 1 plus slots 5 and 6, so subtract them:

(s2+s3+s4+s5+s6)(s1+s2+s3+s4)=0    s1=s5+s6(s_2 + s_3 + s_4 + s_5 + s_6) - (s_1 + s_2 + s_3 + s_4) = 0 \;\Longrightarrow\; s_1 = s_5 + s_6
(4)

The shared block s2+s3+s4s_2 + s_3 + s_4 cancels, which is the only reason this is painless. Substituting the value we already have for the middle:

s1=s6+5and, by the mirror subtraction,s9=s4+5s_1 = s_6 + 5 \qquad\text{and, by the mirror subtraction,}\qquad s_9 = s_4 + 5
(5)

The second half of that comes from doing the same thing at the far end, third window minus fourth window, which cancels s6+s7+s8s_6 + s_7 + s_8 and leaves s9=s4+s5s_9 = s_4 + s_5.

Both relations immediately constrain the digits. Since s19s_1 \le 9 we get s64s_6 \le 4, and the same bound applies to s4s_4. Neither can be 5, because slot 5 has taken it. And they cannot be equal to each other, since s4=s6s_4 = s_6 would force s1=s9s_1 = s_9, which no permutation allows.

The skeleton

Write e=s4e = s_4 and f=s6f = s_6. Every solution has s5=5s_5 = 5, has ee and ff distinct in {1,2,3,4}\{1,2,3,4\}, and has its two end digits determined by them: s1=f+5s_1 = f + 5 and s9=e+5s_9 = e + 5. Only slots 2, 3, 7 and 8 are still free, and they hold the four digits nobody has claimed.

Every solution at once

Choosing the ordered pair (e,f)(e, f) is 4 times 3, so twelve ways. That choice fixes five of the nine slots. The four digits still unplaced are interesting: the large digits are 6,7,8,96, 7, 8, 9, which is exactly 1+51{+}5 through 4+54{+}5, and two of them have been used as f+5f+5 and e+5e+5. So if cc and dd are the two small digits left over, the leftovers are precisely c,d,c+5,d+5c,\, d,\, c+5,\, d+5.

The first window now reads s2+s3=20s1s4=15efs_2 + s_3 = 20 - s_1 - s_4 = 15 - e - f, and the last window gives the same number for s7+s8s_7 + s_8. The two free pairs must therefore carry equal sums:

s2+s3  =  s7+s8  =  15ef  =  c+d+5s_2 + s_3 \;=\; s_7 + s_8 \;=\; 15 - e - f \;=\; c + d + 5
(6)

The last equality holds because e+f+c+d=1+2+3+4=10e + f + c + d = 1+2+3+4 = 10. So the question reduces to splitting four known digits into two pairs of equal sum. There are three ways to cut four things into two pairs, and only one of them can ever work:

{c,d}{c+5,d+5}differ by 10{c,c+5}{d,d+5}differ by 2(cd){c,d+5}{d,c+5}both c+d+5\underbrace{\{c,d\} \mid \{c{+}5,d{+}5\}}_{\text{differ by }10} \qquad \underbrace{\{c,c{+}5\} \mid \{d,d{+}5\}}_{\text{differ by }2(c-d)} \qquad \underbrace{\{c,d{+}5\} \mid \{d,c{+}5\}}_{\text{both } c+d+5}
(7)

The first split is off by 10 and the second by 2(cd)02(c-d) \ne 0, so the balanced split is unique and it never depends on which digits happened to be left. That is a small thing but it is the reason the count is clean. Two decisions remain: which balanced pair goes on the left, and the order inside each pair. Eight fillings per choice of (e,f)(e,f), so

12×8=9612 \times 8 = 96
(8)

The inner windows never needed checking. Substituting s5=5s_5 = 5 and s2+s3=15efs_2 + s_3 = 15 - e - f into the second window gives (15ef)+e+5+f=20(15 - e - f) + e + 5 + f = 20 identically, and the third window collapses the same way. Four conditions that look independent behave like the first and the last plus the two subtraction relations, which is why the solution set is as large as it is.

Fig. 2 — Five slots are determined by the ordered pair (e, f), and the two dashed pairs must carry the same sum. Twelve choices, eight fillings each.

The row that usually gets quoted as the answer, 6 8 4 2 5 1 3 9 7, is one of the 96 and it sits in the skeleton exactly where it should: e=2e = 2 and f=1f = 1, so s1=6s_1 = 6 and s9=7s_9 = 7, and the leftovers 3, 4, 8, 9 balance as 4 plus 8 on the left against 3 plus 9 on the right. All four windows check out at 6+8+4+26{+}8{+}4{+}2, 8+4+2+5+18{+}4{+}2{+}5{+}1, 2+5+1+3+92{+}5{+}1{+}3{+}9 and 1+3+9+71{+}3{+}9{+}7. Handing that row over as the answer is not wrong so much as incomplete, and the honest reply names the invariant instead: the middle is 5, and there are 96 ways to dress it.

The mirror

Reversing the row sends slot ii to slot 10i10-i. Watch what that does to the windows: slots 1 to 4 becomes slots 6 to 9, and slots 2 to 6 becomes slots 4 to 8. The set of four conditions is unchanged, so reversal permutes the solutions among themselves. In skeleton terms it swaps ee and ff.

Since efe \ne f always, no solution can equal its own reversal. A palindromic arrangement would need s4=s6s_4 = s_6, and we ruled that out three paragraphs ago. So reversal is an involution with no fixed points, and the 96 solutions fall into 48 mirror pairs. The count being even is structural rather than accidental. Reversing the quoted row gives 7 9 3 1 5 2 4 8 6, which is a different solution with the same 5 in the middle.

Other targets, and where the argument stops

Nothing in the disjoint cover step cared that the target was 20. Replace it by a general TT and the same subtraction gives

s5=452Ts_5 = 45 - 2T
(9)

which is always odd. Whatever target you pick, the centre digit can never be even. For it to be a digit at all we need 1452T91 \le 45 - 2T \le 9, so TT is confined to 18, 19, 20, 21, 22 and every other target makes the system empty on sight.

Inside that window the behaviour is uneven. At T=18T = 18 the forced middle is 9, a perfectly legal digit, and yet nothing works: relation (4) reads s1=9+s610s_1 = 9 + s_6 \ge 10, which no digit can satisfy. A value being forced and being achievable are separate questions, and this is the cleanest place to see the gap. The four surviving targets give 16, 96, 16 and 112 solutions with middles 7, 5, 3 and 1, so the symmetry of the counts around T=20T = 20 that you might expect is simply not there.

Fig. 3 — Solution counts against the target. The forced centre digit runs 9, 7, 5, 3, 1, and the counts do not follow it.

What carries over from this puzzle is the reasoning rather than the number. When someone hands you a pile of overlapping constraints, the useful first move is to look for a pair that does not overlap, because such a pair adds without double counting and a forced value tends to be hiding in the remainder. Everything else here, the twelve ordered choices and the eight fillings and the 48 mirror pairs, followed from one subtraction that took less time than checking a single candidate row.

Sources and further reading

Every count above was produced twice. Once by the classification in this article, which builds each solution from an ordered pair and a balanced split, and once by walking all 362,880 orderings of the nine digits and testing the four window sums directly. The two sets agree exactly: 96 solutions, and a 5 in the middle of every one.

Comments · 0

Be the first to comment.