The trick is well known: counting the letters in each word of the poem below gives the first thirty digits after the decimal point in π.
How I love to teach a number useful to the wise!
Immortal Archimedes, artist and engineer,
Who can measure the worth of your mind?
Your problem offered me just such advantages