All posts

कथा कौतुकम् - 4 - कटपयादि

The Kaṭapayādi system assigns numerical values to consonants, allowing numbers to be encoded within apparently ordinary Sanskrit verses. The article demonstrates this with Śaṅkara Varman’s Sadratnamālā, where the digits of π are concealed in a Sanskrit line, and explains how the same system continues to be used in naming Carnatic rāgas.

Article compiled by Harsha M Krishna

Find Harsha on Instagram, X, LinkedIn, About


पुरा गणकाः अङ्कान् न लिखन्ति स्म। ते अङ्कान् गायन्ति स्म! purā gaṇakāḥ aṅkān na likhanti sma. te aṅkān gāyanti sma! (Long ago, mathematicians did not write numbers. They sang them!)

कथम्? प्रत्येकं व्यञ्जनस्य एकः अङ्कः अस्ति। katham? pratyekaṃ vyañjanasya ekaḥ aṅkaḥ asti. (How? Every consonant has a number.)

क = १, ट = १, प = १, य = १। ख = २, ठ = २, फ = २, र = २। एवम्। ka = 1, ṭa = 1, pa = 1, ya = 1. kha = 2, ṭha = 2, pha = 2, ra = 2. evam.

अतः अस्य नाम — कटपयादि। "क-ट-प-य आदयः"। ataḥ asya nāma — kaṭapayādi. (Hence the name: "beginning with ka, ṭa, pa, ya.")

अनेन कविः श्लोके अङ्कान् गोपयति। श्लोकः स्तोत्रम् इव भाति — किन्तु अन्तः गणितम् अस्ति! 🤯 anena kaviḥ śloke aṅkān gopayati. ślokaḥ stotram iva bhāti — kintu antaḥ gaṇitam asti! (By this a poet hides numbers in a verse. It looks like a hymn — but inside there is mathematics!)

पश्यन्तु — Look at this line

From the Sadratnamālā, chapter 4, verse 1:

भद्राम्बुधिसिद्धजन्मगणितश्रद्धा स्म यद् भूपगीः bhadrāmbudhi-siddha-janma-gaṇita-śraddhā sma yad bhūpagīḥ

It reads as a perfectly ordinary Sanskrit line — auspicious ocean, accomplished birth, faith in reckoning, the king's speech.

Now decode each consonant by kaṭapayādi and read it in reverse order:

3 . 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 4

That is π — correct to 17 decimal places.

Sitting inside a line of devotional-sounding Sanskrit. 😮

In English 👇

Śaṅkara Varman (1774–1839) of Kaṭattanāḍ in North Malabar — known locally as Appu Thampuran — was the last great figure of the Kerala school of mathematics, the lineage that began with Mādhava of Saṅgamagrāma around 1340.

He wrote the Sadratnamālā in 1819, at a time when Western mathematics had already arrived in India. He chose to write it the old way anyway: in Sanskrit verse, with the numbers encoded as syllables.

Why encode at all? Because verse survives. A palm-leaf manuscript rots, a digit smudges — but a memorised śloka with metre and meaning corrects itself. If you misremember a syllable, the metre breaks and you know. It's error-detection, built into poetry.

Śaṅkara Varman even explained the system inside his own book: नञावचश्च शून्यानि संख्याः कटपयादयः "na, ña and vowels are zero; the digits run from ka, ṭa, pa, ya..."

And this is still alive today 🎶 Every one of the 72 melakarta rāgas in Carnatic music is named by this exact system. The first two syllables give the rāga's number — from which a musician can derive its precise notes. Mechakalyāṇi → me(5), cha(6) → reversed → 65. The name is the address.

⚠️ One caution, worth passing on to the group:

You'll often see a different verse shared — gopībhāgya madhuvrāta... — claimed to give π to 31 decimals and to be thousands of years old. The decoding works. But this verse appears only in 20th-century sources; there is no ancient manuscript containing it. It seems to have been composed by a modern author to demonstrate the system, not inherited from antiquity.

The Śaṅkara Varman line above is the real, documented one. Slightly less flashy, entirely true. 🌸

कः कटपयादिना स्वस्य नाम गणयति? Who wants to decode their own name into a number? 😄

All posts