Go: package main

import (
        "fmt"
)

func main() {
        var num int
        for {
                _, err := fmt.Scan(&num)
                if err != nil {
                        break
                } else {
                        fmt.Printf("%d\n", (num*num+num+2)/2)
                }
        }
}

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int n;
    while (cin >> n)
    {
        printf("%d\n", 2 + int(0.5 * (n - 1) * (n + 2)));
    }
    return 0;
}

C++: #include <cstdio>

int main(){
	int n, a[1001];
	a[1] = 2;
	for(int i=2;i<=1000;i++){
		a[i] = a[i-1] + i;
	}

	while(~scanf("%d", &n)){
		printf("%d\n", a[n]);
	}
}

C++: #include<iostream>
using namespace std;
int main(){
    int i;
    while(cin>>i){
        int co=1;
        while(i>0)co+=i--;
        cout<<co<<endl;
    }
}

C++: #include <iostream>
#include <math.h>
using namespace std;

int n;

int main() {
	while(cin>>n){
		cout<<1+n*(n+1)/2<<endl;
	}
}

C++: #include<stdio.h>

int main(){
int n,i;
int ans;
while(scanf("%d",&n)!=EOF){
ans=1;
for(i=0;i<n;i++)ans+=i+1;
printf("%d\n",ans);
}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void) {
    std::deque<int> deq;
    for (int i=0;i<10001;i++) {
        if (i==0) {
            deq.emplace_back(0);
        } else if (i==1) {
            deq.emplace_back(2);
        } else {
            deq.emplace_back(deq[i-1]+i);
        }
    }
    int n;
    while (cin>>n) {
        cout<<deq[n]<<endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int noa(int n) {
  int res = 1;
  for (int i = 1; i <= n; i++) {
    res += i;
  }
  return res;
}

int main(int argc, char **argv)
{
  int n;
  while (cin >> n) {
    if (!n)
      break;
    cout << noa(n) << endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		cout<<(n*n+n+2)/2<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>

using namespace std;

int main(){
	int n;
	while(scanf("%d",&n)!=EOF){
		n=2+(n-1)*(n+2)/2;
		printf("%d\n",n);
	}
}

C++: #include<iostream>
using namespace std;

int main()
{
 int n;
 while(cin>>n)
 {
  if(n>2)
  {
   int m=1, count=0;
    for(int i=0; i<n-2; i++)
     {
        m+=count;
        count++;
      }
     cout<<n*m+count<<endl;
    }
   else
   {
    cout<<n*m<<endl;
   }
   }
  return 0;
}

C++: #include<cstdio>
main(){int n;while(~scanf("%d",&n)){printf("%d\n",n*(n+1)/2+1);}}

C++: #include <iostream>
//#include <fstream.h>
//#include <cstring>
using namespace std;

int main() {
  
  int n[5];

  for(int i=0;i<5;i++) {
    cin >> n[i];
  }

  for(int i=0;i<5;i++) {
    cout << n[i]*(n[i]+1)/2+1 << "\n";
  }

  return 0;
}

C++: #include <iostream>
using namespace std;

int main()
{
    double n;
    while (cin >> n) {
        if (n == 1) cout << n*2 << endl; 
        else cout << (int)((1+n)*(n/2)+1) << endl;
    }

    return 0;
}

C++: #include<iostream>
using namespace std;


int pie(int x) {
	int y=x*(x + 1) / 2;
	return y;
}

int main() {
	int a;
	int sum = 0;
	while (cin >> a) {
		for (int i = 0; i < a; i++) {
			int func = pie(i);
			sum += func;
		}
		sum += 1;
		cout << sum << endl;
		sum = 0;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){
  //a_1 = 2
  //a_2 = 4
  //a_3 = 7
  //a_n = (1/2)n(n+1)+1
  int n;
  while(cin>>n){
    cout<<n*(n+1)/2+1<<endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(void){
	int line[10000];
	int tem;
	line[0]=2;
	for(int i=1;i<10000;i++)
		line[i]=line[i-1]+i+1;
	while(scanf("%d",&tem)!=EOF)
		printf("%d\n",line[tem-1]);
	return 0;
}

C++: #include<iostream>
int main(){int n;while(std::cin>>n)std::cout<<(n*n+n+2)/2<<'\
\n';}

C++: #include<iostream>
using namespace std;


int pie(int x) {
	int y=x*(x + 1) / 2;
	return y;
}

int main() {
	int a;
	int sum = 0;
	while (cin >> a) {
		for (int i = 0; i <= a; i++) {
			int func = pie(i);
			sum += func;
		}
		sum += 1;
		cout << sum << endl;
		sum = 0;
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
  int n;
  scanf("%d",&n);
  printf("%d\n",n*(n+1)/2+1);
  return 0;
}

C++: #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(6);

  int INF = 1000000;

  int n=0;
  while(cin >> n){
    int res=0;
    res = 2 + (n*(n+1))/2 - 1;
    cout << res << endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main( void )
{
	int n;
	while ( cin >> n )
	{
		if ( n > 2 )
			cout << 3 * n - 2 << endl;
		else
			cout << 2 * n << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>

typedef long long int ll;


using namespace std;

int calc(int n){
	return 1+n*(n+1)/2;
}

int main(){
	int n;
	while(cin>>n){
		cout<<calc(n)<<endl;
	}
}

C++: #include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int serch(int n)
{
    if(n==1)return 1;
    else return n+serch(n-1);
}
int main()
{
    int n;
    while(cin>>n){
        n=serch(n)+1;
        cout<<n<<endl;
    }
}

C++: #include <stdio.h>

int main(void) {

  int n;
  int area;
  int i;

  while(scanf("%d",&n)!=EOF) {

    area=1;

    for(i=1;i<=n;i++) {
      area+=i;
    }

    printf("%d\n",area);

  }

  return 0;

}

C++: #include<stdio.h>

int main(){
	int a;
	while(~scanf("%d",&a)){
		int ans=1;
		for(int i=0;i<a;i++){
			ans+=i+1;
		}
		printf("%d\n",ans);
	}
}

C++: #include <iostream>
#include <string>
using namespace std;

int main(){
	int n;
	int hoge;
	//int sum = 0;
	while(cin >>n&& n){
	/*if(n%2==0)hoge = n/2;
	else hoge = n/2+1;*/
		int sum = 0;
		int piyo = 2;
	for(int i=1; i<=n; ++i){
		sum += piyo;
		if(i%2 == 0 && i!=0){
			piyo++;
		}
	}
	cout << sum << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;
long long int aaa(int n,long long int *c){

	if(n==0)
		return 1;
	else if(n<0)
		return 0;
	else{
	if(c[n]==0)
		c[n]=aaa(n-1,c)+aaa(n-2,c)+1;
		return c[n];
	}
}

int main(){
	
	int n;
	long long int c[10000]={0};
	while(cin>>n){
		
		cout<<aaa(n,c)<<endl;
	
}
}

C++: #include <iostream>
using namespace std;
int main(){
  int n, i, s;
  int a[1000];
  cin>>n;
  a[0]=2;
  for(i=1; i<n;i++){
    a[i]=a[i-1]+i+1;  
  }
  cout<<a[n-1];
  return 0;  
}

C++: #include <iostream>
using namespace std;

int main()
{
  int n;
  while (cin >> n){
    cout << n * (n + 1) / 2 + 1 << endl;
  }
  return 0;
}

C++: #include<iostream>int main(){int n;while(std::cin>>n)std::co\
ut<<(n*n+n+2)/2<<'\n';}

C++: #include <stdio.h>
#include<math.h>
#include <string.h>
#include <ctype.h>

int main(){
int n,f,i;
while(scanf("%d",&n)!=EOF){
f=2;
for(i=2;i<=n;i++){
f+=i;
}
printf("%d\n",f);
}

return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int x;
while(cin>>x){
ans=1;
for(int i=1;i<=x;i++){
ans+=i;
}
cout<<ans<<endl;
}
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

int main()
{
    int n;
    while(cin >> n && n) cout << n*(n-1)/2+n+1 << endl;
}