Sum of number from 1 to N

If I am giving value of n=4 then is answer is coming like this:
1,
3,
6,
10,
Why so??

hello @prachigupta2603

pls save ur code here->

and share the link with me