program penjumlahanderet;
var
n : integer;
i : integer;
j : integer;
begin
write ('berapa n?'); readln(n);
j:=0;
i:=1;
while i <= n do
begin
writeln (i*(i + 2));
i := i + 1;
end;
writeln ('jumlah deret =',j);
end.
program penjumlahanderet;
var
n : integer;
i : integer;
j : integer;
begin
write ('berapa n?'); readln(n);
j:=0;
i:=1;
while i <= n do
begin
j := j + i;
writeln (i*(i + 2));
i := i + 1;
end;
writeln ('jumlah deret =',j);
end.