With thanks to Phil Krause
Pingala (पिङ्गल piṅgala) is the traditional name of the author of the Chandaḥśāstra (also Chandaḥsūtra), the earliest known Sanskrit treatise on prosody.
Nothing is known about Piṅgala himself. In Indian literary tradition, he is variously identified either as the younger brother of Pāṇini (4th century BCE), or as Patañjali, the author of the Mahābhāṣhya (2nd century BCE).
The chandaḥśāstra is a work of eight chapters in the late Sūtra style, not fully comprehensible without a commentary. It has been dated to either the final centuries BCE or the early centuries CE, at the transition between Vedic meter and the classical meter of the Sanskrit epics. This would place it close to the beginning of the Common Era, likely post-dating Mauryan times. The 10th century mathematician Halayudha wrote a commentary on the chandaḥśāstra and expanded it.
The chandaḥśāstra presents the first known description of a binary numeral system in connection with the systematic enumeration of meters with fixed patterns of short and long syllables. The discussion of the combinatorics of meter corresponds to the binomial theorem. Halāyudha’s commentary includes a presentation of the Pascal’s triangle (called meruprastāra). Pingala’s work also contains the basic ideas of Fibonacci number, called mātrāmeru, and now known as the Gopala–Hemachandra number.
Use of zero is sometimes mistakenly ascribed to Pingala due to his discussion of binary numbers, usually represented using 0 and 1 in modern discussion, while Pingala used short and long syllables. As Pingala’s system ranks binary patterns starting at one (four short syllables—binary “0000”—is the first pattern), the nth pattern corresponds to the binary representation of n-1, written backwards. Positional use of zero dates from later centuries and would have been known to Halāyudha but not to Pingala