ThreeNPlus1 solution

 0, * generate a sequence of numbers using the following simple rules: * if N is even, divide it by 2; if N is odd, multiply it by 3 and add 1. * The sequence always converges to 1, although the length of the sequence * varies depending on the choice of N. * */ ?>   3N + 1 Problem   The 3N + 1 Problem "; while ($n > 1) {       // While n is greater than 1 echo "$n";     // Print it then either if ($n % 2 == 0) { $n = $n / 2;   //  Divide it by 2 }          else { $n = 3 * $n + 1; // Or multiply 3N+1 }      }    ?>   