def table1_1():
    """Literal Python conversion of table1_1.m."""

    print('\n n               S(n)-s(n) ', end='')
    # loop for increasing values of n
    for ic in range(1, 7):
        n = 10**ic

        # sum series from large to small
        S = 0.0
        for jj in range(1, n + 1):
            S = S + 1/jj

        # sum series from small to large
        s = 0.0
        for j in range(n, 0, -1):
            s = s + 1/j

        # print out S(n)-s(n)
        print(f'\n {n:d}     \t {S - s:7.2e} ', end='')
        # print(f'\n {n:d}  &  {S-s:12.2e} \\\\')  # used for format in text

    print('\n')


if __name__ == '__main__':
    table1_1()
