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?
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?
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.
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.
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.
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.
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.
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.
“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.
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?
Composite numbers are sieved out, while prime numbers fall through. Check out this totally amateur implementation of the Sieve of Eratosthenes.