Nov. 4, 2002
Loop1.javafrom the web page. Try it out. Be sure you try entering both positive and negative values for the loop termination.
forloop rather than a
xis even, the function returns
xis odd, the function returns
3x+1. If we iteratively apply this function to numbers larger than 1, mathematicians believe the sequence of values eventually returns to 1. Write a little program (you can use
Loop1.javaas a starting point) in which the user enters a starting number and then we loop and print out the values as long as
xis not equal to 1.
Array1.javafrom the web page. Try it out. Be sure to try search for values that are in the array and values that are not.
Print the frequencies after they are all computed to the console.