After updating my personal programming environment in August 2017, I was looking for opportunities to keep myself in touch with technology. That’s when one of my colleagues mentioned about Project Euler – a series of challenging problems that require mathematical and programming skills. It is named after Leonhard Euler, a Swiss mathematician, physicist, astronomer, logician and engineer, who made important and influential discoveries in many branches of mathematics, such as infinitesimal calculus and graph theory.
What started as a sub-section on mathschallenge.net in October 2001 has become an independent domain with more than 780,000 registered users having solved at least one problem. The site currently has 623 problems with a new problem added every fortnight. While most of the problems are straightforward, it is practically impossible to solve them without a computer because of the large numbers and computations involved. So, it is a marriage of mathematics and programming – bingo, what I was looking for!
Now then, one can choose to use any programming language to solve the problems. With Java and Python in my toolkit, I started with solving the problems using both of them. After just a couple of solutions, I realized that Python was way more effective and efficient. A solution in Java typically took twice as much time as Python due to several reasons – code verbosity, compilation / run time, functional programming and relatively vast math libraries available in Python, among others. So, I quickly dropped Java and stuck to writing code only in Python. Every problem expects a specific number as an answer, you type it in the answer box and eureka – you got it!
I don’t consider myself a quick programmer, my forte is discipline, patience and perseverance. I may take twice or even longer time than others to complete anything. But once I put my mind onto something, determination takes over and I invariably get it done. I usually don’t expect my programs to compile and run perfectly the first time. But the Project Euler answer box accepted my response as the right one in the first attempt for several problems. After all, I am a better programmer that I imagined!
I started with solving the first problem on 25th August 2017 and was solving at least 8 problems every weekend initially. That was when the difficulty level was at 5%. As the difficulty level went up, the rate of solving problems kept going down. That’s fine, I am not a Math genius and I was learning new Math concepts and Python libraries. By October 20th, I had solved 57 problems that put me in the Top 5% in terms of the number of problems solved.
My solutions are usually the brute force type. The purists will not like them. I will get there one day when I put my mind to it. For now, I just enjoy the excitement of seeing me getting the right answer.
Finally, why am I posting this now? After 20th October, I went into hibernation from Project Euler with my weekends taken up for the brevet season starting November 2017 to January 2018. After a gap of five months, I solved a couple of problems during the last week of March 2018 and this time wanted to jot down my experience before it becomes too stale. With the complexity level of problems having significantly increased and with so many conflicting priorities requiring my attention, I am not sure how many I will get to solve.
There are so many things to do and so little time in hand… Santh – that’s life and learn to deal with it!!!