euler

Project Euler Problem 35

I was apparently being OCD and put some time into the solution for Project Euler Problem 35.

Here we're trying to calculate the number of circular primes < 1,000,000. A circular prime is--well just read the problem statement.

Anyhow, here's a perl solution. It runs in about 5seconds, which isn't too bad, I guess -- could be faster.

Project Euler Problem 22

More sum-a-bunch-of-absurdly-large-numbers fun in Project Euler Problem 22. We're given a 46KB text file full of names, a way of assigning each one a value, and told to give some sums.

Here's a perl solution -- maybe one day I'll get around to writing these in another language.

Project Euler Problem 15

Project Euler Problem 15 was actually sort of fun. After some goggling around while researching a general mathematical method for this class of problems, I came across this nifty wikipedia article on Catalan numbers. If you have nothing going on in your life, give it a read.

Anyhow, here's the perl solution. And yes, I could have memoized my factorial method to prevent duplicate calculation of 20!

Project Euler Problem 12

Oh more prime factorization. This is getting tedious. I should probably just create a primes-list or something and a general factorization library, but I usually solve these things because I'm bored. Anyhow, here's a correct but horribly slow solution to Project Euler: Problem 12.

Project Euler Problem 11

The problem difficulty seems pretty random -- I'm pretty sure there were 'easier' problems which were harder to solve. Oh well.

My solution to Project Euler: Problem 11 is pretty straight-forward. And by that I mean brutish: Iterate across the columns of the 20x20 grid and keep track of the maximal product.

There are some optimizations to be made, I'm sure, but this will still crank out an answer in less than a second -- which is 'fast enough' for me.

Perl code below

Syndicate content