Today, I wanted to mess around with something called the “God Number”. It was a new thing for me, so I did what everyone does – I looked it up.
After reading up a bit, I found out that the God Number is about figuring out the fewest moves needed to solve a Rubik’s Cube from any scrambled state. Turns out, that number is 20. That means no matter how messed up a Rubik’s Cube is, it can always be solved in 20 moves or less. Cool, huh?
But there is another God number, it is the smallest number that can be expressed as the sum of two cubes in two different ways. After some calculations, I found it is 1729 = 1³ + 12³ = 9³ + 10³. So I decided to find the 41th God Number.

So, I rolled up my sleeves and started coding. I wrote a simple program to check different combinations of numbers. The idea was to find pairs of cubes that add up to the same number. I had to test a lot of numbers, so I made the program do the heavy lifting.
My Process
- First, I started a loop to go through a bunch of numbers.
- Then, I nested another loop inside to calculate the cubes of different numbers.
- Inside the inner loop, I did the same thing again, creating a loop to calculate the cubes of another set of numbers.
- After calculating the cubes, I added them up and checked if that sum had already been found with a different pair of cubes.
- If I found a match, I printed it out.
I ran the program and waited. It took a while because it had to go through so many combinations. Finally, it started spitting out results. I watched as it found different numbers that could be made by adding two cubes in two different ways.
When it reached the 41st number, I stopped the program. And there it was, the 41st God Number, displayed on my screen. The number is 13120005.
It was a fun little project. I didn’t break any world records or anything, but I learned something new and had a good time doing it. That’s what counts, right? So, if you’re ever bored and looking for a small coding challenge, try finding some God Numbers. It’s a nice way to pass the time and maybe learn a thing or two along the way.