From: "Bartosz DziewoƄski" Date: 2012-02-06T00:13:46+09:00 Subject: Re: Simple even and odd number loop in Ruby I hope this is not homework. For example this would work: def f n # this function calculates next number in your sequence if n % 2 == 0 # n is even return n / 2 else return n * 3 end end num = gets.to_i # read in a number while true # infinitely... num = f(num) # find the next number puts num # print it sleep 1 # wait one second end Is there anything you don't understand about this code? -- Matma Rex