Also given the halting problem, you could write an algorithm that would be impossible to determine if it loops forever.