# Problem of the Month(February 2014)

A matrix whose rows and columns are all different primes with non-decreasing digits is called a increasing prime grid. Similarly, if the primes have non-increasing digits, we call it a decreasing prime grid. For small m and n, can you find all the m×n increasing/decreasing prime grids? For a fixed m, what is the largest n so that an increasing/decreasing prime m×n grid exists? What is the largest increasing/decreasing prime grid that you can find?

Solutions were received by Joe DeVincentis, Bryce Herdt, and Hakan Summakoğlu.

Here are the known increasing prime grids of different sizes:

1×2
 ```23 37 ```

1×3
 ```257 ```

1×4
 ```2357 ```

2×2
 ```11 11 37 79 ```

2×3
 ```113 127 127 137 137 157 167 167 137 139 199 179 379 199 179 379 ```

2×4
 ```1117 1367 2347 2467 1399 3779 3779 3779 ```

2×5
 ```11117 11257 11257 11257 12457 13457 13799 13399 13999 79999 13799 37799 ```

2×6
 ```111127 113467 137999 377779 ```

3×4
 ```1123 1223 2333 2333 2333 2333 1277 1277 2347 2467 3347 3467 3779 3779 3779 3779 3779 3779 ```

3×5
 ```11113 11113 11113 11113 23333 23333 12347 12377 12577 13577 23447 33457 37799 37799 37799 37799 37799 37799 ```

3×6
 ```112223 122267 377999 ``` (JD)

4×5
 ```11113 11113 11113 11113 11113 11113 14557 12227 12227 12227 12457 11257 24677 13457 13477 13577 13577 12277 37799 77999 77999 77999 77999 79999 11113 11113 11113 11113 11113 11113 11257 12227 11257 12227 12457 12457 12457 12457 12577 12577 12577 14557 79999 79999 79999 79999 79999 79999 ``` (JD)

4×6
 ```112223 112223 112223 112223 112223 112223 123377 122347 122477 222337 222347 222367 223577 233477 233477 233477 233477 233477 333779 377779 377779 377779 377779 377779 112223 112223 112223 112223 112223 112223 122347 122477 222347 222367 123457 223577 233777 233777 233777 233777 234457 235577 377779 377779 377779 377779 377779 377779 112223 112223 112223 112223 112223 112223 122347 222247 222347 123457 122347 222347 233357 233357 233357 235577 233357 233357 377999 377999 377999 377999 379999 379999 ``` (JD)

5×5
 864 solutions (JD)

4×7
 ```1112333 1223357 2235557 3377999 ``` (JD)

5×6
 13349 solutions (JD)

4×8
 ```11122333 12223457 22333457 33799999 ``` (JD)

5×7
 10489 solutions (JD)

6×6
 5377 solutions (JD)

5×8
 135 solutions (JD)

6×7
 136374 solutions (JD)

5×9
 81253 solutions (HS)

7×7
 2304 solutions (JD)

7×8
 13891 solutions (JD)

Here are the number of increasing prime grids of various sizes:

×12345678
10
222
3180
41460
506612864
602118133495377
70001104891363742304
800011350138910
9000081253

Here are the decreasing prime grids of different sizes, up to symmetry:

1×2
 ```53 73 ```

2×2
 ```41 71 31 31 ```

2×3
 ```431 443 541 541 743 743 311 311 311 331 311 331 ``` ```751 761 773 853 863 877 331 311 311 331 311 331 ```

2×4
 ```7541 8543 8741 8753 9743 9851 9871 3331 3331 3331 3331 7331 7331 7331 ```

3×3
 ```643 743 853 541 733 643 331 311 311 ```

2×5
 ```75431 87443 87541 87541 98543 33311 33311 33311 33331 73331 ```

2×6
 ```876431 974431 987541 987631 311111 733111 733331 733111 ```

3×4
 ```7643 7643 7643 8443 8443 8443 8443 8663 8663 4441 7433 7541 5431 7433 8431 8431 7541 8543 3331 3331 3331 3331 7331 3331 7331 7331 3331 8663 8863 8863 8863 8863 8863 8863 8863 8863 8543 6551 6553 7541 7643 8543 8543 8641 8641 7331 3331 3331 7331 7331 3331 7331 3331 7331 8887 9643 9643 9643 9643 9643 9643 9643 9643 8863 5431 5441 5443 5531 7433 7541 8431 8443 7333 3331 3331 3331 3331 7331 7331 3331 3331 9643 9643 9643 9643 9743 9743 9743 9743 9743 8543 9431 9433 9533 5333 5431 5441 5443 7333 3331 7331 7331 7331 3331 3331 3331 3331 7331 9743 9743 9743 9743 9743 9743 9743 9743 9743 7433 7741 8431 8443 8731 8741 9431 9433 9733 7331 7331 3331 3331 3331 3331 7331 7331 7331 9883 9883 9883 9973 9973 9973 9973 9973 8861 8863 9851 7541 8543 9533 9833 9871 3331 3331 7331 7331 3331 7331 7331 7331 ```

2×7
 ```9875443 7333311 ```

3×5
 ```64433 84443 84443 87433 87433 87433 87433 87433 54331 54331 64333 54331 63331 84431 54331 54421 33311 33311 33311 33311 33311 33311 33311 33311 87443 87443 87443 87443 87443 87443 87443 87443 63331 64333 64433 64433 77431 84421 84431 84431 33311 33311 33311 33331 73331 33311 33311 33331 87443 87443 87443 87443 87443 87643 87643 87643 84431 87421 87433 87433 87433 54421 54443 64433 73331 33311 33311 33331 73331 33311 33331 33311 87643 87643 87643 87643 87643 87643 87643 87643 64433 74441 77431 77543 84421 84431 84431 84431 33331 73331 73331 73331 33311 33311 33331 73331 87643 87643 87643 87643 87643 87643 87643 87643 84443 84443 87421 87433 87433 87433 87443 87443 33331 73331 33311 33311 33331 73331 33331 73331 87643 87643 87743 87743 87743 87743 87743 87743 87541 87541 54331 54331 64333 64333 77431 87421 33331 73331 33311 33331 33311 33331 73331 33311 87743 87743 87743 87743 87743 88643 88643 88643 87433 87433 87433 87443 87443 65521 65543 75431 33311 33331 73331 33331 73331 33311 33331 73331 88643 88643 88643 88643 88643 88643 88643 88643 75533 75541 76441 76541 76543 85531 85531 85531 73331 73331 73331 73331 73331 33311 33331 73331 88643 88643 88643 88643 88643 88643 88643 88643 86441 86441 86531 86531 86531 86533 86533 86533 33331 73331 33311 33331 73331 33311 33331 73331 88663 88663 88663 88663 88663 88663 88663 88663 65543 65543 75541 76541 76543 85531 86441 86531 33311 33331 73331 73331 73331 33311 33311 33311 88663 88843 88843 88843 88843 88843 88843 88843 86533 76541 76543 86531 86531 86531 86533 86533 33311 73331 73331 33311 33331 73331 33311 33331 88843 88843 88873 88873 88873 88873 88873 88873 86533 88643 76541 76543 86531 86531 86533 86533 73331 73331 73331 73331 33331 73331 33331 73331 88873 88883 94433 96443 96443 96443 96443 96443 88643 88651 54331 54331 54421 55331 55333 75431 73331 73331 33311 33311 33311 33311 33311 73331 96443 96443 96443 96443 96443 96443 96643 96643 84421 84431 84431 85331 85333 94433 55441 75431 33311 33311 33331 33311 33311 73331 33331 73331 96643 96643 98443 98443 98443 98443 98443 98443 95441 95443 55331 55333 75431 85331 85333 88321 73331 73331 33311 33311 73331 33311 33311 33311 98443 98663 98663 98663 98663 98663 98663 98663 96431 55441 55541 55541 75541 76541 76543 85531 73331 33311 33311 33331 73331 73331 73331 33311 98663 98663 98663 98663 98773 98773 98773 98773 86441 86531 86533 98543 75431 88741 96431 98731 33311 33311 33311 73331 73331 33331 73331 73331 98873 98873 98873 98873 98873 98873 98873 98873 76541 76543 86531 86533 88643 88651 88661 88663 73331 73331 33331 33331 33331 33311 33311 33311 98873 98873 98873 98873 98873 99643 99643 99643 98533 98543 98641 98731 98773 75431 75533 75541 73331 73331 73331 77731 77731 73331 73331 73331 99643 99643 99643 99643 99643 99643 99643 99643 85531 85531 95441 95443 95531 98443 98533 98543 33311 33331 73331 73331 73331 73331 73331 73331 99733 99833 85331 85531 33311 33311 ```

4×4
 ```9887 9643 7643 3331 ```(JD)

3×6
 194 solutions (JD)

4×5
 ```99877 98773 97777 98773 97777 98773 88663 87433 87433 87433 87433 87433 88643 85333 85333 85333 85333 85333 73331 73331 73331 33331 33331 33311 99877 98887 98873 98663 88643 87553 98773 98773 97553 87643 84443 76543 76543 75553 65543 33311 33311 33311 33311 33311 ```(JD)

3×7
 168 solutions (JD)

4×6
 49 solutions (JD)

5×5
 ```98663 98773 88853 88663 98663 88643 88663 88843 87443 96643 86533 86533 88643 87433 65543 86531 84431 87641 54331 43331 73331 73331 33331 33331 33331 98663 96643 97777 88663 88643 88663 86533 87553 87433 87433 88643 66533 65543 85333 85333 75533 64433 64333 55333 55333 33311 33311 33311 33311 33311 ```(JD)

3×8
 ```98877533 98866643 98866433 99877643 99877633 98765431 98764321 98743331 97765331 97765331 77711111 77711111 77711111 77711111 77711111 99877643 99876443 99876443 99877643 98766433 97765321 97753321 99866321 99865321 98664331 77711111 77711111 71111111 71111111 71111111 98776543 98766433 99766553 99965443 97766443 98654221 98643331 77664421 77444321 76543321 71111111 71111111 71111111 71111111 71111111 ```(JD)

3×9
 56 solutions (JD) (HS)

4×7
 24 solutions (JD)

5×6
 899 solutions (JD)

4×8
 ```99988853 98887753 98877553 88887443 88777543 88775443 87533333 86644433 86644433 71111111 71111111 71111111 ```(JD)

5×7
 1228 solutions (JD)

6×6
 996 solutions (JD)

5×8
 335 solutions (JD)

6×7
 11352 solutions (JD)

5×9
 1254 solutions (JD) (HS)

6×8
 5408 solutions (JD)

7×7
 6279 solutions (JD)

6×9
 20066 solutions (JD) (HS)

7×8
 1669 solutions (JD)

7×9
 101901 solutions (JD)

Here are the number of decreasing prime grids of various sizes:

×12345678
10
222
30123
407441
5051621110
60419449899996
701168241228113526279
800153335540816690
900560125420066101901

Both Joe DeVincentis and Bryce Herdt generalized to grids that were decreasing across and increasing down.

1×2
 ```53 73 ```

2×1
 ```2 3 3 7 ```

1×3
 ```2 5 7 ```

1×4
 ```2 3 5 7 ```

2×2
 ```31 41 61 11 31 41 71 71 71 73 73 73 61 11 53 71 73 83 73 97 97 97 97 97 ```(BH)

2×3
 ```211 421 311 431 631 641 211 331 733 773 773 773 773 971 541 761 811 541 743 761 863 971 971 971 977 977 977 977 211 521 751 811 821 211 521 991 991 991 991 991 997 997 751 811 821 853 997 997 997 997 ```(JD)

2×4
 ```4211 6211 7321 7621 2111 7211 8111 8221 7331 7331 9733 9733 9931 9931 9931 9931 8521 2111 7211 7541 8111 8731 8741 8761 9931 9973 9973 9973 9973 9973 9973 9973 ```(JD)

4×2
 ```31 41 41 61 61 71 97 97 ```(JD)

3×3
 67 solutions (JD)

2×5
 ```54311 74311 86311 87421 75211 87211 97771 97771 97771 99733 99971 99971 87511 87541 75211 87211 87511 99971 99971 99991 99991 99991 ```(JD)

5×2
 ```11 11 11 31 41 31 41 31 31 31 41 43 43 43 41 41 61 61 53 53 73 71 61 71 71 73 83 83 73 97 97 97 97 97 97 ```(JD)

2×6
 ```852211 752111 999331 999931 ```(JD)

6×2
 ```11 11 41 31 31 31 43 61 41 41 53 71 43 73 73 73 83 83 83 83 97 97 97 97 ```(JD)

3×4
 50 solutions (JD)

4×3
 58 solutions (JD)

2×7
 ```8643211 9777331 ```(JD)

7×2
 ```11 31 41 43 53 83 97 ```(JD)

3×5
 38 solutions (JD)

5×3
 265 solutions (JD)

3×6
 33 solutions (JD)

6×3
 284 solutions (JD)

4×5
 140 solutions (JD)

5×4
 370 solutions (JD)

3×7
 24 solutions (JD)

7×3
 205 solutions (JD)

3×8
 ```55421111 54432211 54331111 54331111 54333311 96433321 97443221 97744321 97753321 97754431 99999773 99999773 99999773 99999773 99999773 43321111 43333331 53333311 43321111 54432211 98533321 98754431 98754431 98764321 99443221 99999773 99999773 99999773 99999773 99999773 54331111 54322211 54331111 99544321 99732221 99743321 99999773 99999773 99999773 ```(JD)

8×3
 204 solutions (JD)

5×5
 417 solutions (JD)

3×9
 ```544322111 997775531 999977773 ```(HS)

9×3
 112 solutions (HS)

4×7
 618 solutions (JD)

7×4
 295 solutions (JD)

5×6
 3997 solutions (JD)

6×5
 232 solutions (JD)

5×7
 15914 solutions (JD)

7×5
 185 solutions (JD)

9×4
 262 solutions (HS)

5×8
 12202 solutions (JD)

8×5
 418 solutions (JD)

6×7
 35270 solutions (JD)

7×6
 38435 solutions (JD)

5×9
 8122 solutions (HS)

9×5
 71 solutions (HS)

7×7
 268113 solutions (JD)

7×8
 247700 solutions (JD)

8×7
 129164 solutions (JD)

7×9
 8122 solutions (HS)

Here are the number of increasing/decreasing prime grids of various sizes:

inc\dec123456789
1020000000
22122516112100
3106750383324131
412580140061800
507265370417399715914122028122
604284023203427000
70120529518538435268113247700564858
800204041801291640
90011226271

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