Project Euler

Euler #11: Largest Product in a Grid

What is the largest product of 4 adjacent numbers of a grid in the 8 compass directions? How do we avoid falling outside of the grid where there dragons be?

Finding Lattice Points on an Elliptical Curve

We like nice round numbers. We like it even more when these are the solutions to complex equations. We love it when these solutions help find primes. Lattice points on elliptical curves are used in the Sieve of Atkin.

Euler #10: Summation of Primes

Adding up is fun. It’s even more fun when they’re primes. But, how do we find primes? We use sieves such as the Sieve of Atkin, which is implemented here.

Euler #9: Special Pythagorean Triplet

Pythagorean triplets acted as speed squares in ancient carpentry. The Babylonians knew of them before Pythagoras’s time. Euclid’s Formula makes a guest appearance.

Euler #8: Largest Product in a Series

Slide open a window and inhale the crisp air of freshly minted products. Of numbers, that is. The exercise is to find the thirteen adjacent digits in a 1000-digit number that have the greatest product.

Euler #7: 10001st Prime

Is that bearded bald guy really Eratosthenes of Cyrene? Who knows? We do know that he devised the prototypical sieve of prime numbers, put to use here.

Euler #6: Sum Square Difference

Students of math everywhere make this mistake. I know I’ve made it. Have you? You’d be a liar if you say no. The problem pokes gentle fun at this common error.

Euler #5: Smallest Multiple

“Base prime” is a nifty shortcut used here to calculate the least common multiple of a set of numbers. Imagine a giant Venn diagram of overlapping factors.

Euler #4: Largest Palindrome Product

Never odd or even. Oozy rat in a sanitary zoo. Taco cat. A nut for a jar of tuna. Palindromes are cool. Instead of palindromic sentences, how about palindromic numbers?

Euler #3: Largest Prime Factor

Composite numbers are sieved out, while prime numbers fall through. Check out this totally amateur implementation of the Sieve of Eratosthenes.