边循环遍历边累加
(1)for循环
while True: try: N = int(input()) a = 2 s = 0 for i in range(N): s += a a += 3 print(s) except: break
(2)while 循环
while True: try: N = int(input()) a = 2 s = 0 i = 1 while i <= N: s += a a += 3 i += 1 print(s) except: break