summaryrefslogtreecommitdiff
path: root/project/templates/numberwall.xhtml
blob: 0e343edf5113b8f4c4cfeff712eaf0a39a7b97c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234

{%- extends "base_math.xhtml" -%}



{%- block title -%}Number Wall Visualiser{%- endblock -%}



{%- block footer -%}{{ math_footer ("numberwall.xhtml") }}{%- endblock -%}



{%- block style %}
    <link href="/css/numberwall.css" rel="stylesheet" />
    <link href="/css/accordian.css" rel="stylesheet" />
{% endblock -%}



{%- block content %}
<h4>Number Wall Visualiser</h4>

<p>Git repository: <a href="/cgi-bin/cgit.cgi/number-wall">Link</a><br />
Mathologer video:
<a href="https://invidious.namazso.eu/watch?v=NO1_-qptr6c" class="external">Invidious</a>
<a href="https://www.youtube.com/watch?v=NO1_-qptr6c" class="external">Youtube</a></p>

<h5>9/11/2022</h5>


<h5>Overview</h5>

<p>On August 27, 2022, a youtube mathematician called the Mathologer published an interesting video
on the mathematical constructs known as number walls. In the description of that video he also
published a coding challenge of creating an implementation of the number wall algorithm.</p>

<p>This is not an entry into that coding challenge. This is just a tribute.</p>

<p>For various reasons this didn't end up finished in the time period required, and in any case it
is not an online implementation and so doesn't qualify. But this project still has some fun tools to
play around with for anyone with an interest in math. Amongst other things, elaborate pictures of
the fractal square patterns produced by large number walls can be made.</p>

<div class="figure">
    <img src="/img/pagoda_wall_mod_5.png"
         alt="Number wall of the Pagoda sequence modulo 5"
         height="600"
         width="600" />
    <div class="figcaption">Number wall of the <a href="https://oeis.org/A301849" class="external">
    Pagoda sequence</a> with cells equal to 0 mod 5 in orange and others in blue</div>
</div>

<p>It is strongly recommended that you watch the Mathologer's video for an explanation of what
exactly a number wall is. If, for some reason, you don't want to do that or the video is
inaccessible, then the rules of how to construct a number wall are detailed in the appendix.</p>


<h5>Tools</h5>

<p>There are three programs provided:</p>
<ul>
    <li><i>wallgen</i>, a command line program that generates a number wall from a given
    input sequence in comma separated value format.</li>
    <li><i>wallsolve</i>, a command line program that uses a number wall and polynomials constructed
    from a given input sequence to find a recurrence relation that generates that sequence, and then
    calculates the next integer using that recurrence relation.</li>
    <li><i>visualwall</i>, a graphical program that creates a visual representation of a number wall
    with cells equal to zero modulo a given number highlighted in one color, and all other cells
    highlighted in a different color.</li>
</ul>

<p>An example of using <i>wallsolve</i> to calculate the next number in the sequence of integer
cubes:</p>
<div class="precontain">
<pre>
> wallsolve -i 1,8,27,64,125,216,343,512,729,1000
S(n) = 4S(n-1) - 6S(n-2) + 4S(n-3) - S(n-4)
Next: 1331
>
</pre>
</div>

<p>An example of <i>visualwall</i> has already been given in the overview in the form of the picture
of the Pagoda sequence number wall, and the output of <i>wallgen</i> is too verbose to show here.
</p>


<h5>Implementation Details</h5>

<p>All calculations to produce the number walls in these programs are done using the simple
construction rules in the appendix. No determinants were used, as that method would be more
computationally intensive.</p>

<p>Since the methods of constructing a number wall given by the Mathologer assume a sequence that is
infinite in both directions and any sequence used by these programs is finite, some compromises had
to be made. In particular, <i>visualwall</i> uses a longer sequence to generate its number wall and
then fits the largest square viewing area it can inside the resulting triangle of calculated values.
</p>

<p>The polynomial library made for <i>wallsolve</i> assumes that coefficients will always be
integers. This applies even to the division implementation, with only integer division being used
and the remainder term becoming larger than it may otherwise be expected to be if rationals were
permitted. As a number wall calculated from an integer sequence (or a sequence of polynomials with
integer coefficients) will always have integer values, this isn't actually a problem. But care had
to be taken in number wall construction so that division operations were always left until last.</p>

<p>The modulus values allowed by <i>visualwall</i> are not limited to prime numbers. If a composite
modulus is selected then the highlighted portions of cells equal to zero modulo that number may not
produce squares. The resulting pictures are, however, still interesting to examine.</p>

<p>At present <i>visualwall</i> only has the option to display either the Pagoda sequence or a
sequence of random numbers, unless a comma separated value formatted sequence is supplied in an
external file. It would not be hard for anyone with a passing knowledge of OCaml to add in different
sequences, but at this stage there is no need.</p>


<h5>Appendix: How to Construct a Number Wall</h5>

<p>A number wall is a grid of numbers that extends infinitely left, right, and down. It begins with
an infinite row of ones at the top, then below that a row containing the input sequence. All other
cells are computed according to the following rules.</p>

<div class="accordian">
    <input type="checkbox" name="collapse" id="handle1" />
    <label for="handle1">Toggle Cross Rule</label>
    <div class="hidden_content">

<table class="rule">
    <tr>
        <th>Pattern</th>
        <th>Relation</th>
        <th>Notes</th>
    </tr>
    <tr>
        <td>
            <table class="wall">
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>a</mi>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>b</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>c</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>d</mi>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>e</mi>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </td>
        <td>
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>a</mi>
                    <mo>&it;</mo>
                    <mi>e</mi>
                    <mo>+</mo>
                    <mi>b</mi>
                    <mo>&it;</mo>
                    <mi>d</mi>
                    <mo>=</mo>
                    <msup>
                        <mi>c</mi>
                        <mn>2</mn>
                    </msup>
                </mrow>
            </math>
            <br />
            <br />
            or alternatively
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>e</mi>
                    <mo>=</mo>
                    <mfrac>
                        <mrow>
                            <msup>
                                <mi>c</mi>
                                <mn>2</mn>
                            </msup>
                            <mo>-</mo>
                            <mi>b</mi>
                            <mo>&it;</mo>
                            <mi>d</mi>
                        </mrow>
                        <mi>a</mi>
                    </mfrac>
                </mrow>
            </math>
            <br />
            <br />
            where
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>a</mi>
                    <mo>&ne;</mo>
                    <mn>0</mn>
                </mrow>
            </math>
        </td>
        <td>
            This rule is used to calculate the vast majority of cells.
        </td>
    </tr>
</table>

    </div>
</div>

<div class="accordian">
    <input type="checkbox" name="collapse" id="handle2" />
    <label for="handle2">Toggle Long Cross Rule</label>
    <div class="hidden_content">

<table class="rule">
    <tr>
        <th>Pattern</th>
        <th>Relation</th>
        <th>Notes</th>
    </tr>
    <tr>
        <td>
            <table class="wall">
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>a</mi>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>b</mi>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>c</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>d</mi>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>e</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>f</mi>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>g</mi>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>h</mi>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </td>
        <td>
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <msup>
                        <mi>b</mi>
                        <mn>2</mn>
                    </msup>
                    <mo>&it;</mo>
                    <mi>h</mi>
                    <mo>+</mo>
                    <mi>a</mi>
                    <mo>&it;</mo>
                    <msup>
                        <mi>g</mi>
                        <mn>2</mn>
                    </msup>
                    <mo>=</mo>
                    <msup>
                        <mi>d</mi>
                        <mn>2</mn>
                    </msup>
                    <mo>&it;</mo>
                    <mi>f</mi>
                    <mo>+</mo>
                    <mi>c</mi>
                    <mo>&it;</mo>
                    <msup>
                        <mi>e</mi>
                        <mn>2</mn>
                    </msup>
                </mrow>
            </math>
            <br />
            <br />
            or alternatively
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>h</mi>
                    <mo>=</mo>
                    <mfrac>
                        <mrow>
                            <msup>
                                <mi>d</mi>
                                <mn>2</mn>
                            </msup>
                            <mo>&it;</mo>
                            <mi>f</mi>
                            <mo>+</mo>
                            <mi>c</mi>
                            <mo>&it;</mo>
                            <msup>
                                <mi>e</mi>
                                <mn>2</mn>
                            </msup>
                            <mo>-</mo>
                            <mi>a</mi>
                            <mo>&it;</mo>
                            <msup>
                                <mi>g</mi>
                                <mn>2</mn>
                            </msup>
                        </mrow>
                        <msup>
                            <mi>b</mi>
                            <mn>2</mn>
                        </msup>
                    </mfrac>
                </mrow>
            </math>
            <br />
            <br />
            where
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>b</mi>
                <mo>&ne;</mo>
                <mn>0</mn>
            </math>
        </td>
        <td>
            If cell
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>a</mi>
            </math>
            goes out of bounds of the wall, it is considered equal to zero.
        </td>
    </tr>
</table>

    </div>
</div>

<div class="accordian">
    <input type="checkbox" name="collapse" id="handle3" />
    <label for="handle3">Toggle Horseshoe Rule</label>
    <div class="hidden_content">

<table class="rule">
    <tr>
        <th>Pattern</th>
        <th>Relation</th>
        <th>Notes</th>
    </tr>
    <tr>
        <td>
            <table class="wall">
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>a</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>b</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>c</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>d</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>e</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>f</mi>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>g</mi>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>h</mi>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>i</mi>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>j</mi>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>k</mi>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>l</mi>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>m</mi>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>n</mi>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>o</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>p</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>q</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>r</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>s</mi>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <mi>t</mi>
                        </math>
                    </td>
                </tr>
            </table>
        </td>
        <td>
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mfrac>
                        <mrow>
                            <mi>W</mi>
                            <mo>&it;</mo>
                            <mi>X</mi>
                        </mrow>
                        <mrow>
                            <mi>Y</mi>
                            <mo>&it;</mo>
                            <mi>Z</mi>
                        </mrow>
                    </mfrac>
                    <mo>=</mo>
                    <mi>S</mi>
                </mrow>
            </math>
            where
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>W</mi>
            </math>
            is the common ratio of the arithmetic sequence
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>a</mi>
                    <mo>,</mo>
                    <mi>b</mi>
                    <mo>,</mo>
                    <mi>c</mi>
                    <mo>,</mo>
                    <mi>d</mi>
                    <mo>,</mo>
                    <mi>e</mi>
                    <mo>,</mo>
                    <mi>f</mi>
                </mrow>
            </math>
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>X</mi>
            </math>
            is the common ratio of the arithmetic sequence
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>t</mi>
                    <mo>,</mo>
                    <mi>s</mi>
                    <mo>,</mo>
                    <mi>r</mi>
                    <mo>,</mo>
                    <mi>q</mi>
                    <mo>,</mo>
                    <mi>p</mi>
                    <mo>,</mo>
                    <mi>o</mi>
                </mrow>
            </math>
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>Y</mi>
            </math>
            is the common ratio of the arithmetic sequence
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>a</mi>
                    <mo>,</mo>
                    <mi>g</mi>
                    <mo>,</mo>
                    <mi>i</mi>
                    <mo>,</mo>
                    <mi>k</mi>
                    <mo>,</mo>
                    <mi>m</mi>
                    <mo>,</mo>
                    <mi>o</mi>
                </mrow>
            </math>
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>Z</mi>
            </math>
            is the common ratio of the arithmetic sequence
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>t</mi>
                    <mo>,</mo>
                    <mi>n</mi>
                    <mo>,</mo>
                    <mi>l</mi>
                    <mo>,</mo>
                    <mi>j</mi>
                    <mo>,</mo>
                    <mi>h</mi>
                    <mo>,</mo>
                    <mi>f</mi>
                </mrow>
            </math>
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>S</mi>
            </math>
            is equal to
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mn>1</mn>
            </math>
            if the dimension of the zero square is even, or
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mn>-1</mn>
            </math>
            if the dimension is odd
        </td>
        <td>
            All cells surrounding a square of zeros are guaranteed to be nonzero.<br />
            <br />
            This rule is applicable to squares of zeros of any finite size, but for the sake of
            simplicity the previous rule should be used for isolated zeros.<br />
            <br />
            The cells that this rule should be targeted at calculating are those on the bottom row
            below the square of zeros. Reformulating the math to solve for those cells is left as an
            exercise to the reader.
        </td>
    </tr>
</table>

    </div>
</div>

<div class="accordian">
    <input type="checkbox" name="collapse" id="handle4" />
    <label for="handle4">Toggle Broken Cross Rule</label>
    <div class="hidden_content">

<table class="rule">
    <tr>
        <th>Pattern</th>
        <th>Relation</th>
        <th>Notes</th>
    </tr>
    <tr>
        <td>
            <table class="wall">
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>a</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>a</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>a</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>a</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>b</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>b</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>b</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>b</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>c</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>d</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>f</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>e</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>c</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>d</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>f</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>e</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>c</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>d</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>f</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>e</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>c</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>d</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>0</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>f</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>e</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>h</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>h</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>h</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>h</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>g</mi>
                                <mn>4</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>g</mi>
                                <mn>3</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>g</mi>
                                <mn>2</mn>
                            </msub>
                        </math>
                    </td>
                    <td>
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
                            <msub>
                                <mi>g</mi>
                                <mn>1</mn>
                            </msub>
                        </math>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </td>
        <td>
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>Y</mi>
                    <mo>&it;</mo>
                    <mfrac>
                        <msub>
                            <mi>a</mi>
                            <mi>n</mi>
                        </msub>
                        <msub>
                            <mi>b</mi>
                            <mi>n</mi>
                        </msub>
                    </mfrac>
                    <mo>+</mo>
                    <mi>s</mi>
                    <mo>&it;</mo>
                    <mi>W</mi>
                    <mo>&it;</mo>
                    <mfrac>
                        <msub>
                            <mi>c</mi>
                            <mi>n</mi>
                        </msub>
                        <msub>
                            <mi>d</mi>
                            <mi>n</mi>
                        </msub>
                    </mfrac>
                    <mo>=</mo>
                    <mi>Z</mi>
                    <mo>&it;</mo>
                    <mfrac>
                        <msub>
                            <mi>g</mi>
                            <mi>n</mi>
                        </msub>
                        <msub>
                            <mi>h</mi>
                            <mi>n</mi>
                        </msub>
                    </mfrac>
                    <mo>+</mo>
                    <mi>s</mi>
                    <mo>&it;</mo>
                    <mi>X</mi>
                    <mo>&it;</mo>
                    <mfrac>
                        <msub>
                            <mi>e</mi>
                            <mi>n</mi>
                        </msub>
                        <msub>
                            <mi>f</mi>
                            <mi>n</mi>
                        </msub>
                    </mfrac>
                </mrow>
            </math>
            <br />
            <br />
            where
            <br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>W</mi>
                    <mo>,</mo>
                    <mi>X</mi>
                    <mo>,</mo>
                    <mi>Y</mi>
                    <mo>,</mo>
                    <mi>Z</mi>
                </mrow>
            </math>
            are the common ratios of the arithmetic sequences along the sides of the square of zeros
            as in the Horseshoe Rule<br />
            <br />
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>s</mi>
            </math>
            is equal to
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mn>-1</mn>
            </math>
            if
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>n</mi>
            </math>
            is odd and
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mn>1</mn>
            </math>
            if
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>n</mi>
            </math>
            is even
        </td>
        <td>
            As with the Horseshoe Rule, this rule is applicable to squares of zeros of any finite
            size.<br />
            <br />
            The cells that this rule should be targeted at are those along the bottom denoted as
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <msub>
                    <mi>g</mi>
                    <mi>n</mi>
                </msub>
            </math>
            but as with the previous rule, reformulating the math to solve for those cells is left
            as an exercise to the reader.<br />
            <br />
            As with the Long Cross Rule, if any of the cells
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <msub>
                    <mi>a</mi>
                    <mi>n</mi>
                </msub>
            </math>
            go out of bounds of the wall they are considered to be equal to zero. This can occur if
            there are non-isolated zeros in the input sequence.
        </td>
    </tr>
</table>

    </div>
</div>

<p>An example of a number wall:</p>

<table class="wall">
    <tr>
        <td>&ctdot;</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>&ctdot;</td>
    </tr>
    <tr>
        <td>&ctdot;</td>
        <td>64</td>
        <td>125</td>
        <td>216</td>
        <td>343</td>
        <td>512</td>
        <td>729</td>
        <td>1000</td>
        <td>&ctdot;</td>
    </tr>
    <tr>
        <td>&ctdot;</td>
        <td>721</td>
        <td>1801</td>
        <td>3781</td>
        <td>7057</td>
        <td>12097</td>
        <td>19441</td>
        <td>29701</td>
        <td>&ctdot;</td>
    </tr>
    <tr>
        <td>&ctdot;</td>
        <td>2016</td>
        <td>4140</td>
        <td>7344</td>
        <td>11844</td>
        <td>17856</td>
        <td>25596</td>
        <td>35280</td>
        <td>&ctdot;</td>
    </tr>
    <tr>
        <td>&ctdot;</td>
        <td>1296</td>
        <td>1296</td>
        <td>1296</td>
        <td>1296</td>
        <td>1296</td>
        <td>1296</td>
        <td>1296</td>
        <td>&ctdot;</td>
    </tr>
    <tr>
        <td>&ctdot;</td>
        <td>0</td>
        <td>0</td>
        <td>0</td>
        <td>0</td>
        <td>0</td>
        <td>0</td>
        <td>0</td>
        <td>&ctdot;</td>
    </tr>
    <tr>
        <td>&utdot;</td>
        <td>&vellip;</td>
        <td>&vellip;</td>
        <td>&vellip;</td>
        <td>&vellip;</td>
        <td>&vellip;</td>
        <td>&vellip;</td>
        <td>&vellip;</td>
        <td>&dtdot;</td>
    </tr>
</table>

<p>The above excerpt was taken from the number wall generated by the sequence of integer cubes. In
this case, the wall essentially ends in a row of all zeros as all subsequent rows below that will
also be zeros. Note however that this does not always happen.</p>

<p>A property of number walls is that zeros will always be arranged in squares. A singular isolated
zero is considered to be a 1x1 square and a wall ending in rows of zeros as above is considered to
be the start of a square of zeros of infinite size. This property can be used to supplement the
calculation rules.</p>

{% endblock -%}