def problem_48_self_powers(series_limit, digits):
    """ Problem 48: Find the last digits of series n^n (n = 1 to series limit).

    Args:
        series_limit (int): The maximum base and power in the series.
        digits (int): The number of last digits to take from sum.
    """
    result = 0
    for number in range(1, series_limit + 1, 1):
        result += number ** number
    return str(result)[-digits:]