[math-fun] Variation on Dan's puzzle