Learning recursion with hailstone seqence



I'm playing with the hailstone sequence. My function will
need to iterate millions of times to process the data. I have two questions:

1. Can this function be optimised ? (approx 2^67 iterations are neccessary
on current dataset)
2. How can I test huge numbers (like 2^1000) --- Int64 can't handle it

function hailstone(x:int64):int64;
begin
if odd(x) then result:=x*3+1
else result:=x shr 1;
if result<>1 then hailstone(result) ;
end;

*****************************************************************
* I'm neither a programmer nor a math whiz so keep it as simple as
possible *
*****************************************************************

Thanks
DBM


.