public static function arithmeticProgression(int $n, int $d, int $a₁) : array { if ($n <= 0) { return []; } $progression[1] = $a₁; for ($i = 1; $i < $n; $i++) { $progression[$i + 1] = $progression[$i] + $d; } return $progression; }