CIT 591 Assignment 2: Scott's Problem
David Matuszek

Consider the following problem, defined for positive integers:

Example: If you start with the number 17, you get the following sequence:

Does this procedure eventually reach 1 and stop for every choice of starting number? So far, this is an unsolved problem--no one has yet proved that the process always results in 1, and no one has yet found a counterexample.

Your assignment: Write an application (not an applet) that does the following:

  1. Prints out your name, followed by a blank line.
  2. For each of the numbers 1 through 20, print out a line that begins with the number, then a colon and space, then the sequence of numbers that results from starting with the given number. Separate the numbers by spaces. For example, starting from the number 17, you would print the single line:
         17: 52 26 13 40 20 10 5 16 8 4 2 1
  3. For extra neatness, you can make the numbers line up better by inserting an extra space before each single-digit number (a number less than 10).
Scott's problem has not been "solved," and if you spend any time with it, you will start to discover some fascinating patterns. If this is the sort of problem that appeals to you, the computer is a great way to help discover some of these patterns.