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 Man who came to destroy Hinduism – 1


On Jan 15, 1823, Jean-Antoine Dubois, a French-Catholic missionary, who spent time in Pondicherry, Madras Presidency and Mysore left India for Paris, never to return again. During his time in India, he dressed like a native and preached the Gospel, but after 30 years in India, he was convinced that it was next to impossible to convert Indians.
But seven years later, on May 27th, 1830, a Scottish missionary arrived in Calcutta and his goal was to “prepare a mine which should one day explode beneath the very citadel of Hinduism.” This 24 year thought that the methods of other missionaries, like directly appealing Hindus to renounce their faith, would do nothing but anger the natives. Instead he claimed to have found a unique way to destroy Hinduism in a peaceful manner.
To understand how Alexander Duff came up with his recipe, we need to understand the India of 1830s.

  1. The language of the Government was Persian and there were a few educational institutions which taught Arabic and Sanskrit. The learned people spoke these Oriental languages and not English.
  2. Duff arrived at a time when there was a controversy in British India over the language to be used for Indian higher education. On the one side there were the British Orientalists who wanted to use Sanskrit, Persian and Arabic and on the other side there were the Anglicists who had scorn for Oriental languages and Indian culture and wanted to enforce English
  3. The missionary activities were not very successful. The missionary technique consisted of standing in the street corner and preaching which fetched an occasional convert or two, but nothing of great significance. Even in South India, where there were more converts, the converts came from the out castes; the Hindu masses remained unaffected.

Duff would take all these three ingredients to come up with a winning formula, which was eventually endorsed by the Lord himself – I mean Lord Macaulay. Looking back, the formula was simple.

  1. Provide English education for the masses
  2. Make Bible studies an integral part of this education
  3. Be non-apologetic about teaching Christianity.

Thus he would teach Western history, philosophy, and natural sciences and as per the plan Hindus seeing irrationality in their religion would discard their faith voluntarily. But this was tricky business. It was possible that a Hindu who had left Hinduism due to Western education could become agnostic. But Duff would fill that spiritual vacuum with the Christian view of life.
Duff was very clear about what Christian education meant: it was not secular education with some Biblical studies thrown in. For him Christianity contained all knowledge and his goal was to teach with Christianity revelation at the center.
When Duff first proposed this method, veteran missionaries did not find it appealing. Still he went ahead without any government support. Bengalis did not mind an English school, but had reservations about an English school where Bible was an important subject. This reservation made it difficult for Duff to get started; he could not even find a building to start his classes.
One Indian who helped get Duff was Raja Ram Mohan Roy. Mohan Roy who worked with Lord William Bentinck in suppressing sati and who believed that the pure faith of the vedas were corrupted by various cults had founded Brahma Samaj to teach the worship of one God. Ram Mohan Roy provided Duff with a hall as well as his first students. When parents learned that Bible was being taught there, they were reluctant to send their kids, but Ram Mohan Roy helped there as well. On the first day of school, Ram Mohan Roy, who had three more years to live, calmed the students who refused to read the Bible and appeared daily for the Bible class.
Though Duff was a proponent of higher studies in English, he did not hate Bengali. He did not want students to be alien to their culture and hence Bengali studies were an important part of the curriculum. After one year, Duff conducted a public exam  – in front of parents and the media – and students demonstrated their knowledge in language, science and Bible. This was a huge success and it convinced both Indians and the British. Soon the number of students started increasing.
Not everyone in Calcutta was his fan. One of the newspapers published an article suggesting that all students who attended Duff’s school be outcasted. This warning had an effect and the attendance dropped briefly, but later picked up.
Soon Duff encountered students —- not from his school, but from the Hindu college — who were enamored by Western thought and had a low opinion of Hinduism. These were the kind of people Duff wanted to seed Christian religion into and he invited them to his home to attend lectures on “God and His Revealing.” Hindus reacted strongly against Duff and asked the Government to stop this. Lord William Bentinck asked Duff to slow down and this crisis too passed.
But soon Duff got his converts — Krishna Mohan Banerjee, Mohesh Chunder Ghosh, Gopinath Nandi and Anando Chand Mazumdar  — and as he had expected they came from the higher castes. Some of them were Brahmins who ate beef to show their defiance against Hinduism and whose moral vacuum was happily filled by Duff.
By this time the Orientalist-Anglicist fight had reached critical mass. The East India Company needed a supply of qualified clerks and there were educational institutions like the Mohammedan college in Calcutta and Sanskrit college in Benares which provided the employees. The company even started a new Sanskrit college in Calcutta and Oriental colleges in Delhi and Agra. A large sum of money was spent in publishing books in the Oriental languages and translating European works into these languages. For the amount of money spent on education, there was not enough demand for these books.
In the language fight, the Government, missionaries and Orientalists wanted to use the Oriental languages, while Duff sided along with the Anglicists. If Indians were to learn Western culture and Christian theology, he said, it was not possible to do it in Sanskrit, Arabic or Persian or the vernacular Bengali. This decision on which language to choose for Duff was very critical and in a later speech given in Scotland, he said that it concerned the ultimate evangelization of India.
His arguments against Sanskrit were that (a) it was not perfect for Western education (b) ordinary people did not speak Sanskrit and (c) Western literature was not translated to Sanskrit. Since Sanskrit was tied to Hinduism, even if one were to teach Western literature in Sanskrit, the association formed in the mind of people would of an idolatrous and superstitious religion whereas English, would bring fresh ideas without the burden of association.
(Read Part 2)

Preserving the Vedic Traditions

Ibn Battuta, the Moroccon traveler who reached lands as far as Delhi and Calicut in 1341, grew up in Tangier. In the book The Adventures of Ibn Battuta, Prof. Ross E Dunn writes about Ibn Battuta’s upbringing: Tangier did not have madrassas like the ones in Tunis or Fez, but the neighborhood Koranic school provided him with sufficient Islamic teaching.
These students sat at the foot of the master listened to his discourses and learned the Qu’ran by heart. To be a learned master, you had to commit the text to memory and compared to other schools, the Moroccan school emphasized the rote learning. Like the Indic tradition, the memorization of these texts were meant to transmit scriptures to future generations
I am not sure if the Islamic tradition still emphasizes committing texts to memory with the same rigour as the old schools in Tangier and Fez, but the Indic tradition continues uncorrupted and with the same high standards in Thrissur, Kerala. In an event called anyonyam (each other), Rig Vedic scholars from two schools — Thrissur and Thiruvanaya — meet at the Sree Rama temple at Kadavallur, every November, to demonstrate their mastery over Rg Veda chanting.

The Kadavalloor Anyonyam is an outward manifestation of the method of ancient traditional Vedic recital. Only in Kerala can one see remnants of the basic traditions in the study of Vedams, use of Prayogams, and in enunciation (chanting / recital). Only in Kerala have the Mudras (standardised movement of hand and fingers) used during Vedic recital been retained in its truly traditional, uncorrupted and pure form till this day. Its musical aspects (notes like Udaatham, Anudaatham, Swaritham) later evolved and developed into the classical music system of the country, and yet, the original form continues to be retained here. [via ]

Here is a video
See Also: Dr. APJ Abdul Kalam’s speech at the Brahmaswom Madom, one of the vedic schools which participates in the anyonyam.