# John Napier's Binary Chessboard Calculator - Square Roots

Author(s):
Sidney J. Kolpas and Erwin Tomash

How to compute the largest integer square less than or equal to a given positive integer:

Recall first that multiplication of two positive integers, such as $18$ and $13,$ consists of placing $18$ along the bottom (horizontal) margin of the binary chessboard and placing $13$ along the right-hand (vertical) margin of the binary chessboard (Step 1), which corresponds to computing their product as $18\cdot13=(16+2)(8+4+1).$ The next step (Step 2) amounts to an application of the distributive law to obtain: $(16+2)(8+4+1) = 16\cdot8 + 2\cdot8 + 16\cdot4 + 2\cdot4 + 16\cdot1 + 2\cdot1,$ with the six products on the right-hand side of the equation necessarily arranged in a 3 row by 2 column rectangle on the chessboard. Using the same process, if we multiply $13$ by $13$––that is, if we square $13$––our first two steps will be to represent the product $13\cdot13$ as $(8+4+1)(8+4+1),$ then to apply the distributive law to obtain:
$(8+4+1)(8+4+1) = 8\cdot8 + 4\cdot8 + 1\cdot8 + 8\cdot4 + 4\cdot4 + 1\cdot4 + 8\cdot1 + 4\cdot1 + 1\cdot1,$ with the nine products on the right-hand side of the equation necessarily arranged in a 3 row by 3 column square on the chessboard, as shown below. This square will be symmetric about the main (NW-SE) diagonal and thus will have 3 entries along the main diagonal, including its upper left corner entry and its lower right corner entry. Furthermore, if we remove one row and one column from the chessboard in order to make the nine squares with counters in them contiguous to one another, the resulting 3 x 3 square still would have these properties.

For a positive integer $n,$ Napier's goal was to find the largest integer square less than or equal to $n.$ His strategy, essentially, was to find the geometric square of largest area less than or equal to $n.$ He began with the largest integer square entry less than or equal to $n$ among the even perfect square entries along the main (NW-SE) diagonal of his chessboard. He called this even perfect square the "head of the gnomons" and marked its location with a counter ($2^6$ in our example). Napier then formed a square in the lower right corner of the chessboard with the "head of the gnomons" at its upper left. Then, among the colorful backwards L-shaped gnomons (see Note) making up the "square-of-gnomons" (our term; not his) shown in the chessboard below, Napier marked with counters entries that both formed a square and kept the total value of that square less than or equal to $n.$ The sum of the values of the squares with markers on them was then the largest integer square less than or equal to $n$ and the square root could be read from the margins of the chessboard. Reversing our example above, if we take $n=169,$ then, since the sum of the entries marked with counters is $169,$ we conclude that the square root of $169$ is $8+4+1=13.$

Notice that the yellow gnomon, the "head of the gnomons", consists of 1 square; the blue gnomon consists of 3 squares, each with a counter; the green gnomon has no counters; and the orange gnomon has 7 squares but only 5 of them are marked with counters. If we remove an entire row and an entire column from the chessboard, as shown below, the nine squares with counters will form a 3 x 3 square with no gaps in it.

Keeping these hints in mind, we will illustrate Napier's process using two examples.

Example:  That the square root of 180 has integer part 13 with remainder 11 is illustrated on Napier's binary chessboard calculator.

Step 1. Represent 180 in the horizontal margin.

Step 2. Identify $2^6 = 64$ as the largest value along the main (NW-SE) diagonal that is less than or equal to 180. Designate the square along the main diagonal containing $2^6$ the "head of the gnomons" and place a counter on it. (We have also colored it yellow.)

Step 3. Subtract $2^6 = 64$ from the current value (180) along the horizontal margin, obtaining $180 - 64 = 116$, and replace 180 with 116 along the horizontal margin.

Step 4. From the "head of the gnomons", travel down the main diagonal, searching for the first gnomon with its corner along the main diagonal in which 3 of the squares have a value less than or equal to 116. Since the blue gnomon with entries $2^5, 2^4,$ and $2^5$ satisfies $2^5 + 2^4 + 2^5 = 80\le 116,$ we place counters on its three squares.

Step 5. Subtract 80 from the current value (116) along the horizontal margin, obtaining $116 - 80 = 36,$ and replace 80 with 36 along the horizontal margin. Continue to travel down the main diagonal, searching for the first gnomon with its corner along the main diagonal in which 5 of the squares have a value less than or equal to 36. The green gnomon is next, but its 5 squares have value $2^4 + 2^3 + 2^2 + 2^3 + 2^4 = 52,$ which is greater than 36; therefore, we cannot use it. For the orange gnomon, since $2^3 + 2^2 + 2^0 + 2^2 + 2^3=25,$ is less than 36, we place counters on the 5 squares corresponding to this sum. (Note that $2^3 + 2^1 + 2^0 + 2^1 + 2^3=21$ also is less than 36, but that placing counters on the corresponding squares would ruin our square, not allowing us to form a 3 x 3 square simply by removing an entire row and column. It would result in neither a geometric square nor a square value.)

Step 6. We subtract 25 from the current value (36) along the horizontal margin, obtaining $36 - 25 = 11,$ and replace 36 with 11 along the horizontal margin. We have reached the edge of the chessboard, and have formed a 3 x 3 square. The square root is to be found along the sides of this square. To determine this square, we place counters on the values along the right-hand (vertical) margin corresponding to the rows in which there are counters; namely, 8, 4, and 1. The highest-placed counter will always be at the end of the row containing the "head of the gnomons"; in our example, on 8 in the vertical margin. We also place counters on 4 and 1 in the vertical margin since these numbers lie at the ends of the remaining two rows in our square. Our result is that the square root of 180 has integer part 8 + 4 + 1 = 13 (vertical margin) with remainder 11 (horizontal margin).

Example:  That the square root of 121 is 11 is illustrated on Napier's binary chessboard calculator.

Step 1. Represent 121 in the horizontal margin.

Step 2. Identify $2^6 = 64$ as the largest value along the main (NW-SE) diagonal that is less than or equal to 121. Designate the square along the main diagonal containing $2^6 = 64$ the "head of the gnomons" and place a counter on it. (We have also colored it yellow.)

Step 3. Subtract $2^6 = 64$ from the current value (121) along the horizontal margin, obtaining $121 - 64 = 57$, and replace 121 with 57 along the horizontal margin.

Step 4. From the "head of the gnomons", travel down the main diagonal, searching for the first gnomon with its corner along the main diagonal in which 3 of the squares have a value less than or equal to 57. First, we try the blue gnomon with entries $2^5, 2^4,$ and $2^5.$ Since its value, $2^5 + 2^4 + 2^5,$ is greater than 57, we cannot use it. For the green gnomon, since the 3 values $2^4, 2^2,$ and $2^4$ satisfy $2^4 + 2^2 + 2^4\le 57,$ we place counters on the corresponding squares. (Although the squares representing $2^3 + 2^2 + 2^3$ in this gnomon have the symmetry we require, they do not maintain the boundaries, or edges, of the square-of-gnomons and therefore would result in neither a square shape nor a square value.)

Step 5. We subtract $2^4 + 2^2 + 2^4=36$ from the current value (57) along the horizontal margin, obtaining $57 - 36 = 21,$ and replace 57 with 21 along the horizontal margin. We then continue to travel down the main diagonal, searching for the first gnomon in which 5 of the squares have a value less than or equal to 21. In the orange gnomon, since $2^3 + 2^1 + 2^0 + 2^1 + 2^3\le 21,$ we place counters on the squares corresponding to this sum. (We can rule out the 5 squares that give the sum $2^3 + 2^2 + 2^0 + 2^2 + 2^3$ for two reasons: not only is this sum greater than $21,$ but also this option would have ruined our square – that is, it would have resulted in neither a square shape nor a square value.)

Step 6. Finally, we subtract $2^3 + 2^1 + 2^0 + 2^1 + 2^3 = 21$ from the current value along the horizontal margin, obtaining $21 – 21 = 0,$ and remove 21 from the horizontal margin. Since we have reached the edge of the checkerboard, we then place counters on the values along the right hand (vertical) margin corresponding to the rows in which there are counters; namely, 8, 2, and 1 For each row in our square of counters, we place a counter on the entry along the right hand (vertical) margin at the end of that row. Our result is that the integer 121 has as its square root 8 + 2 + 1 = 11 (vertical margin) with remainder 0 (horizontal margin).

The reader may wish to use the binary chessboard calculator to extract the integer part of the square root of each of 120, 170, and 225.

Note: For a more general history of gnomons as L-shaped parts of sundials, see Gnomon.

Sidney J. Kolpas and Erwin Tomash, "John Napier's Binary Chessboard Calculator - Square Roots," Convergence (December 2018)