Math Lab
Home/Class VIII/Ch 5/Digit puzzles

Digit puzzles

Mathematicians have always loved playful puzzles where the only rules are arithmetic. Many of these puzzles look mysterious until you peek behind the curtain , then they become beautiful patterns. Some are over 40004000 years old.

Concept

Magic squares. A magic square is a square grid filled with numbers so that every row, every column, and both diagonals add to the same total , the magic sum. The most famous is the 3×33 \times 3 Lo-Shu square:

276951438\begin{array}{|c|c|c|}\hline 2 & 7 & 6 \\ \hline 9 & 5 & 1 \\ \hline 4 & 3 & 8 \\ \hline\end{array}

Every row, column, and diagonal sums to 1515. The numbers 11-99 each appear exactly once. A medieval Indian magic square attributed to Khajuraho temples uses the numbers 11-1616 on a 4×44 \times 4 grid with magic sum 3434.

General formula. A magic square using 1,2,,n21, 2, \dots, n^2 has magic sum n(n2+1)2\dfrac{n(n^2+1)}{2}. For n=3n = 3 this gives 3102=15\dfrac{3 \cdot 10}{2} = 15. For n=4n = 4, 4172=34\dfrac{4 \cdot 17}{2} = 34. For n=5n = 5, 6565.

Palindromic numbers. A palindrome reads the same forwards and backwards: 121,9999,12321121, 9999, 12321. Multiplying small palindromes can give larger palindromes: 11×11=12111 \times 11 = 121, 11×11×11=133111 \times 11 \times 11 = 1331, 11×11×11×11=1464111 \times 11 \times 11 \times 11 = 14641. Up to 11411^4 the pattern (rows of Pascal's triangle) gives palindromes.

Cyclic numbers. The decimal expansion of 17=0.142857\tfrac{1}{7} = 0.\overline{142857} has a remarkable property:

1×142857=142857,2×142857=285714,3×142857=428571,1 \times 142857 = 142857, \quad 2 \times 142857 = 285714, \quad 3 \times 142857 = 428571, 4×142857=571428,5×142857=714285,6×142857=857142.4 \times 142857 = 571428, \quad 5 \times 142857 = 714285, \quad 6 \times 142857 = 857142.

Every product is a cyclic rotation of the digits 1,4,2,8,5,71, 4, 2, 8, 5, 7. And 7×142857=9999997 \times 142857 = 999999.

Digit-sum tricks. Pick any number, say 173173. Reverse: 371371. Subtract the smaller from the larger: 371173=198371 - 173 = 198. Now 1+9+8=181 + 9 + 8 = 18, and 1+8=91+8 = 9. Try any starting number , you always end up at 99 (or 00 if the digits are equal). Why? Because the difference of a number and its reverse is a multiple of 99.

10891089 trick. Pick any 33-digit number whose first and last digits differ by at least 22. Reverse it. Subtract smaller from larger. Reverse the result and add. You always get 10891089. Try 321321:

321123=198;198+891=1089.321 - 123 = 198; \quad 198 + 891 = 1089.

This works for the same digit-sum reason but with two reversals.

Worked examples

Example 1. Find the missing entries in this 3×33 \times 3 magic square (magic sum 1515):

8?6?5?4?2\begin{array}{|c|c|c|}\hline 8 & ? & 6 \\ \hline ? & 5 & ? \\ \hline 4 & ? & 2 \\ \hline\end{array}

  • Top middle: 1586=115 - 8 - 6 = 1.
  • Bottom middle: 1542=915 - 4 - 2 = 9.
  • Middle left: 1584=315 - 8 - 4 = 3.
  • Middle right: 1562=715 - 6 - 2 = 7.

Example 2. Verify 9×142857=?9 \times 142857 = ? does NOT have a simple cyclic pattern.

  • 9×142857=1,285,7139 \times 142857 = 1{,}285{,}713.
  • 77 digits , no longer fits the 66-digit cycle (because 9>79 > 7, you have crossed beyond the 7×142857=9999997 \times 142857 = 999999 boundary).

Example 3. Try the 10891089 trick on 592592.

  • 592295=297592 - 295 = 297. (Yes, 592592 minus its reverse, 295295.)
  • Reverse 297=792297 = 792.
  • 297+792=1089297 + 792 = 1089. ✓

Example 4. A magic square's magic sum is 3434. If the numbers are 11-1616, this is a 4×44 \times 4. Find the diagonal sum if one diagonal is 1,6,11,161, 6, 11, 16.

  • 1+6+11+16=341 + 6 + 11 + 16 = 34. ✓

Try it yourself

  1. Complete this 3×33 \times 3 magic square with magic sum 1515: only 22, 77, 66 in top row, 44, _,8\_, 8 in bottom row.
  2. Compute 11511^5. Is it a palindrome?
  3. Verify 4×1428574 \times 142857 is a cyclic rotation of 142857142857.
  4. Try the 10891089 trick on three different 33-digit numbers and check.
  5. The magic sum of a 4×44 \times 4 magic square using 11-1616 is 3434. Show your reasoning.
  6. Show that the difference of any 33-digit number and its reverse is a multiple of 9999.
  7. Find a 44-digit palindrome divisible by 77.
  8. List all 33-digit palindromes divisible by 1111. (Hint: every 33-digit palindrome has form abaaba.)

Activity

Make your own magic. Try to build a 4×44 \times 4 magic square using the numbers 11 through 1616. There are several known constructions , one famous one is Albrecht Durer's square from the engraving Melencolia I (15141514). Look it up online; the bottom row even contains the year 15141514. Once built, verify that all rows, columns, both diagonals, and even the four corners sum to 3434.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Digit puzzles
5 questions · pick the best answer
Q1

Magic sum of 3×33 \times 3 magic square with 11-99

Q2

114=?11^4 = ?

Q3

2×142857=?2 \times 142857 = ?

Q4

Starting with 592592, the 10891089 trick gives

Q5

Magic sum of 4×44 \times 4 magic square with 11-1616