The Taxman Game

R. K. Moniot · Math Horizons · 2007

Want to know how to beat the taxman? Legally, that is? Read on, and we will explore this cute little mathematical game. The taxman game is a “golden oldie” computer game. It has been used as an exercise in introductory programming classes and in books on recreational computing since time immemorial. (Well, at least since the 1970s. I haven’t been able to determine who invented it or when.) Here’s how to play: you start with a pot consisting of all the positive integers up to some chosen limit, N . You take one, and the taxman gets all the others that divide it evenly. The number you picked is added to your score, and the numbers the taxman got are added to his score. This process is repeated until there’s nothing left in the pot. What makes the game interesting is that the taxman has to get something on every turn, so you can’t pick a number that has no divisors left. And when none of the numbers remaining in the pot have any divisors left, the taxman gets them all! The game is pretty easy to program on a computer, and if programming is one of your skills, you might want to pause now to do so and play a few games, just to get the hang of it. Right now we’ll demo a couple of example games with N = 10 to show you how it goes. First, a game where we try to win by always taking the largest number in the pot.

Read the paper · More papers on PaperTik