Addictive Maths Challenges

For the past few weeks, I’ve been addicted to the math programming problems at mathschallenge.net. You have to answer a math question that usually requires writing a little program to solve, such as “What is the sum of the digits of the number 2^1000?” The problems seek to require less that a minute of CPU time with a moderately efficient algorithm. Many require less that a minute on even a dumb brute force algorithm.

When you solve a problem, you get access to a little forum for discussing that problem where people share algorithms and code samples. That’s useful for seeing the same problem coded in different languages. You can choose how clever you want to be, as illustrated by the following forum exchange:

[Person A] I found the solution by paper-and-pencil analysis. No coding required!

[Person B] I found the solution with a dumb brute-force program. No thinking required!

I’ve been using Java, but C++ seems to be the most popular implementation language, followed by Python and Java.

Leave a Reply