The Katapayadi Number System

By Image: http://collections.lacma.org/sites/default/files/remote_images/piction/ma-31973398-O3.jpg Gallery: http://collections.lacma.org/node/171573 archive copy, Public Domain, Link

What’s common between the first verse of Mahabharata and the last verse of Mēlputtūr Nārāyaṇa Bhaṭṭatiri’s Narayaneeyam written in 1586 CE.?

The first verse of adi parva reads

नारायणं नमस्कृत्य नरं चैव नरॊत्तमम देवीं सरस्वतीं चैव ततॊ जयम उदीरयेत

(” Om ! Having bowed to Narãyana and Nara, the most exalted male being, and also to the Goddess Saraswati, must the word Jaya be uttered)

Mēlputtūr Nārāyaṇa Bhaṭṭatiri’s Narayaneeyam ends with the words ayur- ̄arogya-saukhyam. This wishes long life, health, and happiness to the readers of his devotional poem.

The words jayam and ayur- ̄arogya-saukhyam have two properties.

  1. Both have proper meanings in the context of the sentence used (as in, they are not gibberish words.) This matters as we go into the details.
  2. The second property is not well known. Both those words encode a number that has a deeper meaning.

In this system of encoding, jaya represents 18 and ayur- ̄arogya-saukhyam 17,12,210. Counting those many days from Kali Yuga, gives the date as 8th December 1586, the completion date of Narayaneeyam.

This article looks at this style of representing numbers using meaningful words.

Katapayadi Number System

Process-wise, the encoding is simple. Each Samskritam consonant is given a number. Hence the algorithm is as simple as reading it from right to left.

jaya
81
encoding of jaya in katapayadi system

The letter ja is assigned the number 8 and ya, 1. Reading from right to left, it becomes 18.

Why did Vyasa pick on the number 18 and encode it as jaya? Why did he call Mahābhārata as jaya. Mahābhārata has 18 parvas. Gita has 18 chapters. The war was fought for 18 days. There were 18 akshauhini’s in the war. Thus jaya was not a random selection.

Here is the full table of the consonant to number assignment.

1234567890
ka क കkha ख ഖ
ga ग ഗ
gha घ ഘ
nga ङ ങ
ca च ച
cha छ ഛ
ja ज ജ
jha झ ഝ
nya ञ ഞ
ṭa ट ട
ṭha ठ ഠ
ḍa ड ഡ
ḍha ढ ഢ
ṇa ण ണ
ta त ത
tha थ
da द ദ
dha ध ധ
na न ന
pa प പ
pha फ ഫ
ba ब ബ
bha भ ഭ
ma म മ
ya य യ
ra र ര
la ल ല
va व വ
śha श ശ
sha ष ഷ
sa स സ
ha ह ഹ
katapayadi table

Look at the letters which represent the number 1. ka, ta, pa, ya gives it the name katapayadi (adi in Samskritam means beginning). Vowels meant 0, and vowels followed by a consonant had no value. In the case of compound letters, the value of the last letter was used.

In its land of origin, Kerala, it was known by a different name Paralpperu where paral means seashell and peru name” (astronomical calculations were done using seashells).

Here is another example. The year 2010 is expressed as natanara.

This is because

LetterValue
na0
ta1
na0
ra2

If you read this backward, you get 2010. An important point is that the letters are not chosen randomly. They mean something. In this case, natanara means “a man (nara) who is an actor ( nata)”. Since there are many possible letters for each number, the mathematician can create a meaningful word from the numbers.

Similarly, ayur- ̄arogya-saukhyam represents 17,12,210 to represent the date of 8 December 1586. Why was the epoch chosen as the beginning of Kali Yuga? It was the popular way of dating events called the Kali-ahargana. Kali-yuga started at sunrise on Friday, 18 February 3102 BCE, and computing the number of days from then was common in planetary calculations.

The fact that Bhaṭṭatiri used this system is not surprising. He was a student of Achyuta Pisharati, a member of the Hindu school of Mathematics from Kerala. This is also an example where it was used in non-scientific work.

Thus the katapayadi system allows the author to represent large numbers using easy-to-remember words. It also has the flexibility to let the author pick an appropriate word for the context and one that fits the meter if it’s a poem.

During the time of Aryabhatta, there were at least three methods of writing numbers. Mathematicians like Varahamihira and Bhaskaracharya used a system called the bhoot samkhya. Aryabhatta, though, invented his own system, which was a new contribution.(The Aryabhata Number System)

Katapayadi number system was primarily used by Hindu mathematicians and astronomers in Kerala. The fact that numbers can be converted to meaningful words that can be strung together helped Malayali mathematicians perform complicated calculations from memory. They computed eclipses, memorized the calculations using words, and committed to memory. This way, there was no dependency on books or tables. This system of memorization was prevalent till around 100 years back.

The book Moonwalking with Einstein talks about various techniques used by the ancients to memorize data. One of the techniques was called memory palace. The katapayadi system looks simpler as the data to commit to memory is that table.

Origins and Spread

If you ask, who started this number system, there are many answers. It’s possible that Vararuchi wrote them in Candra-vakyas in the fourth century. Aryabahata I, who lived 100 years after, was aware of it. It was then popularized in 683 CE in Kerala by Haridatta. ́Sankaranarayana ( 825–900 CE) mentions this name in his commentary on the Laghubhaskarıya of Bhaskara I. Subhash Kak argues that the the system is much older

Though the system originated in Kerala, it spread around India. Though it was well known in the northern part of India, it was not widely used. It spread from Kerala to Tamil Nadu and Pondicherry. That came due to their contact with Nilakanta Somayaji, another mathematician from the Madhava school. In Karnataka, Jains used it in their writing. Orissa has manuscripts that show usage of this system. Aryabhata II used this in the 10th century with some modifications. Bhaskara II used both Bhootsamkya system and Katapayadi system in his works.

This system was not used just in astronomy and mathematics but also in classifying music. For example, the 72 ragas were classified by musicologist Muddu Venkata Makki using the first two letters to indicate the serial number of the Melakartharagam. Thus Kanakangı shows the serial number 1, Rupavatı 12, Sanmukhapriya 56, or Rasikapriya 72.

You are too late if you think this system would help write something like Da Vinci Code. The National-Treasure-in-India script was done a few hundred years back. Ramacandra Vajapeyin, who lived in Uttar Pradesh, used this technique to forecast a dispute or war victory. His brother wrote a text to draw magic squares for therapeutic purposes.

Forgotten Mathematicians

I learned about the Hindu school of Mathematics (as opposed to the Jain school) from Kerala by reading A Passage to Infinity by George Gheverghese Joseph. Though there were few mathematicians in Kerala in the 9th, 12th, and 13th centuries, what is today called the Kerala School started with Madhava, who came from near modern-day Irinjalakuda. His achievements were phenomenal; they included calculating the exact position of the moon and what is now known as the Gregory series for the arctangent, Leibniz series for the pi and Newton power series for sine and cosine with great accuracy.

Some of these techniques were forgotten, but thanks to a renewed interest in Samskritam, there is a revival of knowledge. This whole article was triggered when I read the first chapter of my Samskrita Bharati book on sandhis which mentioned the katapayadi system.

Postscript

  1. If are you curious to know why Mahābhārata was called jaya, then read this article.

References:

  1. Vijayalekshmy M. “‘KATAPAYADI’ SYSTEM — A CONTRIBUTION OF MEDIEVAL KERALA TO ASTRONOMY AND MATHEMATICS.” Proceedings of the Indian History Congress, vol. 69, 2008, pp. 442–46, http://www.jstor.org/stable/44147207. Accessed 7 May 2022.
  2. Anusha, R., et al. “Coding the Encoded: Automatic Decryption of KaTapayAdi and AryabhaTa’s Systems of Numeration.” Current Science, vol. 112, no. 3, 2017, pp. 588–91, http://www.jstor.org/stable/24912445. Accessed 7 May 2022.
  3. Kak, Subhash. “INDIAN BINARY NUMBERS AND THE KAṬAPAYĀDI NOTATION.” Annals of the Bhandarkar Oriental Research Institute, vol. 81, no. 1/4, 2000, pp. 269–72, http://www.jstor.org/stable/41694622. Accessed 7 May 2022.
  4. Iyer, P. R. Chidambara. “REVELATIONS OF THE FIRST STANZA OF THE MAHĀBHĀRATA.” Annals of the Bhandarkar Oriental Research Institute, vol. 27, no. 1/2, 1946, pp. 83–101, http://www.jstor.org/stable/41784867. Accessed 7 May 2022.
  5. A. V. Raman, “The Katapayadi formula and the modern hashing technique,” in IEEE Annals of the History of Computing, vol. 19, no. 4, pp. 49-52, Oct.-Dec. 1997, doi: 10.1109/85.627900.

The Aryabhata Number System


Photo by Alex Chambers on Unsplash

In Computer Science, there are computations using binary or hexadecimal system, but for most people, the common system is the decimal system. Indian mathematicians did not restrict themselves to one system for computation. During the time of Aryabhatta, there were at least three methods of writing numbers. The most popular way of writing was using the Samskritam number system. Mathematicians like Varahamihira and Bhaskaracharya used a different system called the bhooth sankhya. Aryabhatta, though, invented his own system which was a new contribution.

In the Aryabhatta number system, the Samskritam letters from क to म carry values from 1 to 25. Letters from य to ह carry values 30, 40, 50… 80. Whenever an इ-kaara is used, the value is multiplied by 100. When an उ-kaara is used, the multiplier is 10,000, ऋ-kaara multiplies it by 1,000,000. To illustrate with example

  • च = 6
  • चि = 600
  • चु = 60,000
  • च्र = 6,000,000
  • कुचि = कु + चि = 10,000 + 600 = 10, 600

Reference: Aryabhateeya by Aryabhata (by Prof K S Sukla & Prof. K V Sarma. Commentary by Dr. N. Gopalakrishnan), Published by Indian Institute of Scientific Heritage, Thiruvananthapuram

In Pragati: Book Review of A Passage to Infinity by George Gheverghese Joseph

An important problem in historiography is the politics of recognition. Which theory gets recognized and which doesn’t sometimes depends on who is saying it rather than what is right. Take for example, the Aryan Invasion Theory. Historians like A L Basham wrote convincingly about it and it was the widely accepted fact. Over a period of time, the invasion theory fell apart; the skeletons, which were touted as evidence for the invasion, were found to belong to different cultural phases thus nullifying the theory of a major battle. Due to all this, historians like Upinder Singh categorically state that the Harappan civilization was not destroyed by an Indo-Aryan invasion. But  the Aryan Invasion Theory is still being taught in Western Universities and those who question it are ridiculed. In this atmosphere if any academic dares to support the Out of India Theory, that could be a career-limiting move.
Eurocentric historiography has affected not just Indian political history, but the history of sciences as well. Indigenous achievements have not got the recognition it deserved; when great achievements were discovered, there have been attempts to explain it using a Western influence. In 1873 Sedillot wrote that Indian science was indebted to Europe and Indian numbers were an abbreviated form of Roman numbers. Half a century before that Bentley rewrote the dates for various Indian mathematicians, pushing them to much later and blamed the Brahmins for fabricating false dates. Some of these historians were willing to acknowledge that there were some great mathematicians till the time of Bhaskara, but none after that and without the introduction of Western Civilisation, India would have stagnated mathematically.
George Gheverghese Joseph disputes that with facts and goes into the indigenous origins of the Kerala School of Mathematics which flourished from the 14th century starting with Madhava of Sangamagrama and ending with Sankar Varman around 1840s. Though there were few mathematicians in Kerala in the 9th, 12th and 13th centuries, what is today called the Kerala School started with Madhava who came from near modern day Irinjalakuda. His achievements were phenomenal; they included calculating the exact position of the moon and what is now known as the Gregory series for the arctangent, Leibniz series for the pi and Newton power series for sine and cosine with great accuracy.
Following Madhava,  the guru-sishya parampara bore fruit with a large number of students in that lineage achieving greatness. These include Vattasseri Paramesvara,  Nilakanta, Chitrabhanu,  Narayana, Jyeshtadeva and Achyuta. They wrote commentaries on Aryabhata (who was an influential figure for Kerala mathematicians), Bhaskara and Bhaskaracharya, recorded eclipses and dealt with spherical and planetary astronomy and produced many theorems and their proofs. Tantrasangraha by Nilakanta was a major output of this school. In this book, he carried out a major revision of the models for the interior planets created by Aryabhata and in the process arrived at a more precise equation than what existed in the world at that time. It was even superior to the one developed by Tycho Brahe later. These are the people we know about; Joseph writes that many more could be found from the uncatalogued manuscripts in Kerala and Tamil Nadu.
The book also goes into the social situation in Kerala which made these developments possible. By the 14th century the Namboothiri Brahmins, the major landholders were organized around the temple. They had a custom by which only the eldest son entered a normal marriage alliance and got his position in society by taking care of property and community affairs. The younger sons did not marry Namboothiri women, but entered into relations with Nair women — a practice called sambandham. They had to gain prestige by other means such as scholarship and the book makes the case that these younger sons formed one section of these mathematicians.
In an agrarian society which depended on monsoons, the precision of the calendar and astronomical computation of the position of celestial bodies was important. Astrology too was important for finding auspicious times for religious and personal rituals. All this knowledge was nourished, sustained and disseminated from the temple which served as the hub of this intellectual activity. The temple also employed a large number of people — priests, scholars, teachers, administrators — and there were a number of institutions attached to the temple where people were given free boarding and lodging.

After explaining the social situation in Kerala which facilitated the such progress, the final section of the book tackles an important problem. Two important mathematical developments of the 17th century are the discovery of calculus and the application of the infinite series techniques. While Europeans like Leibniz and Newton are credited with this work, the book argues that the origin of the analysis and derivations of certain infinite series originated in Kerala from the 14th to the 16th century and it preceded the work of Europeans by two centuries. The  mystery then is this: how did this information reach Europe?
The book presents multiple theories here. It considers the option that Jesuits were the channel through which this knowledge reached Rome and from there spread elsewhere. There have been many such examples of transmission from the 6th century onwards with knowledge reaching Iraq and Spain and eastward to  China, Thailand and Indonesia. But extensive survey of Jesuit literature did not provide any data for this transmission. Understanding the cryptic verses in which the information was written required investment of time and excellent knowledge of Malayalam and Sanskrit. Though Shankar Varman spoke to Charles Whish in 1832, that level of sharing of information may not have happened in the 14th century. The book then presents an alternate theory that the information may have slipped out unintentionally; the computations of the Kerala school would have been interesting for navigators and map makers and it would have been transmitted through them and then reconstructed back in Europe. This topic is not closed yet and much more research has to be done.
The book is not written purely for the layman in the style of Michel Danino’s The Lost River or Sanjeev Sanyal’s The Land of Seven Rivers. There are large portions of the book which contain mathematical proofs by  these great mathematicians and can skipped for those who are not mathematically inclined. There was something a bit odd about an appendix appearing in the middle of the book. While dealing with the history of mathematics in India, the book starts with the ‘classical’ period and with Aryabhata (499 CE). Recently, there was a course Mathematics in India – from Vedic Period to Model Times taught by Prof M D Srinivas, M S Sriram and K Ramasubramanian, whose videos are available on YouTube. The course, very rightly starts with the ancient period, starting with the Sulvasutras (which is prior to 500 BCE) and such ancient knowledge should be acknowledged.
During these times when every development is attributed to Greece or Europe, the book dispels that notion completely and argues for an indigenous development of the Kerala School. Thanks to the work of various post-Independence historians, we have more information about the the Kerala School of Mathematics and that information is getting more popular. The Crest of the Peacock: Non-European Roots of Mathematics by the same author and Mathematics in India by Kim Plofker, all talk about the history of Indian math and Kerala School in particular. But in more popular books, these developments are rarely mentioned because Indian mathematicians followed the computational model of Aryabhata which is different from the Greek model. In this context, books like A Passage to Infinity  are important for us to understand these marginalized mathematicians.

A Course on Mathematics in India (From Vedic Period to Modern Times)

In 662 CE, a Syrian bishop named Severus Sebokht wrote

When Ibn Sina (980 – 1037 CE) was about ten years old, a group of missionaries belonging to an Islamic sect came to Bukhara from Egypt  and he writes that it is from them that he learned Indian arithmetic. This, George Gheverghese Joseph, writes in The Crest of the Peacock: Non-European Roots of Mathematics shows that Indian math was being used from the borders of central Asia to North Africa and Egypt.
Though there is a such a rich history, we rarely learn about the greatness of Indian mathematicians in schools. Even our intellectuals are careful to glorify the West and ignore the great traditions of India. A prime example of that was an article by P. Govindapillai, the Communist Party ideologue, in which he lamented that the world did not know about the contributions of the Arab scientist al-Hassan. In response, I wrote an Op-Ed in Mail Today in 2009.
Thus it is indeed great to see that NPTEL ran a course on Mathematics in India – From Vedic Period to Modern Times. The entire series of around 40 lectures is available online. It is there on YouTube as well. It starts with Mathematics in ancient India with the Śulbasūtras and goes past the period of Ramanujam. It goes through various regional scientists including the members of the Kerala School of Astronomy and covers the difference between the Greco-Roman system of proofs and how Indian mathematicians did it. Kudos to Prof. M. D. Srinivas, Prof. M. S. Sriram and Prof.K. Ramasubramanian for making this available to the general public.
PS: @sundeeprao points to this course on Ayurvedic Inhertance of India