Quote:
Originally Posted by henryzz
i have programed this 
unfortunatly it only takes off a fifth of the time 
are there any more suggestion?
|
My guess is that a lot depends on how you implement the check of whether a number has been seen before. Obviously there are simple but very inefficient ways of doing this - and the most inefficient would take much more time than just following the chain to the end without the check. It's a non-trivial problem but I think if you try to optimize your method of checking for previous occurence you might dramatically improve the speed.