def arithmetic_series_dp(n):
    """Arithmetic series by bottom-up DP.

    Time complexity: O(n).
    Space complexity: O(n)
    """
    T = [0 for _ in range(n + 1)]
    T[0] = 0
    T[1] = 1
    for k in range(2, n + 1):
        T[k] = k + T[k - 1]
    return T[n]