Explainer
Letters as numbers
The kaṭapayādi system
नञावचश्च शून्यानि संख्याः कटपयादयः ।
मिश्रे तूपान्त्यहल् संख्या न च चिन्त्यो हलस्वरः ॥
nañāvacaśca śūnyāni saṃkhyāḥ kaṭapayādayaḥ |
miśre tūpāntyahal saṃkhyā na ca cintyo halasvaraḥ ||
The letters na and ña and the vowels are zero; the numbers run from ka, ṭa, pa and ya. In a conjunct only the last consonant counts, and a consonant without a vowel is not counted.
Śaṅkara Varman, Sadratnamālā, 1819
What the rule says
Every consonant has a value. ka, ṭa, pa and ya are 1; the consonants that follow each of them count upward: kha 2, ga 3, gha 4, ṅa 5, ca 6, cha 7, ja 8, jha 9, and ña 0; ṭa to na likewise 1 to 0; pa to ma 1 to 5; ya to ha 1 to 8. A vowel on its own is zero. In a conjunct consonant only the last one, the one that carries the vowel, counts. And the digits are read from the right, as the texts say in a phrase the instrument quotes: aṅkānāṃ vāmato gatiḥ, the numbers go leftwards.
The instrument
Type any word in transliteration or Devanagari. Each syllable shows its digit; a grey dot marks a consonant that is not counted. The number below is read from the right.
Śaṅkara Varman’s π
The first example is Śaṅkara Varman’s famous line. In the Sadratnamālā of 1819 Śaṅkara Varman writes bhadrāmbudhisiddhajanmagaṇitaśraddhāsmayadbhūpagīḥ, a line that reads, more or less, “the blessed ocean, the proven birth, the faith in reckoning, the astonished king”. Decoded and read from the right it is 314,159,265,358,979,324: the circumference of a circle whose diameter is 10¹⁷, which is π correct to seventeen decimal places. The second example is the first entry of Mādhava’s sine table, śreṣṭhaṃ nāma variṣṭhānāṃ, which decodes to 224′ 50″ 22‴, the sine of 3°45′. Mādhava’s radius, 3437′ 44″ 48‴, is the table’s last entry, devo viśvasthalī bhṛguḥ.
Why it was done
A number set into a word can be set into a verse, and a verse can be remembered and checked by its metre. Astronomers in Kerala used the system for whole tables of sines and for the dates of their own works: the Nārāyaṇīyam of Nārāyaṇa Bhaṭṭatiri ends with the phrase āyurārogyasaukhyam, “long life, health and happiness”, which is also its date, Kali day 1,712,210, in the year 1587. In 2021 the project’s summer interns built a decoder for nine scripts, with a database of some 318,000 Sanskrit word-forms so that a number could be turned back into real words. This instrument grows out of that work.
Sources
- Śaṅkara Varman, Sadratnamālā (1819): K.V. Sarma’s edition, Indian Journal of History of Science 36 (2001), supplement; S. Madhavan’s edition, Kuppuswami Sastri Research Institute, 2011.
- INDEA, the web tools built in the project’s summer internship of 2021.
- V. Ramanathan, “Uyirezhuttu (vowel) svara-based system of numeration from texts of Tamil astronomy”, Gaṇita Sammelan, 20 January 2025, for the Tamil parallel.