Lời giải :
program hotrotinhoc ;
var S,n,i : integer ;
begin
write('Nhap n='); readln(n);
for i:= 1 to n do S:=S+i*(i+1) ;
write('S=',S);
readln
end.
Var n,S,i:longint;
Begin
write('nhap n:'); readln(n);
S:=0;
For i:=1 to n do S:=S+n*(n+1);
writeln(S);
Readln
End.