Discussions in India of the different possibilities for selecting and ordering elements in a given collection of items date back to at least the first millennium B.C.E., when texts prescribed systematic ways of rearranging the syllables of sacred invocations. Other types of literature from the last few centuries B.C.E. and the first few centuries C.E. contain information on selecting and ordering various elements, including works on religious law and the famous treatise on sexology, the Kāmasūtra. However, permutations and combinations made their initial appearance as the subject of generalized computational techniques in texts on prosody (metrics). Not until the middle of the first millennium C.E. did the subject make it into treatises on mathematics, eventually getting the name aṅkapāśa (net of digits).