The game of chess was of particular interest to Orientalist scholars during the British Raj, including Sir William Jones, founder of the Asiatic Society. Over time, a succession of British authors nurtured the notion that this royal war game originated in India. More interesting, however, is its connection to the history of science around the world.

The sinologist Joseph Needham suggested that the ancient Chinese used the compass for divination on a chequered board which represented astronomical objects — the stars and constellations. This occult instrument, meant to measure the embattled Yin and Yang forces in the cosmos, passed over to India as a tactical war of two human armies. Important in this story is the common origin of chess and the compass, “the ancestor of all dial-and-pointer readings, the greatest single factor in the voyages of discovery, and the oldest instrument of magnetic-electrical science.”

In 1826, a Frenchman by the name of F Villot was quoted saying in several journals worldwide that chess was invented by astronomers in Ancient Egypt. “The king, according to him, represents the sun, and the queen, the moon. The former is sometimes on a black square and sometimes on a white, and thus gives us alternately day and night. The queen is always placed in the first instance on her colour because the moon in opposition (the white queen) affects a bright colour, and in conjunction (the black queen) affects a black one…” The author claimed to see a sharp similarity between Egyptian calendars and astronomical tables found on monuments and the chessboard. Although fanciful, this too hinted at an ancient link between science and the game of chess, a bond which may have carried over to the European Renaissance.

If the compass is seen as the primal fountain of our scientific knowledge, the amount of mathematics that flowed from the chessboard was impressive too.

When John Napier published Rabdologia (1617) containing some new graphical methods for rapid calculation, “The third device used a checkerboard-like grid and counters moving on the board to perform binary arithmetic. Napier termed this technique location arithmetic from the way in which the locations of the counters on the board represented and computed numbers. Once a number is converted into a binary form, simple movements of counters on the grid could multiply, divide and even find square roots of numbers.”

Napier’s work on logarithms and calculators was heavily oriented towards the urgent needs of astronomers, who had to perform fiendishly laborious computations repeatedly. Furthermore, the “coordinate plane” of Descartes’ La Géométrie (1637) was essentially a chessboard, infinite in all directions. Even today, you can see how chess notation and rectangular coordinates on a plane are analogous.

Even Sir Isaac Newton is known to have been interested in and purchased chessmen at some point. The eminent biologist TH Huxley was of the emphatic viewpoint that “The chessboard is the world; the pieces are the phenomena of the universe; the rules of the game are what we call the laws of Nature. The player on the other side is hidden from us. We know that his play is always fair, and patient. But also we know, to our cost, that he never overlooks a mistake, or makes the smallest allowance for ignorance.”

Connoisseurs of the game have for centuries been fascinated by walks of the knight upon an empty board, for the knight has the most complex move among all the pieces. A knight’s tour is a sequence of moves such that the knight visits every single square on the chessboard, but only once. “The earliest known reference to the Knight’s Tour problem dates back to the 9th century AD. In Rudrata’s Kavyalankara , a Sanskrit work on poetics, the pattern of a knight’s tour on a half-board has been presented as an elaborate poetic figure called the ‘turagapadabandha’ or ‘arrangement in the steps of a horse’.”

On an 8x8 board, there are an astonishing 26,534,728,821,064 “directed and closed” knight’s tours, a surprisingly large number of solutions for such a restricted problem. On larger boards, where the number of squares on a side is not odd (for example, 20x20), some of these tours produce another strange phenomenon. If the squares are numbered from N to NxN along the path of the knight, we get a pattern known since antiquity as a magic square . On such a square, the sum of numbers in any direction — be it row, column or diagonal is always the same, as if by magic. Small magic squares are found in many old cultures, including Vedic rituals or Chinese mythology.

A new 9x9x9 magic square was constructed by Andrew Hollingworth Frost in 1866, while stationed as a missionary in Nasik, India. It was the first magic cube to be discovered in history.

Perhaps one day, we will find that the entire universe is magical, in which the elementary particles are like knights touring at the speed of light. The stars are arrayed like numbers inside a magic hypercube, and no matter where, which direction we look from, the sum and the firmament appear the same.

Rohit Guptaexplores the history of science as Compasswallah

Follow Rohit on Twitter >@fadesingh