> n:=77671:m:=[ ]:while n>1 do if n mod 2 = 0 then n:=n/2 else n:=3*n+1 fi:m:=[op(m),n]: od:m;
Reference: Martin Gardner, Wheels, Life and other Mathematical Amusements, p. 196.