Project Euler

In the comments to my post about my prime sieve from last week, Duncan pointed me to Project Euler, which is a collection of math problems that you can solve.  Not sure if it makes me crazy that I think it's really cool, but I do.  Even better, once you solve a problem, you gain access to a protected forum thread and a nice PDF writeup discussing the problem and possible solutions.

For example, problem 1 can be solved by a simple loop/modulo algorithm, but that gets expensive as the range increases in size (it's O(n)).  For <1,000 it's quite speedy, but for <1,000,000 it takes a long time.  There is a far better algorithm using a series expansion/summation that operates O(1).  The writeup includes discussion of both algorithms, including code.  Very cool.

If you want to find me out, I'm 'barneyb'.

3 responses to “Project Euler”

  1. duncan

    The PDF writeups only seem to be for some of the earlier problems, although 'euler' usually gives his solution in PHP in the discussion threads. Have fun! I've moved onto using Python for some that CF 5 (!) couldn't handle. Groovy should work well I expect. I put in a request for CFML to be added to their list, but no response.

  2. Mike

    Project Euler is definitely a fun site, I used to participate on http://uva.onlinejudge.org/ (when was still hosted in spain), however the problems where getting harder and was too much like a programming contest. Then I found Project Euler, it has many simple problems very useful for practicing new skills without spending too much time.

    In addition, if you are interested in food for brain also project eureka (at http://www.projecteureka.org) is an interesting site. Besides programming problems has some puzzles, math problems.