def geometricSeries(*, u_1: int, r: int, n: int) -> int:
    """Compute geometric series up to 'n', given initial value
    'u_1' and common ratio 'r'."""

    return (u_1 * n) if r == 1 else (u_1 * (u_1 ** n - 1) / (r - 1))