(19) Creating a Formula or template for Khajuraho Square

Pankaj Khanna
9424810575


List of previous articles on the subject of Magic Squares:

(1) Beauty Squarely Introduction & Kuber Yantra
(2) Murphy Radio!? अले वाह!! My first Experience of Magic Square.
(3) Decoding the Quadratum Mirabile! How to solve 3x3 Magic Squares.
(4) Lo Shu Square History of Chinese Magic Square.
(5) The Unhurried Odyssey of a Turtle!! History of Magic Squares in short.
Brief Introduction.
(7) Khajuraho Magic: Introduction.
(8) Chautisa Yantra: Mytho-math Spice.
(9) Dürer Square : Introduction.
(10) European Chautisa and Tona Lisa. Properties of Durer's Square.
(11) Tona Lisa as a Rock Star! More prperties of Durer Square 
(12) Why no Books or Research Papers ? To save environment and much more...
(13) Ramanujan: The Man Who Treated Numbers Like Pets. About Famous Mathematician Ramanujan.
(14) When Mathematics Met Ramanujan. About Ramanujan's Main work of Mathematics.
(15) Ramanujan's Date with numbers. About Ramanujan's Square. 
(16) The Surrogate Ramanujan Yantra More about Ramanujan's Square.
(17) Not Every Date Cooperates! Limitations of Ramanujan's Square.


Today's Article: (19) Creating a Formula or template for Khajuraho Square.


The Khajuraho Magic Square is a celebrated 4×4 most-perfect pandiagonal magic square associated with the temples of Khajuraho in Madhya Pradesh and is generally dated to around the 10th/11th century CE. 

Using the integers 1 to 16 exactly once, it has the magic constant 34, meaning that every row, every column, and both principal diagonals sum to 34. 

Its elegance extends much further: all broken diagonals also total 34, every 2×2 subsquare sums to 34, and pairs of numbers symmetrically opposite the centre add to 17. 

Even many specially chosen patterns of four cells preserve the magic constant. These exceptional properties make it one of the finest known examples of a most-perfect magic square and a subject of enduring interest in recreational mathematics, combinatorics, and the history of Indian Mathematics.

We have already discussed about this Khajuraho Square in the following blog posts:

(7) Khajuraho Magic: Introduction.
(8) Chautisa Yantra: Mytho-math Spice.

It is advisable to read the above two articles to appreciate the beauty and elegance of Khajuraho square.


Whoever conceived the Khajuraho Magic Square possessed a mind of astonishing brilliance. With nothing but intellect, logic, and perseverance, those ancient Indian mathematicians fashioned a numerical structure of breathtaking symmetry and depth. 

And just imagine that they had no pen, pencil, eraser, books,  electricity, telephones, calculator, computers, internet, and AI to support them. 

More than a millennium later, it continues to inspire awe, reminding us that true genius transcends both time and technology. 

The numbers in the Khajuraho Magic Square are placed like this:



Although a considerable body of literature is available online on the mathematics of most-perfect magic squares/  pandiagonal magic squares/ Khajuraho Magic Square; no attention appears to have been devoted to deriving a general formula or template  from Khajuraho Square itself that enables one to construct such perfect magic squares by simply selecting a desired set of numbers and substituting them into a predefined scheme.

Before attempting to address this problem, it is useful to recall a fundamental mathematical property: every positive integer can be expressed as the sum of distinct powers of two, with the sole exception that a power of two is trivially represented by itself.


We shall now attempt to derive a general formula by carefully examining the numerical structure of the original Khajuraho Magic Square. As a first step, let us express each entry in the square as a sum of powers of two. Rewriting the numbers in this manner reveals intriguing patterns and provides valuable insights into the underlying construction. The Khajuraho Magic Square can therefore be represented as follows:

Now we take a=b=1, c=2, d=4, and e=8. Practically four variables are enough as we have taken a=b. After replacing the numerical values of Khajuraho Square with these variables; we get the following generalised Square:



Now you can select any values of a,b,c,d and e as per your whim and fancy and get a Khajuraho Magic Square equivalent or most perfect magic square of your choice, in a jiffy!

However if you are not cautious in choosing proper values of a,b,c,d,e;  many a times these magic squares will be formed beautifully but may have one or more repeated numbers.

We will discuss in the next article : How to select a,b,c,d,e such that the Magic square has all sixteen distinct numbers. Please try to figure out the logic and the different series' without using ai! 

Remember the Mathematician/s behind Khajuraho Magic' Square who created the Magic Square without any aid! 





Pankaj Khanna
9424810575

πππππππππππππππππππππππ

मेरे कुछ अन्य ब्लॉग:

हिन्दी में:

तवा संगीत : ग्रामोफोन का संगीत और कुछ किस्सागोई।
रेल संगीत: रेल और रेल पर बने हिंदी गानों के बारे में।
साइकल संगीत: साइकल पर आधारित हिंदी गाने।
कुछ भी: विभिन्न विषयों पर लेख।
तवा भाजी: वन्य भाजियों को बनाने की विधियां!
मालवा का ठिलवा बैंड: पिंचिस का आर्केस्टा!
ईक्षक इंदौरी: इंदौर के पर्यटक स्थल। (लेखन जारी है।)

अंग्रेजी में:

Love Thy Numbers : गणित में रुचि रखने वालों के लिए।
Epeolatry: अंग्रेजी भाषा में रुचि रखने वालों के लिए।
CAT-a-LOG: CAT-IIM कोचिंग।छात्र और पालक सभी पढ़ें।
Corruption in Oil Companies: HPCL के बारे में जहां 1984 से 2007 तक काम किया।


πππππππππππππππππππππππ



Popular posts from this blog

(12) Why no Book or Research Papers on Magic Squares!?

(1) Beauty Squarely!

(2) Murphey Radio!? अले वाह!!