Problem of the Month (September 1999)

In linear algebra, a square matrix has an equal number of rows and columns. This month, we use a different definition. A matrix is called square if each each entry is a digit, and reading across each row and down each column gives a square number. For example,

841
196

is a square matrix since 841, 196, 81, 49, and 16 are all square integers. Leading zeroes are not allowed. Not all the squares produced have to be different.

How many square m x n matrices are there? Are there square matrices of all sizes? Are there infinitely many? What is the largest square matrix you can find?


ANSWERS

Ulrich Schimke found all of the matrices below, though his program had a bug in it the first time around. He found 1584 square matrices in all. He proved that the second-to-last digit in a 1 × n square matrix is a 4. He also gives a heuristic probability argument why there are only finitely many 1 × n square matrices.

Andrew Bayly found most of the matrices below. He also noted that the search is simplified somewhat by the fact that squares only end in 0, 1, 4, 5, 6, or 9. He also found several square matrices with leading zeroes.

Joseph DeVincentis found the 1 × n and 2 × n square matrices up to n=5, and all the 3 × 3 ones. He also gave an efficient algorithm to find 2 × n matrices, using the fact that the top row completely determines the bottom row.

Brendan Owen claims that there are no square 2 × 10 matrices. All the others gave some sizes with no square matrices (like 4 × 2).

Bayly and Schimke noted that any of the 1 × n square matrices of odd length can be turned into an n x n square matrix by adding lots of zeroes in the bottom right hand corner. The largest known square matrix (21 × 21) is of this form, with first row and column 444411911999914911441 and all the rest zeroes.


The 1 × n square matrices are squares where every digit is a non-zero square. This sequence: 1, 4, 9, 49, 144, 441, 1444, 11449, 44944, 991494144, 4914991449, 149991994944, 9141411449911441, 199499144494999441, 9914419419914449449, 444411911999914911441, 419994999149149944149149944191494441 (the last one known) is sequence A006716 of the Encyclopedia of Integer Sequences.

The 2 × n matrices found so far are:

16
64
36
64
64
49
81
16
841
196
11236
66564

The 3 × n matrices found so far are:

121
256
169
121
289
196
144
400
400
144
484
441
169
676
961
361
676
169
441
400
100
441
484
144
529
256
961

729
256
961
841
400
100
841
484
144
961
676
169
544644
200704
900601
1127844
2958400
1664100
5234944
2560000
9610000

The 4 × n matrices found so far are:

1296
2025
9216
6561
1369
3844
6400
9409
2116
1225
1296
6561
2116
1764
1600
6400
2916
9025
1296
6561
3136
1764
3600
6400
3364
3249
6400
4900
3721
7056
2500
1600

7396
3025
9216
6561
7921
9801
2025
1156
8281
2116
8100
1600
8281
2916
8100
1600
8836
8464
3600
6400
9216
2025
1296
6561
17161
23104
29584
56644
5331481
4605316
7022500
6051600

There are too many 5 × 5's and 6 × 6's to list, but here are the 5 × 6 square matrices:

191844
144400
624100
640000
490000
289444
960400
940900
230400
960400
385641
628849
495616
846400
144400

All of the n × n square matrices found so far are symmetric about the main diagonal. Are there any that are not symmetric? There answer is yes if we allow leading zeroes, such as this one found by Andrew Bayly:

8100
2401
8464
1444

He and Ulrich Schimke also found this 5 × 5 square matrix with the amazing properties that the diagonals are also squares, and all the squares are palindromes:

14641
44944
69696
44944
14641

Schimke defined two square matrices to be twins if they differ in only one entry. He found the 4 pairs of twins below, plus 6 larger pairs. Are there any more?

529
256
961
729
256
961
8281
2116
8100
1600
8281
2916
8100
1600
195364
986049
561001
300304
640000
491401
195364
986049
564001
300304
640000
491401
167281
600625
702244
262144
824464
154449
167281
680625
702244
262144
824464
154449

Here are the number of different square matrices of different sizes:

Number of m × n Square Matrices

m \ n12345678910 1112
1312120001 101
2141010000
32113031200
410014101
52131763
600103108

In addition, Ulrich Schimke found that there are 459 symmetric 7 × 7 square matrices, and 844 symmetric 8 × 8 square matrices. No one knows if there are non-symmetric matrices of these sizes.


If you can extend any of these results, please e-mail me. Click here to go back to Math Magic. Last updated 10/5/99.