I just wrote this paper that has some Ruby code in it, that shows how to construct an exact Prime-counting Function. https://en.wikipedia.org/wiki/Prime-counting_function

If you’re into prime numbers, or math in general, it may be an interesting read for you, and shows that Ruby has far more uses than web development.

or