' field below. // Please check man page for isset function. $submitted = isset($_GET['submitted']); if ($submitted) { echo "

The result is:

\n

"; $n = $_GET['n_value']; $s = rec_gauss_sum($n); /* function call */ echo "S($n) = 1 + 2 + 3 + ... + $n = $s"; echo "

\n

".'recompute.

'; echo "\n

".'Other curious facts on 1+2+3+4+....

'; } else { echo '

This calculator computes the Little Gauss sum, S(n) = 1 + 2 + 3 + ... + (n-1) + n:

n:
'; } ?>