>>822
procedure LCollatz(n: Integer);
var
 list: TStringList;
 step: Integer;
begin
 list := TStringList.Create;
 try
  step := 0;
  while True do
  begin
   list.Add(Format('%d: %d', [step, n]));
   if n = 1 then
    Break;
   Inc(step);
   if not Odd(n) then
    n := n div 2
   else
    n := 3 * n + 1;
  end;
  //結果(list)を表示
 finally
  list.Free;
 end;
end;