Euler #21: Amicable Numbers
How can numbers be amicable? Do they go over to each other’s houses? Do they nod at each other while walking down the street? Probably not. But it is an interesting proposition to find them.
How can numbers be amicable? Do they go over to each other’s houses? Do they nod at each other while walking down the street? Probably not. But it is an interesting proposition to find them.
Calculating digit sums of really big numbers sounds daunting. But it is not so with Python and its support for really big numbers. I’m talking numbers like 100! Numbers that far exceed the number of atoms in the known universe.
Come on in to check out how Doomsday can help us calculate the weekday of a date! The Doomsday algorithm is a neat mental trick you can use to impress your friends.
Taking paths through triangles is actually more glamorous than it seems. Shortest/longest paths are a common problem in graph theory. And the cool thing about graphs? They’re EVERYWHERE.
English can be annoyingly irregular. One saving grace is its number system. It doesn’t have any special rules beyond 20. Phew! Check out this post that counts letters of English names for numbers.
Python is an awesome language. Humongous numbers such as 2 to the 1000th power are made mincemeat, thanks to Python’s bignum support. Come in to check out this one-liner solution.
Imagine you’re stuck in a grid of one-way streets. How many ways are there to get from one corner to the other? What idiot designed such a city?
Proving the Collatz Conjecture is still an unsolved problem of mathematics. This post doesn’t try to do that. Instead, it descends down the tree of a million numbers to the root of all numbers: 1.
The problem itself is very simple. One could even do it by hand. However, it’s tough to do with statically typed languages. Yet it’s a breeze with Python.
Triangle numbers and beer pong go hand in hand. Finding a highly divisible triangle number could be handy if you had a huge party and wanted to neatly divvy up the cups after a game (ew).