fork download
  1. <?php
  2. function compute($n, $a, $d) {
  3. $nth = $a + ($n - 1) * $d;
  4. return $nth;
  5. }
  6. $total = 0;
  7. for($i = 1; $i <= 20; $i++) {
  8. $total += compute($i, 3, 2);
  9. }
  10. echo $total + compute(50, 3, 2);
  11. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
541