Random thoughts by Roberto Selbach. See other blog posts here.

Tag: python

Euler 15 in Python

This one isn’t even funny… Starting in the top left corner of a 2×2 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 20×20 grid? Your first thought would be to generate the routes, but for a 20×20 grid, those amount to BILLIONS and you’d…

Euler 11 in Python

Project Euler’s problem #11 statement goes: In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98…

Euler 10 in Python

I decided to take on Project Euler’s problem #10. Its statement goes like this: The sum of the primes below 10 is [pmath]2 + 3 + 5 + 7 = 17[/pmath]. Find the sum of all the primes below two million. My first attempt used brute force and testing primality using only previously found primes:…

Euler 9

So the other night I was a bit bored and decided to do something to pass the time. I first came across Project Euler a while ago, but had never gone further than problem #1. Boredom is a great motivator and I went through problems #2 thru #9 last night and I decided to post…

Euler 6

So the other night I was a bit bored and decided to do something to pass the time. I first came across Project Euler a while ago, but had never gone further than problem #1. Boredom is a great motivator and I went through problems #2 thru #9 last night and I decided to post…

Euler 5

So the other night I was a bit bored and decided to do something to pass the time. I first came across Project Euler a while ago, but had never gone further than problem #1. Boredom is a great motivator and I went through problems #2 thru #9 last night and I decided to post…

Euler 4

So the other night I was a bit bored and decided to do something to pass the time. I first came across Project Euler a while ago, but had never gone further than problem #1. Boredom is a great motivator and I went through problems #2 thru #9 last night and I decided to post…