Project Euler solutions

So, I started the Project Euler problems a few days ago and I can’t believe I’d missed out on them before! I highly recommend them for anyone interested in maths, coding or any combination of the two.

I’m going to make an effort to publish my solutions to the problems I do solve. I realise that there are countless other blogs about Project Euler solutions, and this isn’t really meant to compete with them; I just thought it would be a fun thing to do.

Bear in mind I’m just working through these in my free time alongside lots of other things, so I will probably make quite slow progress.

My setup

I’m coding in Python 3.6 using Atom as my text editor (I strongly recommend it) and WSL running fish on ConEmu as my terminal. My versioning system is git and I’ll try to keep this repository on GitHub updated with my solutions.

Having come from C++ and Matlab, I’m using Python now as it’s a simple and powerful language that draws attention away from the syntax and back to the code itself (plus, it’s quite beautiful I think). I’m relatively new to the language though, so if my code is unidiomatic or overly complicated, that may be why.

Solutions by problem number

Now on Project Euler’s website it asks people not to publish their solutions outside of Project Euler, so as not to deprive people of the experience of completing the problems for themselves. I respect their reasoning for saying that, however I don’t think that it’s a reasonable request. These problems are interesting discuss and it’s people’s own responsibility not to look at others’ solutions before attempting one themselves. So, with the addition of a warning message, I’m going to go ahead and publish my solutions just as many others have done.

My explanations will slowly get shorter and less detailed as the problems get harder and a higher level of abstraction is necessary. The first few I try to explain as in-depth as possible.

Ok, here goes. Below is a table of all the problems I’ve done and my solution post for them.

The ones with no hyperlink are problems I’ve completed but not yet written up. All of my finished code is available in my GitHub repository.

Please don’t look at the solution to a problem until you’ve solved it yourself.

Problem 1 Problem 9 Problem 17 Problem 25
Problem 2 Problem 10 Problem 18 Problem 26
Problem 3 Problem 11 Problem 19 Problem 27
Problem 4 Problem 12 Problem 20 Problem 28
Problem 5 Problem 13 Problem 21 Problem 29
Problem 6 Problem 14 Problem 22 Problem 30
Problem 7 Problem 15 Problem 23 Problem 31
Problem 8 Problem 16 Problem 24 Problem 32