def solution(n: int):
return sum([sum([i for i in range(1,num+1)]) for num in range(1,n+1)])
assert solution(4) == 20
assert solution(6) == 56
assert solution(943) == 140205240
def solution2(n:int)->int:
return sum(sum([i for i in range(1, i + 1)]) for i in range(1,n+1))
assert solution(4) == 20
assert solution(6) == 56
assert solution(943) == 140205240
def solution(n: int) -> int:
result = 0
while n > 0:
result += feb(n)
n -=1
return result
def feb(n):
if n ==1 : return 1
elif n < 1: return 0
else : return feb(n-1)+n
def solution(n: int) -> int:
result = 0
for i in range(1, n + 1):
result += sum([j for j in range(1, i + 1)])
return result
assert solution(4) == 20
assert solution(6) == 56
assert solution(943) == 140205240