Any rectangular shape on a calculator numpad when divided by 11 gives an integer. Why?

Since you are concerned only with rectangular patterns, you have four digit numbers in a certain base $l$, and you want to check divisibility by $11$, where $11 = l+1$.


When you have a four digit number in base $l$, write it as $al^3 + bl^2 + cl + d$, where $0 \leq a,b,c,d < l$. (This represents the $l$-base number $\overline{abcd}$). Now, we have a cute fact : $l^3 + 1$ is a multiple of $l+1$, since $l^3+1 = (l^2 - l + 1)(l+1)$. Furthermore, $l^2 - 1 = (l-1)(l+1)$. Therefore, we make the following rewrite : $$ al^3 + bl^2 + cl + d = a(l^3 + 1) + b(l^2 - 1) + c(l+1) - (a - b + c - d) \\ = (l+1)(...) + ((b+d)-(a+c)) $$

where $l+1 = 11$ in base $l$.

Therefore, the remainder when $\overline{abcd}$ is divided by $11$ is $(b+d) - (a+c)$.


When you consider four numbers ($1 \to 9$, since I found problems in the letters for hex) in a rectangle and form a four digit number out of them now, can you see why this number $(b+d) - (a+c)$ is in fact zero, therefore giving your desired result?


Now that we have pointed out this rectangular pattern, I noted above that some counterexamples did exist for the MS - layout of hexadecimal numbers. The issue there was a fairly simple one : the "matrix" of entries did not satisfy the property that $a+d = b+c$ for $a,b,c,d$ going CW/CCW around any $2\times 2$ subrectangle of entries of the matrix.

If $l-1$ is not a prime, then we can actually arrange a "matrix" of $l$ entries which is not strictly column or row, but satisfies this "rectangle property" as we can call it. For this, write $l-1 = ab$ where $a,b \neq 1$, and arrange an $a \times b$ matrix of entries, which we fill in the following fashion : start with $1$ in the bottom corner, proceed towards right filling $2,3,...$ until you hit the end, then return to the left of the row above, and fill the next number, now repeat till you fill the whole matrix.

For $10$, this procedure yields the conventional keyboard pattern. For $15 = 5 \times 3$, it would yield $$ \begin{pmatrix} B&C &D & E& F\\ 6&7&8&9&A\\ 1&2&3&4&5 \\ \end{pmatrix} $$

which indeed will satisfy the property that any rectangle has $11$ in that base as a divisor. For example, $A8DF$, $1496$ and $CE97$ are all multiples of $11$.

Note that more is true : in fact, every parallellogram , read CW or CCW, leads to a multiple of eleven.


Start at the degenerate rectangle 1111, a multiple of 11.

Each time you move a side of your rectangle by one step in one of the 4 directions (leaving the other side in place), you add or remove one of these numbers (leading zeroes added for clarity):

  • 0011 (horizontally) or 0033 (vertically)
  • 0110 (horz.) or 0330 (vert.)
  • 1100 or 3300
  • 1001 or 3003

which are all multiples of 11 (obviously for the first three lines; 1001 = 11 * 91).

Adding such a number preserves being a multiple of 11.

This way from the degenerate rectangle 1111 you can reach any other rectangle (aligned to the numpad orientation), which prove they're all multiple of 11.


Let's denote:

  • $d_1$: the left-bottom digit of such a rectangle
  • $h$: the horizontal distance (difference) to the next digit to the right
  • $v$: the vertical distance (difference) to the digit above $d_1$

Then, the entered number $n$ starting at bottom-left going counterclockwise has the digits $$n = d_1d_2d_3d_4$$

with

  • $d_2 = d_1 + h$
  • $d_3 = d_1 + h + v$
  • $d_4 = d_1 + v$

Now, we use the fact that an integer is divisible by $11$ ($n \equiv 0 \mbox{ mod } 11$) if and only if it's alternating digit sum is equal to $0$: $$d_1 - (d_1+h) + (d_1+h+v) - (d_1+v) = 0 \Rightarrow n \equiv 0 \mbox{ mod } 11$$

Note that the alternating digit sum does not change with cyclic permutations of the digits or with reverting the order of the digits (which means going clockwise along the rectangle on the number pad).