# Project Euler Journey Begins

**Posted:**January 18, 2009

**Filed under:**Programming, Project Euler |

**Tags:**Perl, Project Euler Leave a comment

## What, Project Euler?

This post is an introduction to what I intend to be a series of posts that detail my journey through the problems of Project Euler. I am hoping to post as I solve, or attempt to solve each of these problems. My goal is, of course, to solve all of them, but I expect them to become very challenging very quickly so I may find myself stumped early on. However, this is an exercise in learning so I will have to prepare to be challenged, that is really the whole point.

The intent is for me to use the problems on Project Euler(see previous link) to accomplish several goals I have, or rather have had for a while and am just now attempting. I can list them as three distinct learning goals. I say learning because they all have to do with me wanting to either learn something knew or to increase my knowledge/skills in an area.

## My Goals for the Journey

The first goal is to learn how to use a unix shell. I want to learn how to program for the bash shell as well as how to get around and get things done using the shell command prompt. I would eventually like to be able to incorporate shell usage into my daily work as much as possible as I really think it is an efficient way of getting tasks done. I have always felt that anything that keeps my hand off of the mouse is a step toward increasing productivity. Being able to key tasks at a command prompt is always faster than moving your hand to the mouse to search through dropdown menus and lists of icons, atleast it is in most cases. I do not think that the mouse is unnecessary by any means, I just prefer to use the keyboard as much as possible, or as much as is practical, while I am working.

The second thing I have always wanted to learn more about is higher math. I never took calculus in my brief stint at university, nor when I was in high school. I always loved algebra and I am hoping that calculus as well as other higher mathematics areas will be just as interesting. I also hope they are not beyond me though. I expect I will have to learn quite a bit in order to solve the problems on Euler, even after the first couple I am already looking up stuff on Wikipedia and learning new things, exactly my purpose.

Lastly, but certainly not least, I want to learn a new language, maybe more than one. I am going to start with Perl because I have always felt that not knowing perl was a drawback as a professional developer. I will be attempting to solve all of the problems using Perl as the coding language and consequently have to learn it as I go. I have already used perl to solve the first two problems. I also really want to learn Ruby so I may do some problems in Ruby as I go along. There are plenty of problems so I may be able to learn both languages as I go.

## More about Project Euler

I stumbled on to project euler somehow, though I cannot remember how for the life of me. At the time I bookmarked it in my GMarks and went on my way keeping it in the back of my mind as something to look at later. Well later came and I went to the site and read about it.Project Euler is a series of challenging mathematical/computer programming problems. They involve both the math aspect as well as the coding aspect which is used to perform the calculations needed to get the solution in a timely fashion. In fact all solutions are supposed to adhere to the one minute rule meaning that they should take no more than a minute to execute and produce the result. The site’s about page states that its intent is

“to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context”

which is what it does, quite well in my opinion. There are several cool features about the site that make it fun as well as challenging. It is also well kept and updated often, which makes it feel like you are participating in something more so than if it was a dead site. In fact, every time I logon to the site there are dozens of people logged in already, as I write this there are 88 members logged in, so it is definitely an active site.

## Some of the Features

There are a few features on the site that appealed to me and that made me want to participate as well as making me think that this was an excellent way for me to accomplish the goals I mentioned above. Of course the activity level of the site and the fact that it is kept current and that they are still adding new problems, etc. all made it attractive to me. But, there are a couple of specific features that make it even cooler.

One of those features is the simple fact that you can register and login. This makes possible the scoring and tracking stats features per user (and per problem). Once you register and login you start on the problems, I am doing them in the suggested order that they are presented in, but I suppose you don’t have to do it that way. When you solve a problem or rather, when you think you have solved a problem you can submit your answer. There is a place to do that for each problem, then you are told whether you are right or not. I have been right the first time on the first two problems so I am not sure what happens when you are wrong. When you are right you will see a different view in the problem list from then on. You now see links to an overview pdf, which explains the solutions and has notes about the math/theory behind the problem. This lets you see if you went about solving the problem in the most efficient way possible. You also see a link to the forum thread for that problem where others have discussed the problem in greater detail.

All this extra info is quite informative and contributes greatly to the learning experience. If not for this extra info and participation by the community I wouldn’t know that although I correctly solved the first two problems, there were better ways to solve them than the ways that I used. While not wrong, because I got the right answer, I discovered that there were simpler ways, that included more math theory that I did not have, that would find the solution more efficiently. These extra notes and posts helped me learn much more than I would have by just submitting my answer and finding out it was correct. I plan to post separately about each problem where I will go into this point in more detail.

### Some tidbits about Project Euler

- Here are some cool facts/details about project euler that I thought might add to this post and were interesting:
- There are 228 problems so far, all of which have been solved by someone.
- The first problem has been solved by 48,882 people (including me) and the 228th problem has been solved by 76 people.
- You can sort the problems in descending ID, ascending Difficult, or ascending Difficulty. I am solving them in order by ID.
- From the Stats page, there are 52,922 users whom have submitted a total of 892,601 solutions, an average of 16.9 problems per user.
- I count 165 countries listed on the stats page w/atleast one solution submitted next to their flag.

**The top five(5) languages in number of users are: **

- C/C++ [5798]
- Python [5121]
- Java [3231]
- C# [1758]
- Haskell [1255]
- Ruby [1185] —
*i added a sixth because the last two were so close*

** The top five(5) languages in User’s Rating are:**

- 40% – Magma — (?? never heard of this one, have to look it up)
- 39% – Pari/GP — (?? never heard of this one either)
- 23% – APL/J/K — (?? okay I must be an idiot)
- 22% – Mathematica — (finally one i have heard of)
- 20% – GAP — (?? sigh)

Okay, so there you go, a bunch of stuff about Project Euler and why I am gonna be working on it. I hope I don’t get discourage right away. I have little doubt that this is going to get real tough pretty soon, but I am equally sure that I will learn a great deal if I can do it… j