Recently, I watched a video in which the author claims that there is a sloka in praise of Lord Krishna which results in the value of "pi" up to 30 decimal places, in the katapayadi system. Here is the sloka:
gopi bhagya madhuvrata
srngiso dadhi sandhiga
khala jivita khatava
gala hala rasandara
It looks this shloka originates from Bharati Krishna Tirthaji's system of so-called "Vedic Mathematics". Note that despite its name, it's widely agreed that Tirthaji's system isn't actually Vedic in origin; Tirthaji claimed that his 16 Sutras were from the Parishishta of the Atharvana Veda, but they're not actually found there. (Here's a good paper discussing the provenance of Tirthaji's Vedic Mathematics system. For the real mathematics of the Vedic period see here.) And the supposed shloka in question isn't even a correct Katapayadi translation of pi; here is what this book says:
Now we know enough about the authentic Katapayadi system to identify the origin of the Guru [Tirthaji]'s verse... According to the guru [Tirthaji], decoding the verse produces the following number:
31415 92653 58969 32384 62643 38327 92
In this number we recognize the first 31 decimals of pi... In the authentic Katapayadi system, the decimals are encoded in reverse order. So according to the authentic system, the verse is decoded as
29723 83346 26483 23979 85356 29514 13.
We conclude that the verse is not medieval, and certainly not Vedic. In all likelihood, the guru [Tirthaji] is the author of the verse
Actually the approximate value of pi was known in the Shulba Sutras in ancient India (not in the Vedas per se). Obviously knowing it to 32 places of decimal is impossible without the usage of modern numerical methods applied to analytical expressions unknown at the time.
The motivations for estimating pi in the Shulba Sutras was the construction of circular fire altars (which will obviously require at least a rough estimate of the ratio of the circumference to the diameter). They certainly determined that the ratio was universal, though estimating it to any degree of accuracy beyond 3.1416 was highly unlikely.
Contrary to the claims made by some of the posters, there was little transmigration to India from the Middle East between the Vedic period and the common era, so knowledge transmission from "older" (not really) Semitic societies is highly unlikely. Claims of middle eastern transmigrations were made by British scholars in the 19th century and have largely been discredited outside Britain.
I should qualify this remark by saying that I'm excluding those periods and/or parts of the middle east that were under Hittite, Indo-Greek, Selucid, Graeco-Bactrian or Achemeneid-Persian control during the period in question, and I'm excluding Afghanistan and Iran from my definition of the "middle east", since those societies were predominantly Indo-European like Northern and Central India.
कटपयादि Number System (Coalescence of Literature and Science in Ancient India)
It is a numerical technique accredited in ancient India to depict letters to numerals for easy remembrance of numbers as words or verses.
Mechanism of this system-
All stand-alone vowels (like अ, आ, इ etc.) represent zero.
The consonant group have numerals assigned as per the following table.-
In a conjunct consonant, the last of the consonants alone will count
(Like in क्या, it is formed by क्+य+अ. The only consonant standing with a vowel is य. So the corresponding numeral for क्या will be 1).
A consonant without a vowel is to be ignored (Like द् is associated with 0).
Now the time appears to see the mathematical wisdom of ancient Indians in the twist of extraordinary poetry.
a) Sankara Varman once wrote a verse in the 4th chapter of his book Sadratnamala-
भद्राम्बुधिसिद्धजन्मगणितश्रद्धा स्म यद् भूपगी:
Splitting the consonants in the relevant phrase gives,
Reversing the digits to modern-day usage of descending order of decimal places, we get 314159265358979324 which is the value of π to 17 decimal places, except the last digit, which might be rounded off to 4.
b) Jagadguru Shankaracharya Swami Bharati Krishna Tirtha wrote a sloka, which is literally in seance the praise for Lord Krishna-
("O Lord anointed with the yoghurts of the milkmaids' worship, O savior of the fallen, O master of Shiva, please protect me")
If you want to decode this verse in terms of the Katapayadi system, you can get, 31415926535897932384626433832792. It means this verse encrypts the exact value of π up to 31 decimal places.
c) Let us now talk about कटपयादि संख्या method how ancient Indians encoded the value of one more famous irrational number 'e' (2.7182818....) into the following verse-
रथ यह राजा का है।
After deciphering this verse into number we get 27182818, which is the exact value of e upto 7 decimal points.
In this note, take a deep breath and think about this once more. In ancient times Indians were able to determine the exact value of irrational number π up to 31 decimal places and encrypted them into such a great sloka. Just try to imagine their mathematical wisdom and literary efficiency.
Historians generally believe that scientists and mathematicians from older civilizations like the Egyptian, Mesopotamian, Sumerian etc. migrated to India
and helped write the Vedas. The Vedas might have the rules of Astronomy and Astrology, as developed in Older civilizations, in a coded form. The value of Pi, calculated to 32 decimal digits, was not known to those civilizations. This value can only be calculated by using Infinite Power Series approximations of Differential Equations.These concepts were unknown to those civilizations. So it is highly unlikely ,that this value of Pi is found in the form of a " sloka" in any Sanskrit literature written around 1000 to 1500 BC.
Like any library, Hinduism Stack Exchange shares great information, but does not offer personalized advice, and does not take the place of seeking such advice from any Acharya, Pundit, astrologer, Guru or other trustworthy Counselor.