Agni Purāṇa

91 - Different kinds of mantras for the worship of God: 

The Lord said: 

1. Oneshould worship lordshiva, (lord) Vishņu and other gods such as Bhaskara (Sun) after being anointed, accompanied by the sounding of the conch, bheri (a kind of kettle-drum) and bathe (the images) with five things got from a cow. 

2-3. Whoever (worships) gods (in this manner) goes to heaven and elevates his departed manes. Whatever sin has accrued to him in the course of millions of years gets reduced to ashes in the fire by anointing gods with ghee. Whoever bathes gods with an adhaka (two maunds) of ghee etc. becomes a celestial. 

4-6. After having applied sandal paste, (the lord)should be worshipped with perfumes etc. The gods praised with hymns with little effort always confer ability to know past and future events, proficiency in mantra, enjoyment and emancipation. 

7. Having taken principal letters of the mantras, if they are divisible by two, (oneshould know) (whether they are) auspicious or inauspicious. (If divisible) by three (they denote) jiva, müla and dhatu, (and if divisible) by four (they denote the four castes) brahmin etc. (Divisible) by five denote the five principles (elements) (earth etc.). So also for muttering (the mantras) etc. (oneshould find whether they are auspicious or inauspicious). If the mantra consisting of groups of three letters happens to have the letters pa, ma and ka and letter ma comes in the middle it is inauspicious. Lord Indra and a king occurring in the middle are auspicious. 

8-9. Oneshould write the mantras of Sūrya, Ganapati,shiva, Durgā (shaivite goddess), Śhri (consort of Vishnu) and Vishnu in a Iotus. Oneshould write on that the mantras commencing with a three-letter unit to those having four letters in the form of the gomutra (a particular form of writing letters) with a consecrated stylus. 

10. In the same way (oneshould know) the auspiciousness etc. of (mantras) of sixtyfour letters from the fall on or contact of the dice with the odd place. 

11. Commencing with one unit of three-lettered (mantras) to eight units of three-lettered (mantras), denoting the dhvaja (flagstaff) etc. even ones are inauspicious and odd ones are auspicious. 

12. The mantra known as tripurā is composed of the letter 'ka' amplified by a, i etc., and preceded by the sixteen letters along with their vowel sounds. 

13. The mantras having for its principal part (the syllable) hrim, preceded by pranava (om) and concluding with "obeisance" used in worship are twenty-thousand one hundred and sixty. 

14. The mantras ‘ām, hrim' are for (goddess) Sarasvati (goddess of learning), Chaņdari and Durgā (different forms of consort of Śhiva). So it, are the mantras for Śri (goddess Lakshmi). 

15. Then kshaum, kraum are the mantras for Sun, and am, haum for godshiva. Am, gam are the mantras for lord Gaņeśha and am for lord Hari (Vishņu). 

16-17. The preceptorshould after anointing repeat one hundred and fifty times the letters 'ka' etc. as well as the sixteen vowels. With three 'ka' at the beginning along with the vowels and ending with 'ka' all the mantras are formed. After contemplation (the preceptor)should initiate the disciples.