<?php
function compute($n, $a, $d) {
$nth = $a + ($n - 1) * $d;
return $nth;
}
$total = 0;
for($i = 1; $i <= 20; $i++) {
$total += compute($i, 3, 2);
}
echo $total + compute(50, 3, 2);
?>