def trojkatna(n):
    if n == 1:
        return 1
    return trojkatna(n - 1) + n


# należy uzupełnić
