An implementation of projecteuler.net problems in Ruby.
In order to learn Ruby and knock the cobwebs off my math skills, I am attempting the problems on projecteuler.net using Ruby.
My personal workflow looks something like this:
- Implement a solution using only what I currently know in my Ruby and math toolbox.
- Do some research and generally rediscover a better mathematical formula or algorithm (like a better formula for triangle numbers, finding the nth prime number, etc.)
- Implement a better solution using better mathematics and/or "the Ruby way".
For instance, for the "find the Nth prime number":
- Implement a naive version of what I think is the Sieve of Eratosthenes.
- Check out the wikipedia article and learn a much better implementation. 3a) Implement a new version of the solution using this new method. 3b) Research a "prime" lib available in Ruby, learn it and use it instead.
