This would be a good second programming interview test after FizzBuzz. A decent programmer should be able to handle it in 50-100 lines of any modern language, it's easy and quick enough to explain, it doesn't require any deep mathematical knowledge, the algorithm is pretty simple and obvious, and there are lots of little potential bugs waiting for you if you're not careful.