Skip to main content
1 of 2
Sylvain
  • 236
  • 1
  • 5

An often-cited example of a very basic program, for which termination is open, is one that generates the Collatz sequence. In pseudo-code:

collatz(int n)
  while (n != 0)
    if (n mod 2 == 0)
      n = n / 2;
    else
      n = 3n + 1;
Sylvain
  • 236
  • 1
  • 5