def sum_of_n_even_nums(i):
    """Calculate sum of first i even numbers"""
    count = i
    num = 0
    ans = 0
    iterator = 1
    while iterator <= count:
        if num % 2 == 0:
            ans = ans + num
            iterator = iterator + 1
            num = num + 1
        else:
            num = num + 1
    return ans