BH Van The Mathematics Magazine A Publication of The Bhavana Trust
BH Van The Mathematics Magazine A Publication of The Bhavana Trust
in)
The mathematics magazine
A publication of the Bhavana Trust
Mathematics in India
Part 2: Computational Mathematics in Vedic and Sūtra Literature
(https://bhavana.org.in/mathematics-in-india-2/)
I
n part 1 of this series we described the nature of the Vedic and Sūtra literature as source
materials for our understanding of the mathematical attainments, and presented examples
of sophisticated techniques in geometry that had been mastered during that period.
In this part, we shall discuss three topics from the mathematics of the Vedic and Sūtra periods.
First, the mathematical significance of the number-vocabulary in the Vedic treatises. This
necessitates a discussion on the distinction between the verbal decimal nomenclature and the
decimal place-value notation and the connection between the two. The focus will be on decimal
nomenclature and decimal expansion; the history of the decimal notation in India (as distinct
from decimal nomenclature) will be discussed in the next part. However, references to the
decimal notation will be frequently made for clarity through comparative discussions.
Third, we discuss the brilliant enumerative or combinatorial ideas in Chapter 8 of the prosody
text Chandaḥ-sūtra of Piṅgalācārya. Just as the Śulba-sūtras present the mathematical
knowledge required in the constructions of the Vedic fire-altars, a major portion of the last
chapter of the Chandaḥ-sūtra addresses mathematical questions arising from an analysis of
metres (chandas). Thus, Piṅgala’s mathematical gems were mere incidental offshoots of the
study of metres which had deep spiritual significance in the Vedic tradition. To illustrate the
mathematical impact of Piṅgalācārya’s treatise, we shall also present a few examples of
important mathematical results from post-Vedic texts which are inspired by, and are natural
extensions of, his mathematical innovations.
In this section, we shall highlight the decimal number-vocabulary in the Vedas, indicate its pivotal role in the
evolution of the decimal notation and discuss its mathematical sophistication. We shall particularly highlight the
seminal role of decimal expansion, the basis of the Vedic number-vocabulary, in the evolution of fundamental ideas
of algebraic mathematics.
The word “decimal” (“pertaining to ten”) is derived from the Latin decimalis (adjective for “ten”) and decem (ten),
resembling the Sanskrit daśama (tenth) and daśan (ten).
For clarity, we make a distinction between the two main familiar forms of the decimal system of representing
numbers:
The only ingredients for our standard decimal notation are ten distinct symbols called “digits” – one each for the
nine primary numbers (1,2,3,4,5,6,7,8,9) and an additional tenth symbol “0” which is used to denote the absence of
any of these nine digits at a requisite place of some number (e.g., in 2019, the symbol 0 is used to denote the absence
of any of the nine primary numbers in the hundred’s place in the number “two thousand and nineteen”).
Every number, no matter how large, is expressed through these ten figures using the “place-value” (or “positional
value”) principle by which a digit d in the r th position (place) from the right is imparted the place-value d × 10r−1 .
For instance, in the number denoted by 2019 in decimal notation, the digit 2 (situated in the fourth place from the
right) acquires the value “two thousand (2 × 103 )”. The Sanskrit word for “digit” is aṅka (literally, “mark”) and the
term for “place” is sthāna.
In our standard verbal decimal nomenclature, each number is expressed through nine words (“one”, “two”, … ,
“nine” in English) and number-names for the “powers of ten” (like “hundred”, “thousand”, etc.). Here the number-
names for the powers 10n play the role of the place-value principle. The concept of zero as a place-holder is not
required for the verbal expression of a number. For convenience, some additional derived words are adopted (like
“eleven” for “one and ten”, …, “nineteen” for “nine and ten”, “twenty” for “two ten”, etc). In the orally transmitted
Vedic literature, we see this verbal form of the decimal system (not the decimal notation).
Both the above forms originated, and were developed in India; the decimal notation evolved within the early
centuries of the Common Era, while the verbal decimal nomenclature was already in vogue when the Ṛgveda, the
most ancient extant world literature, was compiled. In addition, there was another system in India of expressing
numbers (both orally and in writing) using place-value in place of number-names for powers of ten but using words
in place of digits; the words were usually arranged in ascending powers of ten; like 2107 being expressed as “seven-
zero-one-two”. This system suited the tradition of oral transmission. The term “numeral” is usually used as a
synonym for a “digit” but is sometimes also used for the word-name (“one”, “two”, etc.) of a digit.
Decimal expansion
At the heart of both the Vedic decimal nomenclature and the decimal notation lies the mathematical principle that
every natural number N can be expressed as a “decimal expansion”
where a0 , a1 , … , an are numbers between 0 and 9. It is a polynomial-like expansion with x being replaced by 10.
The connection between the two expansions will be discussed in subsequent subsections.
As the Vedic number-names are evidently older than the perfected decimal notation, the genesis of this great idea of
“decimal expansion” of numbers has to be traced to the unknown creators of the Vedic number-vocabulary.
However, though expositions on the history of mathematics generally shower high praise on the decimal notation
and the zero, they tend to overlook the enormous significance of the verbal form of the decimal system, especially
its aspect of decimal expansion (1).
The decimal expansion involves recursive (repeated) applications of the algebraic principle of “division with
remainder” which states that for any pair of natural numbers a and b,
a = qb + r
2019 = 201 × 10 + 9
= (20 × 10 + 1) × 10 + 9
= 20 × 102 + 1 × 10 + 9
= (2 × 10) × 102 + 1 × 10 + 9
= 2 × 103 + 1 × 10 + 9.
The principle of “division with remainder” is an important principle that pervades much of the later Greek, Indian
and modern mathematics. For instance, it is crucially involved in the following algorithms which were known in
India by the time of Āryabhaṭa (499 CE):
The theoretical principle of “division with remainder” is often called the “Division Algorithm”. The terminology is
misleading. For, the so-called “Division Algorithm” is an existential statement and, by itself, does not describe a
practical algorithm to compute q and r quickly when a and b are large numbers and q, r cannot be readily seen by
inspection.
To better appreciate the algebraic nature of the decimal expansion of numbers, we first recall the concept of a
“polynomial”.
is called a polynomial in one indeterminate (or variable) x with coefficients a0 , … , an , while an expression like
a0 + a1 x + ⋯ + an xn + ⋯
with possibly infinitely many terms, is called a power series. Polynomials and power series are as basic to modern
mathematics as numbers. One can add, subtract and multiply two polynomials (respectively, power series) to obtain
another polynomial (respectively, power series). As we shall see later, the arithmetic of numbers based on their
decimal expansions influenced the algebra of polynomials. The close analogy between numbers and polynomials is
not quite an accident.
“Classical Algebra” refers primarily to the study of polynomials: the roots (or solutions) of polynomial equations, the
relationships between roots and coefficients, etc. While “polynomials” formed the cornerstone of Classical Algebra,
they remain the central objects of study in Modern Algebra and Algebraic Geometry—sometimes explicitly and
sometimes through disguises like “field extensions” or “algebraic varieties”.
The mathematical poem titled “Polynomials and Power Series” by the eminent mathematician S.S.Abhyankar (1930–
1
2012) begins with the exaltation .:
A general polynomial of degree n in one variable may be represented in the following two ways (with an ≠ 0):
i. an xn + an−1 xn−1 + ⋯ + a2 x2 + a1 x + a0 .
ii. (an , an−1 , … , a2 , a1 , a0 ).
For instance, the polynomial usually represented as 2x3 + x + 9 (i.e., in the form (i)) will be denoted by
(2, 0, 1, 9) in form (ii).
While expression (i) is the commonly used form for a polynomial, the sequence (ii) is often used in Abstract Algebra
to formally define a polynomial. We note two contrasting features of these two representations.
First, the variable x is displayed in the more familiar form (i), but suppressed in form (ii).
Second, in form (i), we need not write a coefficient if it is zero (e.g., the coefficient of x2 is not written in
2x3 + x + 9); but in form (ii), 0 has to be put as an entry when any coefficient is zero.
Are we not reminded of the analogous representations of numbers in the decimal system in two ways (verbal and
symbolic):
i. Two thousand One ten and Nine (Two thousand and nineteen)
ii. 2019
↔ 2𝑥3 + 𝑥 + 9
2 0 1 9 ↔ (2, 0, 1, 9)
Before discussing the correspondence between Vedic number-vocabulary and usual polynomial representation (i),
we first mention the salient features of the Vedic number-vocabulary.
The verbal form of the decimal system was already in vogue when the Ṛgveda, the oldest Veda and the oldest extant
body of world literature, was compiled. The Ṛgveda has single-word terms for
The above terms are suitably combined, as in our present verbal decimal terminology, to name other numbers. For
instance, the number “seven hundred and twenty” is expressed in Ṛgveda (1.164.11) as sapta śatāni viṁśatiḥ.
Numbers are represented in the decimal system in the Ṛgveda, in all other Vedic treatises, and all subsequent Indian
texts. No other base occurs in ancient Indian literature, except for a few instances of base 100.
Regarding the etymology of daśa (ten), the ancient lexicographer Yāska (6th century BCE or earlier) says:
i.e., daśa is so called as it closes off a sequence of numbers (1, 2, 3, …) and as its effect can be seen (in forming the
next sequence). It may be recalled that similar-sounding Vedic words das, dasma, dasra have the sense of
completing, fulfilling, accomplishing; das also has the related sense of getting exhausted. Yāska says that śata
(hundred) derives from daśadaśa (ten ten’s), without further explanation. We mention here that, due to their
extreme antiquity, the etymology of Vedic words is often obscure; even ancient lexicographers had to use ingenious
guesses, rather than definitive knowledge.
In the Vedic culture, a special mystic significance had been attached to the powers hundred, thousand and ten
thousand. The number hundred represents a general fullness. Ten layers of hundred symbolizes an entire plenitude,
an absolute completeness, and a word for plentiful—sahasra, was adopted for it. The word sahasra is derived from
the root sahas which stands for “mighty”, “powerful”, “victorious”, “strength”, “force”, etc.; thus, sahasra is mighty, a
huge number. Ten thousand too is special as the mystics saw in the illumined mind ten subtle powers, each having
2
an entire plenitude ([1], pp. 301–302, 416 ), and a word conveying a sense of abundance—ayuta (unbounded), was
adopted for it. The Sanskrit meanings of yuta include “attached”, “fastened”, “joined”, “connected”, “united”,
“combined”. (Hence, yuta is also the Sanskrit word for “addition” in arithmetic.) The negation ayuta means
“unjoined”, “not yoked”, “unbounded”, etc.
Numbers in Egyptian Hieroglyphic writing Mark Millmore / discoveringegypt.com
Tetractys
One may then surmise that the choice of base ten and the coining of number-names for certain powers of ten might
have a mystic genesis (see [12] for details). The mystic civilisation of ancient Egypt also used base ten and had
special pictorial symbols, with possible allegorical connotations, for powers of ten up to 107 (ten million). However,
the Egyptian system of hieroglyphs did not anticipate the idea of “place-value”, or any analogue. The Pythagoreans,
inheritors of Egyptian and other mystic traditions, considered ten to be a perfect number (reminiscent of the
completeness of das). They considered as sacred the tetractys, the triangular figure with ten special points arranged
symmetrically in four rows containing one, two, three and four points (1 + 2 + 3 + 4 = 10), representing, among
other things, the dimensions zero (point), one (line defined by two points), two (plane/triangle defined by three
points) and three (tetrahedron defined by four points) respectively.
An enunciation of the concept of “powers of ten” can be seen in the following verse of Medhātithi in Vājasaneyī
Saṁhitā (17.2) of the Śukla Yajurveda, where numbers are being increased by taking progressively higher powers of
ten:
imā me’ agna’ iṣṭakā dhenavaḥ santvekā ca daśa ca daśa ca śataṁ ca śataṁ ca sahasraṁ ca
sahasraṁ
cāyutaṁ cāyutaṁ ca niyutaṁ ca niyutaṁ ca prayutaṁ cārbudaṁ ca nyarbudaṁ ca samudraś
ca madhyaṁ cāntaśca parārdhaścaitā me’ agna’ iṣṭakā dhenavaḥ santvamutrāmuṣmilloke
3
O Agni! May these Bricks be my fostering Cows (growing into) one and ten; ten and hundred;
hundred and thousand; thousand and ten thousand; ten thousand and lakh; lakh and million; million
and crore; crore and ten crores; ten crores and hundred crores; hundred crores and thousand crores;
4
thousand crores and ten thousand crores; ten thousand crores and billion. (million million) in
England and Germany but 109 (thousand million) in USA and France. Here we use it for 1012 . May
these Bricks be my fostering Cows in yonder world as in this world!
Here, Medhātithi explicitly records single-word terms for progressively higher powers of ten up to one billion (1012
): eka (1), daśa (10), śata (102 ), sahasra (103 ), ayuta (104 ), niyuta (105 ), prayuta (106 ), arbuda (107 ), nyarbuda (108
), samudra (109 ), madhya (1010 ), anta (1011 ), parārdha (1012 ). Moreover, each of these terms is perceived, and
practically defined, to be 10 times the preceding term.
We see that words charged with the sense of the extraordinary, of the surpassing of usual frontiers, being adopted as
specific terms for high powers of ten: a word for the vast ocean (samudra), a word for the ultimate limit (anta) and
finally the word for the luminous upper half of existence (parārdha) beyond the ordinary firmaments of our
consciousness.
Medhātithi’s terms occur with some variations, sometimes with further extensions, in other Saṁhitā and Brāhmaṇa
texts. Terms for much higher powers of ten are mentioned in subsequent literature. An anonymous Jaina work
Amalasiddhi has terms for all powers of ten up to 1096 (daśa-ananta). A Pali grammar treatise of Kāccāyana lists
number-names up to 10140 , named asaṅkhyeya.
When convenient, centesimal (multiples of 100) scales have been used in India for expressing numbers larger than
thousand. The Ṛgveda (1.53.9) describes 60099 as ṣaṣṭiṁ sahasrā navatiṁnava (sixty thousands ninetynine); the
Taittirīya Upaniṣad (2.8) adopts a centesimal scale to describe different orders of bliss and mentions Brahmānanda
(the bliss of Brahman) to be 10010 times a unit of human bliss; there is a similar reference in the Bṛhadāraṇyaka
Upaniṣad (4.3.33). In a dialogue in the Buddhist work Lalitavistara (c. 300 BCE), Lord Buddha lists numbers in
multiples of 100 from koṭi (107 ) up to tallakṣaṇa (1053 ). The Rāmāyaṇa uses a scale of hundred-thousand (105 ) to
mention terms up to 1055 (mahaugha).
For expressing high powers of ten, Jaina and Buddhists texts use auxiliary bases like sahassa (thousand) and koṭi
(ten million), resembling our English vocabulary; for instance, prayuta (106 ) would be dasasatasahassa (ten
hundred thousand).
The decimal place-value notation is a pillar of modern civilization. Due to its simplicity, children all over the world
can now learn basic arithmetic at an early age. This has been a major factor in the dissemination (almost a
proletarianisation) of considerable scientific and technical knowledge, earlier restricted only to a gifted few.
Mathematicians and historians have paid glowing tributes to this profound innovation. A.L.Basham remarks, “The
unknown man who devised the new system was from the world’s point of view, after the Buddha, the most
important son of India.” (see [2], pp. 495–496)
However, due to the exclusive focus on the decimal notation, it is often overlooked that a momentous step had been
taken by the ancient Vedic seers (or their unknown predecessors) when they imparted single word-names to
successive powers of ten, thereby sowing the seeds of the decimal “place-value” principle. In fact, these single-word
terms are the verbal manifestations of the abstract place-value principle. For, the written decimal place-value
notation is simply
i. a suppression of the (place)-names for powers of ten from the verbal decimal expression of a number, along
with
ii. the replacement of the single word-names for numerals “eka, …, nava” by digit-symbols (one symbol for one
digit) and
iii. the use of a zero-symbol for the absent powers.
For instance, from the expression “two thousand nineteen” (i.e., “two thousand one ten and nine”),
All the three transitional steps are wonderful ideas, but one can see that the Vedic number-vocabulary had set the
stage for the decimal notation. That the key to the decimal place value notation lies in the Vedic Sanskrit number-
vocabulary had been pointed out by Swami Vivekananda in 1895 during a speech “India’s Gift to the World”
delivered at the New York City (at the hall of the Long Island Historical Society, now renamed Brooklyn Historical
Society). The report of his speech in the Brooklyn Standard Union, February 27, 1895, contains the following succinct
remark (see [27], Vol. 2, p. 511):
… the ten numerals, the very cornerstone of all present civilization, were discovered in India, and are,
in reality, Sanskrit words.
We have been emphasizing a crucial aspect of the number-vocabulary of Vedic Sanskrit: assigning a single-word
term for each power of ten, up to some large power. It is the presence of single-word terms that gives the number-
vocabulary of Vedic Sanskrit a polynomial-like structure which enabled it to serve as a precursor to the written
decimal notation with momentous mathematical consequences.
The Vedic Sanskrit system is unlike, say, the English terminology which is dependent on auxiliary bases like
“thousand” and “million”. For instance, Vedic Sanskrit has a single-word term like anta instead of a complicated
compound term like “hundred thousand million”.
The correspondence between Vedic number-vocabulary and the usual polynomial representation (i) is given by
i. daśa (10) ↔ x,
ii. śata (102 ) ↔ x2 ,
iii. sahasra (103 ) ↔ x3 ,
iv. ayuta (104 ) ↔ x4 , etc.
It may appear that there is a difference between the polynomial representation and the Sanskrit number-
vocabulary: unlike the symbols x3 , x4 , etc. (all derived from x), the names for the powers of ten are not derived
from daśa (10). Here, one has to note the practical aspect of terminology: for oral communication, a distinct single-
word term like “thousand” is much more convenient than a derived term like “ten-to-the-power-three”. Also, note
that the apparent difference is peripheral to the issue. For, the passage of Medhātithi, quoted above, shows that each
of the single-word terms for powers of ten was perceived, and practically defined, to be 10 times the preceding term.
Indeed, the passage may be regarded as containing an enunciation of the concept of “powers of ten”.
To appreciate the merit of the Sanskrit system of having a single-word term for each power of ten (up to some large
power), note that even the present English terminology of using auxiliary bases like “thousand” and “million” is less
satisfactory for expressing very large numbers in words. This is effectively illustrated by G.Ifrah (see [18], pp. 428–
429) by comparing the verbal representations of the number 523622198443682439 in English, Sanskrit and other
systems.
The mathematical richness and sophistication of the Vedic verbal decimal system can be glimpsed from the fact
that its invention would have required the realization and application of several abstract principles: the concept of
powers of ten (a manifestation of the abstract place-value principle and the forerunner of the decimal place-value
notation), the so-called division algorithm, recursive methods, and polynomial-like expansion.
A little reflection will show that the addition and multiplication of polynomials are analogous to the addition and
multiplication in arithmetic based on the decimal system, except that some adjustment has to be made in
arithmetic for “carrying over” due to the restriction that the numerals (corresponding to coefficients ai ) range from
0 to 9 only. One may also say that the simplicity of the standard arithmetical operations in the decimal system is due
to the polynomial-like aspects of the system. An example will be cited in a later subsection.
This analogy between the arithmetic based on the decimal representation of numbers and the algebra of
polynomials is no coincidence; the former indeed had influenced the latter. This comes out in the following passage
from Isaac Newton, a pioneer in the study of polynomials and power series in modern Europe. Newton emphasizes
that the arithmetic of decimal numbers provides a fruitful model for developing the arithmetic operations on
algebraic expressions in variables. Recall that the Indian decimal system had become standard in Europe shortly
before the arrival of Newton. Newton writes (1671):
Since the operations of computing in numbers and with variables are closely similar—indeed there
appears to be no difference between them except in the characters by which quantities are denoted,
definitely in the one case, indefinitely so in the latter—I am amazed that it has occurred to no one …
to fit the doctrine recently established for decimal numbers in a similar fashion to variables,
especially since the way is then open to more striking consequences. For since this doctrine in species
has the same relationship to Algebra that the doctrine in decimal numbers has to Arithmetic, its
operations of Addition, Subtraction, Multiplication, Division and Root-extraction may easily be learnt
from the latter's … (Quoted in [9], p. 296.)
The passage implicitly acknowledges that polynomials and power series are conscious extensions of the intrinsic
algebraic ideas in the decimal system. The polynomial character of the decimal system partly explains why Indian
stalwarts, who were used to the decimal system, could make rapid strides in “Algebra” – why Brahmagupta could
describe the algebra of polynomials in several variables in the early seventh century or why Mādhavācārya (of
Saṁgamagrāma) could describe the power series expansions of trigonometric functions in the fourteenth century
(as we shall see in subsequent parts of this series).
While Newton might have been referring to the decimal notation, his
analogy applies to the Vedic verbal decimal system as well. In fact, as we
have seen, this verbal decimal nomenclature is, in some sense, closer in
spirit to the usual polynomial representation than even the decimal
notation. This analogy should again give us an idea of the mathematical
depth in the “Sanskrit words” forming the Vedic number representation.
𝑁 = 2𝑛 𝑎𝑛 + ⋯ + 2𝑎1 + 𝑎0 , (2)
As a quick example, let us find the binary representation of 11 by the principle of division with remainder, making
successive divisions by two:
11 = 2 × 5 + 1
= 2 × (2 × 2 + 1) + 1
= 23 + 2 + 1.
We thus have
11 = 1 × 23 + 0 × 22 + 1 × 2 + 1 = (1011)2
In the notation of (2), the binary digits of N from right to left a0 , a1 , … , an (here 1,1,0,1) can be quickly
determined by the following general algorithm.
N0 −a0 N1 −a1
Set successively N0 := N , N1 := = 2n−1 an + ⋯ + a1 , N2 :=
2 2 = 2n−2 an + ⋯ + a2 , and so
on. The algorithm can then be described as follows.
N0 N0 −1
1. If N0 is even, then a0 := 0; in this case, N1 = 2
. If N0 is odd, then a0 := 1; in this case, N1 = 2
.
2. Repeat the process with N1 to obtain a1 , the next digit from the right, and N2 .
3. Proceed likewise till all the digits of the binary representation are obtained:
Ni
If Ni is even, set ai := 0 to obtain Ni+1 = 2
Ni −1
If Ni is odd, set ai := 1 to obtain Ni+1 = 2 .
(i) In general, the last binary digit a0 will be 0 or 1 depending on whether the number N0 is even or odd. In our case,
since 11 is odd, the last digit a0 is 1.
(ii) Next, we consider N0 − a0 ; here 11 − 1. The next binary digit from right a1 will be 0 or 1 according as N0 − a0
is divisible by 22 or not, i.e., according as N1 is even or odd. In our example, N1 = 5 is odd. So the penultimate
digit a1 = 1.
(iii) Next, considering N1 − a1 (here, 5 − 1), we see, as before, that the next binary digit a2 will be 0 or 1 according
as N2 is even or odd. In our example, N2 = 2 is even and hence a2 = 0.
(iv) Likewise, the digit a3 will be 0 or 1 according as N3 is even or odd. In our example, N3 = 1 is odd and hence
a3 = 1.
We describe below another method of obtaining the binary digits a0 , … , an , using similar ideas.
ri
Exercise. With notation as before, set r0 := N + 1 and in general define ri+1 inductively by ri+1 = 2 if ri is even
ri +1
and ri+1 = 2 if ri is odd. For each i, 0 ≤ i ≤ n, define a sequence {bi }i as follows: bi = 1 if ri is even and
bi = 0 if ri is odd. Show that, for each i, bi = ai .
Binary arithmetic in its modern form was studied in detail in Europe from around 1679 by the German
mathematician and philosopher G.W.Leibniz (regarded as the co-discoverer of Calculus along with Newton). His
exposition on binary arithmetic, published in 1703, was perhaps the most influential early text on the concept.
However, the first known investigations on the binary system in Europe were carried out by the English astronomer
Thomas Harriot (1560–1621). All these developments took place after the decimal system had got standardized in
Europe.
Decimal expansion as the model for other expansions
For any prime p, one has the “p-adic expansion” of a natural number N
as
N = an pn + ⋯ + a1 p + a0 ,
The decimal system is largely responsible for the excellence attained by Indian mathematicians in arithmetic,
astronomy and algebra. We give a few illustrations.
First, the polynomial-like decimal expansion of numbers is the basis for efficient methods of addition, subtraction,
multiplication, division, and computing square roots and cube roots, which were developed in India at an early
stage. We shall see several examples in the next part of this article. Below we discuss the standard multiplication
algorithm which is a variant of an Indian algorithm that we will present in the next part.
The multiplication algorithm involves:
To see this, let us analyse the steps involved in the multiplication of 19 and 12.
First, the two numbers are partitioned by their respective decimal expansions:
19 = 1 × 10 + 9 and 12 = 1 × 10 + 2.
Then, making an efficient use of the distributive property, one performs separately
(1 × 10 + 9) × 2 and (1 × 10 + 9) × (1 × 10),
making use of decimal expansion all along; and then adds the products.
19 ⟷ 1 × 10 + 9
× 12 ⟷ 1 × 10 + 2
38 ⟷ (1 × 10) × 2 + 9 × 2 = 2 × 10 + 10 + 8
190 ⟷ (1 × 10) × (1 × 10) + 9 × (1 × 10) = 1 × 100 + 9 × 10
228 ⟷ 1 × 100 + (3 + 9) × 10 + 8 = 1 × 100 + 100 + 2 × 10 + 8
Tabular arrangement of the multiplication operation (on the left) together with a step-by-step analysis (on the
right).
Thus, the fluency in basic Arithmetic, in ancient India and modern Europe, is due to the decimal expansion.
Though the (polynomial-type) methods for performing arithmetical computations are described only in post-Vedic
treatises, the polynomial aspect of the Vedic number-representation indicates that the Vedic computational
methods too would have been akin to polynomial operations, using rules like (ten times ten is hundred), (ten times
hundred is thousand), (hundred times hundred is ten-thousand) and so on, analogous to
xx = x2 , xx2 = x3 , x2 x2 = x4 , etc.
Second, the decimal expansion has a dormant algebraic character which influenced the algebraic thinking of
mathematicians in ancient India and modern Europe. We have seen that various expansions central to modern
algebra and number theory, including polynomials and power series, are conscious generalizations of the decimal
expansion of natural numbers. In India, Brahmagupta had defined the algebra of polynomials in 628 CE and
Mādhavācārya had investigated the power series expansions of trigonometric functions in 14th century CE. Both the
post-Vedic Indian geniuses had the advantage of being steeped in the decimal expansion gifted to them by the
unknown seers of a remote past. As Newton would point out in 1671, a millennium after Brahmagupta, one can
develop the operations (addition, multiplication, root extraction, etc.) with variables by imitating the methods of
the arithmetic of the decimal system.
Third, the decimal expansion enabled Indians to express large numbers effortlessly, right from the Vedic Age. We
mention two consequences.
Thanks to the decimal system, Indian astronomers could work with large time-frames, like cycles of 4320000 years,
and thereby obtain strikingly accurate results. For instance, Āryabhaṭa (499 CE) estimated that the Earth rotates
around its axis in 23 hours 56 minutes and 4.1 seconds, which matches the modern estimate (23 hours 56 minutes
4.09 seconds).
Again, it is due to the decimal system that Indian algebraists could venture into problems on equations whose
solutions involve large numbers. One of the most glorious achievements of ancient Indian algebraists is their
research on the problem of finding `integer’ solutions to linear and quadratic equations, a very important theme in
modern number theory. Three of the greatest feats on the theme are:
i. The kuṭṭaka (pulverization) method of Āryabhaṭa (499 CE) for finding positive integers x, y satisfying an
equation ax − by = c, where a, b, c are known integers.
ii. A composition law of Brahmagupta (628 CE) on the solution space of the equation Dx2 + z = y 2 , where D
is a fixed number.
iii. The cakravāla method of Jayadeva (within the 11th century) for solving Dx2 + 1 = y 2 in integers, a celebrated
problem of modern mathematics.
As an illustration of the kind of large numbers that get involved in the above problems, we mention that the
smallest pair of integers satisfying 61x2 + 1 = y 2 is x = 226153980, y = 1766319049. And this example
occurs in the Algebra treatise Bījagaṇita (1150 CE) of Bhāskarācārya. 500 years later, that is, soon after the decimal
system got standardised in Europe, the equation Dx2 + 1 = y 2 (and the specific example 61x2 + 1 = y 2 ) would
be highlighted by Pierre de Fermat (1657), heralding the advent of modern number theory.
Fourth, the traditional preoccupation with progressively large numbers, which was facilitated by the decimal
system, created an environment that was conducive to the introduction of the infinite in Indian mathematics.
Indian algebraists were comfortable with equations like ax − by = c and Dx2 + 1 = y 2 which have infinitely
many solutions (under the respective conditions that c is divisible by the greatest common divisor of a and b, and
that D is not a perfect square), and gave methods for generating all solutions. Bhāskarācārya (1150 CE) introduced
an algebraic concept of infinity and also worked with the infinitesimal in the spirit of calculus and then there was
the spectacular work on infinite series by Mādhavācārya (14th century).
Fifth, the Vedic number system is the first known example of recursive construction. Now, recursive principles are
prominent features of some of the greatest mathematical achievements of ancient India like the kuṭṭaka and
cakravāla methods, and the work of the Kerala school (for details, see [13] and [9] respectively). The facility with
recursive methods is another outcome of the decimal system.
Question.
Do we not owe a debt of gratitude to the ancients of remote antiquity who gave us the decimal system from which
emerged some of the finest mathematical ideas and techniques? Can we not take a leaf out of the book called
Ṛgveda which gives a living demonstration of Gratitude and Śraddhā through the phrase in Book 10.14.15:
A few references
A brief history of the decimal system is presented in [14] and a detailed history in [8]. Insightful analyses on Vedic
number-names have been made in [3], [10], [11]. Also relevant are: [12], [15] and [18].
Incidental references show that all the fundamental operations of arithmetic were performed during the Vedic time,
though the methods are not described in Vedic or even the Sūtra literature. For instance, in a certain metaphysical
context, it is mentioned in Śatapatha Brāhmaṇa (3.3.1.13) that when a thousand is divided into three equal parts,
there is a remainder one. The problem is also alluded to in the earlier Ṛgveda (6.69.8) and the Taittirīya Saṁhitā
(3.2.11.2).
The Pañcaviṁśa Brāhmaṇa (18.3) describes a list of sacrificial gifts forming a geometrical progression (G.P.):
The Śatapatha Brāhmaṇa (10.5.4.7) mentions, correctly, the sum of an arithmetical progression (A.P.):
There is a treatise on Vedic deities named Bṛhaddevata which is ascribed to Śaunaka, a venerated Vedic seer. (A.A.
Macdonell places the text as being composed before 400 BCE.) The Bṛhaddevata gives the sum:
2 + 3 + 4 + ⋯ + 1000 = 500499.
We shall see in the next section that the Chandaḥ-sūtra of Piṅgalācārya yields the formula for the sum of the G.P.
series: 2 + ⋯ + 2n = 2n+1 − 2. The following numerical example of this G.P. series can be seen in the Jaina
treatise Kalpasūtra (c. 350 BCE) of Bhadrabāhu:
1 + 2 + 4 + ⋯ + 8192 = 16383.
The incidental occurrences of correct sums of such series in non-mathematical texts suggest that general formulae
for series were well-known at least from the time of the Brāhmaṇas. Explicit statements of the general formulae for
the sum of A.P. and G.P. series occur later in the works of Āryabhaṭa (499 CE) and Śrīdharācārya (750 CE)
respectively.
A remarkable allegory in the Śatapatha Brāhmaṇa (10.24.2.2–17) lists all the factors of 720:
In the Baudhāyana Śulba, there are examples of operations with fractions like
7 12 ÷ ( 15 )2 = 187 12 ; 7 12 ÷ ( 15
1
of 12 ) = 225; 7 19 = 2 23 ;
(3 − 13 )2 + ( 12 + 10
120 ) (1 − 13 ) = 7 12 .
In the previous part, we had mentioned a remarkable rational approximation to 2, expressed in the Śulba-sūtras.
One finds in these texts an elementary treatment of surds. For instance, in the computation of the area of a certain
trapezium there is an implicit use of the following result involving surds
36 1 24 30
× ×( + ) = 324.
3 2 3 3
To convey to the reader some flavour as to how such arithmetical references spring up in a treatise on rituals and
mythology, we present below an English translation (due to Eggeling) of the metaphysical passage in the Śatapatha
Brāhmaṇa where the factors of 720 get listed:
Now in this Prajāpati, the year, there are seven hundred and twenty days and nights, his lights [being]
those bricks; three hundred and sixty enclosing stones, and three hundred and sixty bricks with
[special] formulas. This Prajāpati, the year, has created all existing things, both what breathes and
the breathless, both gods and men. Having created all existing things, he felt like one emptied out
and was afraid of death. He bethought to himself, “How can I get these beings back into my body?
How can I put them back into my body? How can I be again the body of all these beings?” He divided
his body into two. There were three hundred and sixty bricks in one and as many in the other: he did
not succeed. He made himself three bodies—in each of them, there were three eighties of bricks: he
did not succeed. He made himself four bodies of a hundred and eighty bricks each: he did not succeed.
He made himself five bodies—in each of them, there were a hundred and forty-four bricks: he did not
succeed. He made himself six bodies of a hundred and twenty bricks each: he did not succeed. He did
not develop himself sevenfold. He made himself eight bodies of ninety bricks each: he did not
succeed. He made himself nine bodies of eighty bricks each: he did not succeed. He made himself ten
bodies of seventy-two bricks each: he did not succeed. He did not develop elevenfold. He made
himself twelve bodies of sixty bricks each: he did not succeed. He did not develop either thirteenfold
or fourteenfold. He made himself fifteen bodies of forty-eight bricks each: he did not succeed. He
made himself sixteen bodies of forty-five bricks each: he did not succeed. He did not develop
seventeenfold. He made himself eighteen bodies of forty bricks each: he did not succeed. He did not
develop nineteenfold. He made himself twenty bodies of thirty-six bricks each: he did not succeed. He
did not develop either twenty-one or twenty-two or twenty-three fold. He made himself twenty-four
bodies of thirty bricks each: he did not succeed. There he stopped at the fifteenth.
Combinatorics is the branch of mathematics that investigates principles, formulae and algorithms for counting. The
most familiar combinatorial entity is n Cr , the total number of ways in which r objects can be selected out of n
objects, that is discussed in the chapter on “Permutations and Combinations” in High-School Algebra textbooks.
Ancient Indians knew and applied several fundamental principles of Combinatorics which would appear in Europe
from the seventeenth century of the Common Era. For instance, P.Herigone (1634 CE) is credited with the
fundamental formula of combinatorics:
n n(n − 1) ⋯ (n − r + 1)
Cr = ;
1 ⋅ 2⋯r
but this formula was stated explicitly by the Indian mathematicians Śrīdharācārya (750 CE) and Mahāvirācārya (850
CE). N.L.Biggs, a renowned expert in combinatorics, remarks ([4], p. 133):
… the Hindus were accustomed to the idea that complex objects and concepts arise from
combinations of more basic things, and so the mathematical questions occurred naturally in their
scheme of discovery.
… the basic ideas of choosing and arranging were so intimately related to Hindu culture that a
gradual mathematical development of these topics was inevitable.
The above remarks remind one of the structure of Pāṇini’s grammar—built in just under 4000 aphorisms from
about 1700 basic blocks.
Norman L. Biggs Normann Biggs The importance attached to the metre (chandas) can be seen from the
fact that each hymn of the Ṛgveda begins with a sort-of “heading” which
mentions not only the author of the hymn (e.g., Madhuchandā, son of Ṛṣi Viśvāmitra) and the Deity to whom it is
addressed (e.g., Agni) but also the metre (e.g., gāyatri) that is predominantly used in the hymn.
In the vision of the Vedic seers, every form in the universe is an expression or a manifestation, or a creation by the
divine Word. Human speech is merely a pale shadow of the original divine Word. The mighty idea of the entire
Creation being brought into existence by “The Word” is a concept common to all great ancient mystic cultures
though it might be difficult for the modern intellect to fathom its profundity.
The Spirit of Creation cast all cosmic movements in certain fixed rhythms of the formative Word, and a Mantra is an
expression, the voice, of the eternal creative chandas. In Vedic thought, metres of the sacred Mantras are treated as
manifestations, in speech, of the cosmic metres—the great world-rhythms which conceive, organize and maintain
the universe.
The word chandas can be etymologically derived from chad (cover). Presumably, the metrical rhythms of the
Mantras were visualised as clothing for the inspired knowledge that arises out of the depths of the soul and finds
expression in the higher consciousness of the Ṛṣi. The root chad also has the nuance of protection. The Vedic
Mantras—vibrations of great soul rhythms—protect the seeker from degeneration and disintegration. A cryptic
verse in the Ṛgveda (I.164.23) mentions that immortality can be attained through the knowledge of the spiritual
genesis of the Vedic metres. This could be a reference to the durability of any form that is created and maintained by
a system that is faithful to eternal cosmic rhythms. Due to this subtle principle of preservation and the awareness of
the power, intensity and force of rhythm, ancient Indians usually put in metrical verse form all-important
knowledge—even the technical facts of science and mathematics.
In fact, the aim of Yoga (literally “union”, “merger”) can be formulated as the tuning of our individual rhyme-beats to
the world-rhythms. By this measure, we are in harmony with the universal movement, we are in bliss.
Since the Vedic thinkers attributed a great mystic significance to chandas, special and careful attention was paid to
the study of metres. Rules for proper pronunciation and accentuation were formulated and the schools for Vedic
studies inculcated a spirit of rigorous discipline in following the prescribed rules. In Bṛhaddevatā (VIII.13.6), the
revered seer Śaunaka warns that one who teaches or recites the Vedas without proper knowledge of the metres is
verily a sinner. It is due to this culture of strict adherence to the rules of chanting, in particular, to the extraordinary
care to preserve the metres, that there has been a very little distortion in the vast mass of the Vedic texts even over
thousands of years.
Chandas was called the feet of the Vedas—Chandaḥ pādau tu vedasya (Pāṇinīya Śīkṣā). Just as the upright human
being is firmly supported on the feet, and just as the movement of a human being depends on the swiftness of the
feet, just so is prosody conceived to be the very base of the Veda and one’s progress in Vedic knowledge depends on
one’s proficiency in the science of metres.
The oldest extant comprehensive treatise specifically on the science of metres is the prosody text Chandaḥ-sūtra
(also referred to as Chandaḥ-śāstra) of Piṅgalācārya. The date of this text is uncertain; most tentative estimates vary
from 500 to 200 BCE, with 300 BCE being the usually preferred date. The text has around 315 sūtras spread over
eight chapters. They have been commented upon by Halāyudha (c. 950 CE) and Yādavaprakāśa (c. 1050).
Mathematical ideas occur most prominently in the last 15 sūtras (8.20–8.34) of the last (eighth) chapter of the
Chandaḥ-sūtra. We shall now see how mathematical questions arise naturally in this treatise.
In Sanskrit prosody, there are two kinds of akṣara (syllables, i.e., units of pronunciations): laghu (light, short) and
guru (heavy, long). For convenience we shall denote any laghu syllable by L and any guru syllable by G. Any Sanskrit
metre with n syllables may thus be viewed as a sequence of length n, each entry being either an L or a G.
A syllable is a guru if it is a long vowel, or (even if it is a short syllable) if what follows is a conjunct consonant, an
anusvāra, or a visarga. Otherwise, a syllable is a laghu. For instance, the sequence “sra-ṣṭu-rā-dhyā-va-ha-ti”
corresponds to GLGGLLL. Here the first syllable is G as it is followed by the conjunct consonant ṣṭ, the second
syllable is L as it is the short vowel u, each of the next two syllables is G as it is the long vowel \=a, the remaining
three syllables are L as they are short vowels a, a, i respectively.
We now discuss some of the mathematical problems addressed by Piṅgalācārya. The order in which the problems
are listed below is not the same as the order in Piṅgala’s text.
Problem. Find an efficient algorithm for computing the total number of metrical patterns (or rows) with n syllables.
Since the basic unit (syllable) of a Sanskrit metre is of two possible types: L or G, the total number of metrical
patterns with n syllables is 2 × ⋯ × 2 (n number of 2’s), i.e., 2n . Problem 1 therefore is to find an efficient
algorithm to compute 2n . In sūtras 8.28–8.31, Piṅgalācārya describes his algorithm, called saṅkhyā, for quickly
computing this number using a combination of squaring and doubling.
Piṅgalācārya’s algorithm generates from the given n, a sequence of 2’s and 0’s as follows:
n
1. If n is even, consider 2 and mark “2” (dvirardhe).
2. If n is odd, consider n − 1 and mark “0” (rūpe śūnyam).
One has to repeat the above process with the obtained number ( n2 or n − 1). Since any strictly decreasing sequence
of positive integers must terminate, the process will stop after a finite number of steps. A little reflection will show
that one will eventually reach 1 so that the last step in the above process will be 1 − 1 = 0.
Now starting from 1, construct a reverse sequence by doubling an obtained entry for each mark 0 (dviḥ śūnye) and by
squaring an obtained entry for each mark 2 (tāvad ardhe tad guṇitam). Then the last entry in the reverse sequence is
2n .
For instance, for n = 11, the algorithm prescribes: subtract 1 from 11 (put zero-mark); then divide 10 by 2 (put
two); then subtract 1 from 5 (mark it by zero); then divide 4 by 2 (put two) and then 2 by 2 (put two) and finally,
subtract 1 from 1 (mark it by zero). Reversing, we obtain successively 2, 22 , (22 )2 , (22 )2 × 2, [(22 )2 × 2]2 and
[(22 )2 × 2]2 × 2(= 211 ).
11 (odd) Subtract by 1 0
10 (even) Divide by 2 2
5 (odd) Subtract by 1 0
4 (even) Divide by 2 2
2 (even) Divide by 2 2
1 (odd) Subtract by 1 0
0 Stop
11 0 2 × (2 × (22 )2 )2 (= 211 )
10 2 (2 × (22 )2 )2 (= 210 )
5 0 2 × (22 )2 (= 25 )
4 2 (22 )2 (= 24 )
2 2 22
1 0 2×1
0 1
We now note several striking features of Piṅgala’s saṅkhyā algorithm.
𝑚
2𝑚 = (2 2 )2 when 𝑚 is even and
2𝑚 = 2(2𝑚−1 ) when 𝑚 is odd.
In Part 1, we had seen that certain constructions of Vedic fire-altars involve geometric formulations of algebra
identities like ab = ( a+b
2
)2 − ( a−b
2
)2 . Here, in the study of Sanskrit metres, we come across the implicit use of
more advanced algebra formulae. What is remarkable is that all these developments were taking place before the
facilities of the formal language of algebra had emerged.
Second, Piṅgala’s saṅkhyā algorithm is an early instance of the “divide and conquer” strategy which is now standard
in computer science. A “divide and conquer” algorithm in computer science refers to the technique of recursively
breaking down a problem into sub-problems of the same or related type, until the sub-problems become simple
enough to be solved directly; the sub-problems are then combined to produce an efficient algorithmic solution to
the original problem.
Here, for computing N = 211 , the fact that 11 = 2 × 5 + 1 is utilized to reduce the original problem to that of
computing M = 25 . Once the number M is known, it can be squared to get M 2 = 210 and then M 2 can be
doubled to get
2M 2 = (25 )2 × 2 = 22×5+1 = 211 = N .
Similarly, to obtain M = 25 , one uses 5 = 2 × 2 + 1, to reduce the problem to computing 22 , and so on.
This “divide and conquer” type strategy can again be seen in later Indian landmark achievements like the kuṭṭaka
algorithm of Āryabhaṭa (499 CE) for finding integer solutions of linear equations with integer coefficients, which too
prescribes a reversal as we see in Piṅgala’s saṅkhyā algorithm where one first moves down from top to bottom in a
column, and then moves up from bottom to top in an adjacent column. The kuṭṭaka algorithm contains the seeds of
the famous idea of “descent” developed by Fermat in the 17th century. It has been discussed in [13] and will again be
discussed in a later part of this series.
Third, as we shall see in the next part of this series, Piṅgala’s saṅkhyā algorithm is an important landmark in our
present (incomplete) knowledge about the early history of zero in India. It makes an explicit mention of śūnya
(zero) as a distinct label along with dvi (two), a strong indication that Indians had a symbol for zero by the time of
Piṅgala.
Though apparently the zero is used only as a label, this occurrence of śūnya (zero) in a mathematical context, on the
same footing as the number “two”, suggests that zero had already been conceptualized as a number. In a later part of
the series we shall see that zero has been explicitly treated as a number in the treatise of Brahmagupta (628 CE).
Piṅgala could have chosen any two labels – why did he select the symbols for two and zero? Denoting the number
reached at certain stage to be m, we see there are two mutually exclusive possibilities:
It is likely that the use of the symbol for two for the first possibility came up since the number m is divisible by two.
In the second case, zero might have been suggested by the “absence” of the facility of division by two. It might also
have been suggested by the prospect of “subtraction by 1” and the realization that repeated subtraction by one will
eventually lead to zero.
Again though there is no explicit mention of the final outcome of the “halve or subtract one according as the
number is even or odd” process, the circumstantial evidence raises a strong possibility that the relation 1 − 1 = 0
had been visualized as the final step of this process.
Piṅgalācārya’s algorithm for computing 2n became the standard method for computing powers in Indian
mathematics. The algebraic brilliance of this algorithm shines clearly.
Problem. Find a formula that yields the total number of metrical patterns with at most n syllables.
Let Sn denote the total number of metrical patterns with n syllables, i.e., let Sn = 2n . The above problem is then to
determine the sum S1 + S2 + S3 + ⋯ + Sn .
Sūtras 8.32 and 8.33 respectively give the recurrence relations S1 + S2 + S3 + ⋯ + Sn = 2Sn − 2 and
Sn+1 = 2Sn which together solve the above problem and, in the process, imply the formula for the sum of the
Geometric Progression (G.P.) series:
S1 + S2 + S3 + ⋯ + Sn = 2 + ⋯ + 2n = 2n+1 − 2.
Problem. Describe a systematic procedure by which all possible metrical patterns with n syllables get laid out
sequentially as an array.
Such a procedure is described by Piṅgala in sūtras 8.20–8.23; the procedure is called prastāra, a key term in the
mathematical study of Sanskrit metres. Literally, prastāra means “spreading out”; in the study of metres, a prastāra
has come to mean a layout or an enumeration of all the possible combinations of laghu and guru akṣara in metres
having a given number of syllables. In our notation, Piṅgala’s prastāra is a systematic procedure for listing all
sequences of L and G of length n. We illustrate his inductive algorithm for constructing the prastāra.
1 G
2 L
In the 2-syllable prastāra, the first two rows are obtained by attaching a G at the right of each of the above, and the
next two rows by attaching an L at the right of the above rows, as follows:
1 G G
2 L G
3 G L
4 L L
In the 3-syllable prastāra, the first four and the next four rows are obtained by attaching a G or an L respectively at
the right of the 4 rows of the 2-syllable prastāra:
1 G G G
2 L G G
3 G L G
4 L L G
5 G G L
6 L G L
7 G L L
8 L L L
Likewise, for any n, the n-syllable prastāra is constructed from the (n − 1)-syllable prastāra: the first 2n−1 rows are
formed by attaching a G at the end of each row of the (n − 1)-syllable prastāra and the next 2n−1 rows are formed
by attaching an L at the end of each row of the (n − 1)-syllable prastāra. Thus, the 4-syllable prastāra is:
1 G G G G
2 L G G G
3 G L G G
4 L L G G
5 G G L G
6 L G L G
7 G L L G
8 L L L G
9 G G G L
10 L G G L
11 G L G L
12 L L G L
13 G G L L
14 L G L L
15 G L L L
16 L L L L
Note that if r is the row number of a row a1 a2 … an−1 in the (n − 1)-syllable prastāra, then, in the (n)-syllable
prastāra, the row number of the row a1 a2 … an−1 G will remain r and the row number of the row a1 a2 … an−1 L
will be r + 2n−1 . For instance, the row number of GGL is 5; the row number of GGLG is 5; and the row number of
GGLL is 13 = 5 + 23 .
By this procedure, all possible metres of a certain length get labelled or coded by a unique natural number, namely
the row number of the metric pattern. For instance, from the prastāra displayed above, we see the assignment
GGGG → 1, GLLG → 7, LLGL → 12.
We now show the connection between the metric pattern in a certain row r of the prastāra and the binary
representation of r − 1.
Set G:= 0 and L:= 1 so that each metric pattern gets represented as a sequence of 1’s and 0’s. Let r be the row
number of a metric pattern a1 a2 … an . Then we claim that the mirror reflection an … a1 is precisely the binary
representation of r − 1, i.e.,
For instance, consider the 3-syllable row LLG = 110. Its row number is 4. Now the mirror reflection 011 is indeed
the binary representation of 3 (= 4 − 1) = 1 × 2 + 1. Again, consider the 4-syllable row LLGL = 1101. Its row
number is 12. Its mirror reflection 1011 is the binary representation of 11 (= 12 − 1) = 1 × 23 + 1 × 2 + 1.
The following table illustrates the relationship between Piṅgala’s prastāra and binary representations. To the left is a
copy of the 4-syllable prastāra with entries G and L, followed by another copy of the 4-syllable prastāra with entries
0 and 1 respectively, followed by a mirror image of the latter. Each row in this mirror image is a binary representation
of the number in the last column of that row.
1 G G G G 0 0 0 0 0 0 0 0 0
2 L G G G 1 0 0 0 0 0 0 1 1
3 G L G G 0 1 0 0 0 0 1 0 2
4 L L G G 1 1 0 0 0 0 1 1 3
5 G G L G 0 0 1 0 0 1 0 0 4
6 L G L G 1 0 1 0 0 1 0 1 5
7 G L L G 0 1 1 0 0 1 1 0 6
8 L L L G 1 1 1 0 0 1 1 1 7
9 G G G L 0 0 0 1 1 0 0 0 8
10 L G G L 1 0 0 1 1 0 0 1 9
11 G L G L 0 1 0 1 1 0 1 0 10
12 L L G L 1 1 0 1 1 0 1 1 11
13 G G L L 0 0 1 1 1 1 0 0 12
14 L G L L 1 0 1 1 1 1 0 1 13
15 G L L L 0 1 1 1 1 1 1 0 14
16 L L L L 1 1 1 1 1 1 1 1 15
The above table also explains why the number assigned by Piṅgala’s prastāra to a binary representation of a number
m becomes m + 1 and not m. We usually order rows as 1, 2, 3, …. In the prastāra too, the count of the row-
number starts from 1 (and not 0) as is the normal practice. However, the first row GGG or 000 is the binary
representation of 0 (and not 1). Thus, there is a difference of 1.
Equation (3) can be easily proved by induction on n. It is evidently true for n = 1 since G has row number 1 and
value 0 = 1 − 1 while L has row number 2 and value 1 = 2 − 1.
Now assume (3) holds for all metres of length at most n − 1. Consider a metre M of length n represented as
a1 a2 … an and let M′ denote the metre of length n − 1 formed by the first n − 1 syllables of M, i.e., M′ is
represented as a1 a2 … an−1 . Let r be the row number of M.
Case 1. The metre M ends in G, i.e., an = 0. In this case, the row number of M′ will again be r. Therefore, by
induction hypothesis,
−2
r − 1 = 2n−2 an−1 + ⋯ + 2a2 + a1 .
Case 2. The metre M ends in L, i.e., an = 1. In this case, the row number of M′ will be r − 2n−1 . Therefore, by
induction hypothesis,
(r − 2n−1 ) − 1 = 2n−2 an−1 + ⋯ + 2a2 + a1 .
Since an = 1, i.e., 2n−1 = 2n−1 an , the above equality shows that the relation (3) holds.
The row number of a metric pattern acts as its code or label or rank.
Suppose some row in a prastāra gets destroyed (“naṣṭa”) but its code, i.e., its row-number is known. Can the lost
metric pattern be recovered from its code? If so, how? Thus, we are led to the problem:
Problem. Describe an algorithm which will recover a metric pattern in the prastāra from its row-number.
Piṅgala’s decoding algorithm called naṣṭa, described in sūtras 8.24–8.25, recovers a metric pattern from its row
number. It may be formulated as follows:
r1 +1
If r1 is odd, write G as the first syllable from the left and define r2 = 2 .
2. Repeat the process, replacing r1 above by r2 to define r3 .
3. Proceed likewise till all the syllables of the metre are obtained.
For instance, suppose we are to determine the 4-syllable metric pattern whose row number is 12. Then the steps are:
12
1. r1 = 12 is even. Hence the first syllable from the left is L and r2 = 2 = 6.
2. r2 = 6 is even. Hence the second syllable from the left is L and r3 = 62 = 3.
3. r3 = 3 is odd. Hence the third syllable from the left is G and r4 = 3+1
2
= 2.
4. r4 = 2 is even. Hence the fourth syllable from the left is L.
5. Thus, the metric pattern is LLGL.
The metric pattern LLGL corresponds to 1101 whose mirror image 1011 is the binary representation of 12 − 1 = 11
as we had seen in the subsection on binary expansion in the previous section.
It is easy to see how the naṣṭa algorithm works. We denoted the row number of the (unknown) metric pattern
The reader might have noticed that Piṅgala’s naṣṭa algorithm is the same as the algorithm described in the Exercise
in the subsection on binary expansion which was a modification of the usual algorithm for writing the binary
representation of a number. In fact, the argument presented above is practically a solution to the Exercise. The slight
modification becomes necessary because the row number assigned by Piṅgala’s prastāra to a binary representation
of a number m is m + 1 and not m, as discussed earlier.
The reader might have also noticed some similarity between the naṣṭa algorithm and one of the steps of Piṅgala’s
saṅkhyā algorithm discussed earlier.
Piṅgala’s prastāra assigns a code to every metrical pattern, namely its row-number in the prastāra. This leads to:
Problem. Describe an algorithm which will determine from a given metric pattern in the prastāra its row-number
(without having to write down the prastāra).
Piṅgala’s coding algorithm called uddiṣṭa, described in sūtras 8.26–8.27, computes the row-number from its metric
pattern. The algorithm can be understood in the light of the close relationship between a row-number and the
binary representation of its preceding number.
Before describing Piṅgala’s method, we describe an alternative procedure described by Kedārabhaṭṭa around 1000
CE which brings out the relation between the metrical pattern and the binary representation, more clearly.
1 2 22 23
L L G L
yielding the row-number (1 + 2 + 23 ) + 1 = 12. Why the algorithm works, and its connection with binary
representation, is really straightforward here and left to the reader.
1. Start with 1.
2. Now keep moving from right to left. Suppose you have obtained a number m at a certain stage. If L occurs at
the next stage, then consider 2m, but if G occurs at the next stage, then consider 2m − 1.
3. Continue the process. The final number obtained is the row number.
Note that we can locate the first L from the right and begin the process from there, ignoring the G’s (if any) to the
right of the first L (as m will remain 1 for those G’s).
1. The first L here occurs as the second syllable from the right. We start from here with the number 2.
2. The next syllable is L. So we get 2 × 2 = 4.
3. The process terminates with the next syllable G. So the row number is (4 × 2) − 1 = 7.
Again by an induction argument, one can see why Piṅgala’s uddiṣṭa algorithm works for every metre of length n, for
each n, i.e., the number obtained by the algorithm is the correct row number.
The case n = 1 is easy to see since the row numbers for G and L are 1 and 2 respectively.
We may now fix n > 1 and assume the result for every metre of length less than n. Let bn , bn−1 , … , b1 be the n
entries (from left to right) in a metric pattern M of length n, each bi being either 1 (corresponding to L) or 0
(corresponding to G), let r denote the correct row number of M and u denote the (row) number of M computed
by the uddiṣṭa algorithm; we need to show that u = r.
We have seen earlier (Equation (3)) that the binary expansion of r − 1 is given by the mirror reflection b1 b2 … bn ,
i.e.,
r − 1 = 2n−1 b1 + 2n−2 b2 + ⋯ + bn .
Let M′ denote the metric pattern obtained from M by omitting the first entry bn , i.e., M′ is the metric pattern
bn−1 … b1 . Let u′ be the row number of M′ as computed by the uddiṣṭa algorithm.
Now we first consider the case bn = 1, i.e., the first entry of M from the left is given by L. In this case, u = 2u′ by
the uddiṣṭa algorithm and hence we have,
𝑢 = 2𝑢′ = 2𝑛−1 𝑏1 + ⋯ + 2𝑏𝑛−1 + 2
= 2𝑛−1 𝑏1 + ⋯ + 2𝑏𝑛−1 + 𝑏𝑛 + 1 = 𝑟.
′
Next, we consider the case bn = 0, i.e., the first entry from the left in M is given by G. In this case, u = 2u′ − 1 by
the uddiṣṭa algorithm. Therefore,
𝑢 = 2𝑢′ − 1 = 2𝑛−1 𝑏1 + ⋯ + 2𝑏𝑛−1 + 2 − 1
= 2𝑛−1 𝑏1 + ⋯ + 2𝑏𝑛−1 + 𝑏𝑛 + 1 = 𝑟.
One marvels at the algebraic depth and skill required to invent algorithms like naṣṭa and uddiṣṭa.
In a keynote address at a conference on Mathematics in India organised by the Ministry of Culture, Government of
6
India and AICTE, on 25 February 2022, Manjul Bhargava had listed ten fundamental contributions by Indian
mathematicians (beyond zero) which everyone should know. The seventh in his list was the binomial coefficient
n
Cr which now plays an extremely important role in probability theory, combinatorics, number theory and many
other areas.
The Indian medical treatises of Caraka and Suśruta (prior to 500 BCE) discuss certain questions on the various
combinations that arise from the 6 primary rasas (tastes) and, in that context, give the numerical values of 6 Cr for
each r, 1 ≤ r ≤ 6, and their sum 6 C1 + ⋯ + 6 C6 (= 63).
Problem. Describe an efficient procedure to find the number of metrical forms with a given number of syllables n
of which exactly r are laghu syllables, i.e., to find a procedure to determine n Cr .
For determining n Cr , Piṅgala describes a practical method named lagakriyā (or galakriyā); the letters la and ga
being the first letters of laghu and guru respectively. His description is too terse. Commentators like Halāyudha (c.
950 CE) have explained his method as a pyramidal arrangement of the numerical values of n Cr called Meru-
prastāra. It is essentially the same as the famous “Pascal’s triangle” described in Europe in the seventeenth century
by P.Herigone (1634 CE) and B.Pascal (1654 CE). The diagram below illustrates this.
Even before Halāyudha, Virahāṅka (c. 600 CE) has described a Meru-prastāra which is almost the same as in
Halāyudha. Still earlier, Varāhamihira (c. 550 CE) had described an interesting variant which we describe at the end
of this subsection.
Piṅgala’s sūtra 8.34 is usually interpreted as his lagakriyā method; however Jayant Shah argues [19] that the lagakriyā
is actually implied in some other sūtra of Piṅgala’s Chandaḥ-sūtra in its Yajur recension (8.23b).
The Indian lagakriyā pyramid (equivalently, Pascal’s triangle) is described in the following diagram. Each row
contains all the n Cr ‘s for a fixed n, arranged in increasing order of r. 1 is at the vertex of the triangle, the next row
has two entries (both 1) corresponding to 1 C0 and 1 C1 , the subsequent row has three entries 2 C0 = 1, 2 C1 = 2,
2
C2 = 1, and so on. The entries in each row are written quickly in terms of the entries of the preceding row, using
n+1
C0 = n+1 Cn+1 = 1 and the recurrence relation n+1 Cr = n Cr−1 + n Cr .
4 4 4 3 3
4 4 4
For instance, the row with entries Cr is obtained as C0 = 1, C1 = 1 + 3(= 3 C0 + 3 C1 ) = 4,
4
C2 = 3 + 3(= 3 C1 + 3 C2 ) = 6, etc.
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
⋮
Meru-prastāra or Pascal’s Triangle for n Cr
Meru refers to a “mountain”; thus Meru-prastāra is a diagram which resembles a well-spread-out mountain with a
peak, a fitting description of the arrangement.
The crucial principle at the heart of Piṅgala’s Meru-prastāra or Pascal’s triangle is again an algebraic formula: the
recurrence relation n+1 Cr = n
Cr−1 + n Cr .
We illustrate Varāhamihira’s table. In each column the entries are filled from below to top. The first column lists the
n
C1 = n, the natural numbers, from n = 1 to n = 16. The next column lists the n+1 C2 (= the sum of natural
numbers from 1 to n) from n = 1 to n = 15. They are filled up successively by diagonal addition using
n+1
C2 = n C2 +n C1 , for instance, 3 = 1 + 2, 6 = 3 + 3, 10 = 6 + 4, 15 = 10 + 5 etc. The third column
lists the n+2 C3 from n = 1 to n = 14 using n+1 C3 = n C3 +n C2 , for instance,
4 = 1 + 3, 10 = 4 + 6, 20 = 10 + 10, 35 = 20 + 15 etc. Similarly the fourth column lists the n+3 C4 from
n = 1 to n = 13: 5 = 1 + 4, 15 = 5 + 10, 35 = 15 + 20, 70 = 35 + 35 and so on, till finally we have the
required 16 C4 = 15 C4 + 15 C3 = 1365 + 455 = 1820.
16
15 120
14 105 560
13 91 455 1820
12 78 364 1365
11 66 286 1001
10 55 220 715
9 45 165 495
8 36 120 330
7 28 84 210
6 21 56 126
5 15 35 70
4 10 20 35
3 6 10 15
2 3 4 5
1 1 1 1
Varāhamihira’s table for Gandhayukti
One can see that Varāhamihira’s table is simply a suitably rotated version of the Meru-prastāra or Pascal’s Triangle
displayed earlier after ignoring the 1’s at the beginning of each row of the latter. To see this, consider the line formed
by the second entry in each row of the Meru-prastāra, i.e., all the n C1 ’s from n = 1 onwards. The entries are
1, 2, 3, 4, 5, 6, 7, …. Rotate it to make it a vertical column with 1 at the base. Then one gets the first column of
Varāhamihira’s table. Likewise, consider the next parallel line in the Meru-prastāra formed by the third entries i.e.,
the n C2 ’s from n = 2 onwards, i.e., 1, 3, 6, 10, 15, 21, …. Rotating it suitably gives the second column of
Varāhamihira’s table.
The mathematical ideas in Piṅgala’s Chandaḥ-sūtra had a profound impact on the development of numerous
combinatorial algorithms and results by post-Vedic Indian mathematicians. It is a vast topic. We briefly mention one
combinatorial problem, which arose from the study of metres, and which led to Virahāṅka’s work on what are
usually referred to as “Fibonacci numbers”. In his talk on 25.2.2022 mentioned earlier, Manjul Bhargava mentioned
the Virahāṅka–Fibonacci sequence as the eighth among the ten fundamental Indian contributions to mathematics
that everyone should know.
We first define the “mātrā” of a metre. Assign to each laghu syllable the “mātrā” value 1 and to each guru syllable the
“mātrā” value 2. The mātrā of any metrical form is defined to be the sum of the mātrā values of each syllable in the
metre.
The mātrā-vṛtta is the analysis (classification etc) of metrical patterns by their mātrā. The topic is briefly touched
upon by Piṅgala in Chapter 4 of his treatise and then in Nātyaśāstra of Bharata (c. 200 BCE); it is discussed more
elaborately by Virahāṅka in his Prākṛta text Vṛtta-jāti-samuccaya (c. 600 CE) and subsequent prosodists.
A natural question taken up in Indian prosody from at least the time of Virahāṅka is:
Problem. Find the total number of metrical forms Vn with a given mātrā value n.
Vn = Vn−1 + Vn−2 .
To see this, consider the last syllable c. There are two mutually exclusive possibilities:
1. c is laghu, i.e., it has mātrā value is 1. In this case, the sum of the mātrā values of the preceding syllables is
n − 1. This can happen in Vn−1 ways.
2. c is guru, i.e., it has mātrā value 2. In this case, the sum of the mātrā values of the preceding syllables is n − 2.
This can happen in Vn−2 ways.
n 1 2 3 4 5 6 7 8 9 10
Vn 1 2 3 5 8 13 21 34 55 89
Virahāṅka sequence Vn
The Piṅgala-inspired Virahāṅka numbers Vn are now known as “Fibonacci numbers” after Leonardo Pisano (c. 1200
CE), nicknamed Fibonacci (meaning, son of Bonacci).
There are other combinatorial problems on mātrā-vṛtta, analogous to Piṅgala’s prastāra, naṣṭa, uddiṣṭa and
lagakriyā, discussed by Virahāṅka and subsequent authors.
An anecdote on Piṅgala
Piṅgala is highly venerated in ancient traditions and referred to as a Muni, an Ācārya and a Nāga. Recall that Nāga
means serpent as also the best or excellent of any kind. Serpent sometimes symbolizes wisdom, and hence a person
endowed with great wisdom could be reverentially mentioned as a Nāga. Legends surrounding Piṅgala appear to
indulge in a double entendre involving the word Nāga.
Piṅgala attained legendary fame for his scholarship and brilliance. There is a proverbial simile: “as shrewd as
Piṅgala”. It is said of a person who tactfully accomplishes his mission: “He has studied Piṅgala”. There is an
interesting story on Piṅgala’s presence of mind which enables him to escape death ([6], p. 75).
After a long journey across mountains and forests, a serene Piṅgala, while on his return journey, was suddenly
confronted with Garuḍa, who had enmity with Piṅgala’s family. When the hungry Garuḍa was about to devour him,
Piṅgala humbly pleaded with Garuḍa,
Oh, King of Birds, please listen to me. If you kill me now, then, along with me, the Chandaḥśāstra—a
unique Vedāṅga—too will get destroyed forever. So I implore, please listen to this Śāstra first and
then kill me.
Garuḍa got curious and agreed to listen. As Piṅgala began his narration, Garuḍa got fascinated by the Chandaḥśāstra
and its mathematical presentations, and listened eagerly.
While explaining the science, Piṅgala kept on drawing long prastāra diagrams directed towards the seashore and in
the process steadily moved towards the sea. Through mathematical lines comprising symbols, Piṅgala described the
four “yakāra” that are involved in the metre named bhujaṅgaprayāta. This metre, mentioned in Chapter VI Sūtra 43
of Piṅgala’s Chandaḥ-sūtra, too originated in the Ṛgveda. (For instance, the phrase in Ṛgveda X.167.1 : “sahasraṃ ta
indrotayo naḥ sahasram”.) Note that bhujaṅga means serpent and prayāta means vanished, departed, gone, etc.,
On reaching the sea, Piṅgala utters “bhujaṅgaprayāta” and escapes into the pātāla (nether world) through the sea
route. Even at a critical moment in the face of death, the witty Piṅgala indulges in a pun: mentioning
bhujaṅgaprayāta both as the term for a specific metre as well as a statement that the Nāga vanishes.
The above tale not only shows that Piṅgala’s work was held in high esteem, it also shows that mathematics was
considered important, charming and interesting. A folklore could be created from a perception that the
mathematical aspects of Piṅgala’s treatises were so captivating and absorbing, that they could even be used to
distract a sworn enemy from a vengeful act. The story brings out the zest for all-round learning. Garuḍa had lust for
food, and lust for revenge; but much more compelling was his lust for knowledge, and that too knowledge of a
mathematical flavour!
References
We are not sure whether it will be possible to discuss the rich combinatorial mathematics that developed in post-
Vedic India in the present series. We, therefore, give below only a few references.
A concise account of combinatorial algorithms arising in India out of prosody, music and other themes, can be
obtained from the following lectures by M.D.Srinivas in the NPTEL course on “Mathematics in India from Vedic
Period to Modern Times”: Lecture 5 (Piṅgala’s Chandaḥ-śāstra); Lectures 18 and 19 (Development of Combinatorics
in India 1 and 2).
The papers [25] and [19] discuss Piṅgala’s combinatorial work and the paper [26] discusses the Virahāṅka-Fibonacci
numbers.
Apart from Indian prosody, the theory of Indian music involves sophisticated combinatorial procedures. The paper
[20] discusses combinatorial questions and methods in Indian musicology studied in Saṅgītaratnākara of
Sārṅgadeva (c. 1225 CE), a celebrated treatise on music.
Numerous combinatorial results occur in the treatises of post-Vedic Indian mathematicians like Brahmagupta (628
CE), Śrīdharācārya (750 CE), Mahāvīra (850 CE), Bhāskarācārya (1150 CE) and Nārāyaṇa Paṇḍita (c. 1350 CE). The
paper [23] illustrates some astonishingly modern approaches in the combinatorial work of Nārāyaṇa Paṇḍita.
Sophisticated algorithms of combinatorial flavour also occur in Indian works on magic squares. It is again a vast
topic. Some examples can be seen in [21] and [22].
References
[1] Sri Aurobindo, The Secret of the Veda, Sri Aurobindo Birth Centenary Library (SABCL) Vol. 10, Sri Aurobindo
Ashram, Pondicherry (1972). Originally appeared in the Arya in 24 instalments from August 1914 to July 1916.
[2] A.L. Basham, The Wonder that was India, Sidgwick and Jackson, London (1954).
[3] B. Bavare and P.P. Divakaran, Genesis and Early Evolution of Decimal Enumeration: Evidence from Number
Names in Ṛgveda, Indian Journal of History of Science 48(4), 535–581 (2013).
[4] N.L. Biggs, The Roots of Combinatorics, Historia Mathematica 6, 109–136 (1979).
[5] N.L. Biggs, E.K. Lloyd and R.J. Wilson, The History of Combinatorics, Handbook of Combinatorics Vol. 2 (eds. R.
Graham, M. Grötschel and L. Lovász), Elsevier (1995).
[7] B. Datta, The Science of the Śulba, University of Calcutta (1932); Cosmo Pub. (1993).
[8] B. Datta and A.N. Singh, History of Hindu Mathematics Part I, Motilal Banarsidass (1935); reprinted by Asia
Publishing House (1962) and Bharatiya Kala Prakashan (2004).
[9] P.P. Divakaran, Notes on Yuktibhāṣā: Recursive Methods in Indian Mathematics, Studies in the History of Indian
Mathematics (ed. C.S. Seshadri), Hindustan Book Agency, New Delhi (2010).
[10] P.P. Divakaran, What is Indian about Indian Mathematics? Indian Journal of History of Science 51(1), 56–82
(2016).
[11] P.P. Divakaran, The Mathematics of India: Concepts, Methods, Connections, Hindustan Book Agency, New Delhi
(2017).
[12] A.K. Dutta, Powers of Ten: Genesis and Mystic Significance. Srinvantu 58(2), 44–52 (2008). Reprinted in Mother
India LXII(11), 957–967 (2009) & Vedic Venues 2, 43–56 (2013).
[13] A.K. Dutta, Kuṭṭaka, bhāvanā and Cakravāla, Studies in the History of Indian Mathematics (ed. C.S. Seshadri),
Hindustan Book Agency, New Delhi, 145–199 (2010).
[14] A.K. Dutta, Decimal System in India, Encyclopaedia of the History of Science, Technology, and Medicine in Non-
Western Cultures (ed. H. Selin), Springer (2015).
[15] A.K. Dutta, Was there sophisticated mathematics during Vedic Age? Platinum Jubilee Memorial Volume,
Ramakrishna Mission Vidyamandira, Belur Math, 361–385 (2016).
[16] A.K. Dutta, The bhāvanā in Mathematics, Bhāvanā 1(1), 13–19 (2017).
[17] A.K. Dutta, Weighted Arithmetic Mean in Ancient India, Bhāvanā 1(4), 24–36 (2017).
[18] G. Ifrah, The Universal History of Numbers, John Wiley and Sons (2000).
[19] J. Shah, A History of Piṅgala’s Combinatorics, Gaṇita Bhāratī 35, 1–54 (2013).
[20] Raja Sridharan, R.Sridharan and M.D.Srinivas, Combinatorial Methods in Indian Music: Pratyayas in
Saṅgītaratnākara of Sārṅgadeva, Studies in the History of Indian Mathematics (ed. C.S. Seshadri), Hindustan Book
Agency, New Delhi, 55–112 (2010).
[21] Raja Sridharan and M.D.Srinivas, Study of Magic Squares in India, Math Unlimited: Essays in Mathematics (eds.
R.Sujatha, H.N.Ramaswamy, C. S.Yogananda), Taylor & Francis, London, 383–391 (2011).
[22] Raja Sridharan and M.D.Srinivas, Folding Method of Nārāyaṇa Paṇḍita for the Construction of Samagarbha and
Viṣama Magic Squares, Indian Journal of History of Science 47, 589–605 (2012).
[23] Raja Sridharan, R.Sridharan and M.D.Srinivas, Nārāyaṇa Paṇḍita’s enumeration of combinations and associated
representations of numbers as sums of binomial coefficients, Indian Journal of History of Science 47, 607–631 (2012).
[24] Raja Sridharan, R.Sridharan and M.D.Srinivas, Nārāyaṇa’s Generalisation of Mātrā-vṛtta-prastāra and the
Generalised Virahāṅka-Fibonacci Representation of Numbers, Indian Journal of History of Science 50(2), 227–244
(2015).
[25] R.Sridharan, Sanskrit Prosody, Piṅgala Sūtras and Binary Arithmetic, Contributions to the History of Indian
Mathematics (ed. G.G. Emch, R. Sridharan, M.D. Srinivas), Hindustan Book Agency, New Delhi (2005).
[26] R.Sridharan, Pratyayas for Mātrāvṛttas and Fibonacci Numbers, Mathematics Teacher 42, 120–137 (2006).
[27] Swami Vivekananda, Complete Works, Advaita Ashram, Kolkata (10th ed. 2012).
Footnotes
Amartya Kumar Dutta is at the Stat-Math Unit of the Indian Statistical Institute, Kolkata. He is a corresponding
editor of Bhāvanā.