public static function heptagonalNumber(int $n) : array { $heptagonal = []; // Bad input; return empty list if ($n <= 0) { return $heptagonal; } // Standard case for Hn: (5n² - 3n) / 2 for ($i = 1; $i <= $n; $i++) { $heptagonal[$i] = (5 * $i ** 2 - 3 * $i) / 2; } return $heptagonal; }