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++: #include <stdio.h>
#include <cmath>
#include <algorithm>

int main(){

	int n;

	while(scanf("%d",&n)!=EOF){
		printf("%d\n",(n*n+n+2)/2);
	}
	return 0;
}

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

int main(){
  int t[10005];
  
  t[0]=1;
  for(int i=1;i<=10000;i++){
    t[i]=t[i-1]+i;
  }
  int n;
  while(cin>>n){
    cout<<t[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<stdio.h>

int main(){
	int a,b;
	int i,j;
	int R1=1,R2=1;
	scanf("%d\n%d",&a,&b);
	for(i=1;i<=a;i++){
		R1+=i;
	}
	for(j=1;j<=b;j++){
		R2+=i;
	}
	printf("%d\n%d",R1,R2);
	return 0;
}

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

int main(){
    
    int n;
    int count = 1;
    while(cin >> n){
    for(int i = 1;i<=n;i++){
        
        count += i; 
    }
    
    cout<< count <<endl;
    }

    
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

int keisan (int a) {
	if (a == 1) {
		return 2;
	} else {
		return a + keisan(a-1);
	}
}

int main() {
	int n;
	while (1) {
		cin >> n;
		cout << keisan(n) << endl;
	}
	return 0;
}

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int n;

int main(){
	while (cin >> n){
		if (n == 1){
			cout << 2 << endl;
			continue;
		}
		if (n == 2){
			cout << 4 << endl;
			continue;
		}
		cout << 7 + 2 * (n - 3) << endl;
	}
}

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

int n;

void solve() {
	int res = 1;
	for (int i = 0; i < n; i++) {
		res += i + 1;
	}
	cout<<res<<endl;
}

int main(int argc, const char *argv[]) {
	while (cin>>n) {
		solve();
	}
	return 0;
}

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

int main(){
    
    int n;
    int count = 1;
    while(cin >> n){
    for(int i = 1;i<=n;i++){
        
        count += i; 
    }
    
    cout<< count <<endl;
    }

    
}

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

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

int main()
{
	int n, in, a;
	while (cin >> in){
		n = 0;
		if (in > 2){
			for (int i = 2; i <= in; i++){
				if (i == 2) a = 4;
				else a += i;
			}
			n = n + a;
		}
		else n = in * 2;

		cout << n << endl;
	}
	return (0);
}

C++: #include <cstdio>
#include <iostream>
 
int main()
{
    int n;
    while(cin>>n) {
        n%2 ? printf("%d\n",n*2+1):printf("%d\n",n*2);
    }
    return 0;
}

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

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

C++: #include <iostream>

using namespace std;

int main() {
    int area[10001], n, d = 2;
    area[1] = 2;
    for (int i = 2; i <= 10000; i++) {
        area[i] = area[i - 1] + d;
        d++;
    }
    while (cin >> n) {
        cout << area[n] << endl;
    }

    return 0;
}

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

int main() {
	int n, a[10001] = { 0 };
	
	a[0] = 1;
	for (int i = 1; i < 10001; i++) {
		a[i] = a[i - 1] + i;
	}

	while (cin >> n) {
		cout << a[n] << endl;
	}
	return 0;
}

C++: main(n){for(;~scanf("%d",&n);)printf("%d\n",(n+1)*n/2+1);}

C++: #include <iostream>

using namespace std;

int area(int n){
  if( n == 1 ) return 2;
  return n + area( n - 1 );
}

int main(void){

  int n;
  while( cin >> n ){
    cout << area(n) << endl;
  }
  return 0;
}

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

int main(){
   int n;
   int a = 1;
   while(cin>>n){
      if(n <= 2*a){
         cout << 2*n << endl;
      }else if(n <= 4*a){
         cout << 2*n + 2*a << endl;
      }else if(n <= 6*a){
         cout << 2*n + 4*a << endl;
      }else{
         cout << 2*n + 6*a << 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>
using namespace std;
int main(){
  int n, i, s;
  int a[10000];
  a[0]=2;
  for(i=1; i<10000;i++){
    a[i]=a[i-1]+i+1;  
  }
  while(cin>>n){
  cout<<a[n-1]<<endl;
  }
  return 0;  
}

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

int main(){

  int a[10001] ;
  a[1] = 2;
  for(int i=2;i<=10000;i++) a[i] = a[i-1] + i;

  int n;
  while(cin >> n){
  cout << a[n] << endl;
  }
  
  return 0;
}

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

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

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

int main(){
	int n, ans = 0;
	
	while(cin>>n){
		for(int i = 1; i <= n; i ++){
			if(i % 2) sum += 2;
			else sum +=3;
		}
		cout<< sum<<endl;
	}

	return 0;
}


//2 4 7 9

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>
using namespace std;

int main(){
	int ans[10001];
	ans[0] = 1;
	for(int i = 1; i < 10001; i++){
		ans[i] = ans[i-1] + i;
	}
	int n;
	while(cin >> n){
		cout << ans[n] << endl;
	}
	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::cout<<(n*n+n+2)/2<<'\n';
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;

int main(void) {

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

  return 0;
}

// EOF

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 = 2;
		int piyo = 2;
	for(int i=1; i<n; ++i){
		sum += piyo;
		piyo++;
	}
	cout << sum << endl;
	//}
	return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
#include<cmath>
#include<complex>
using namespace std;

typedef complex<double> P;

#define X real()
#define Y imag()
typedef int kz;

kz gcd(kz a,kz b) { if(b==0) return a; else gcd(b,a%b); }

int main(){
    int mod=1000000007;
    int n;
    while (scanf("%d",&n)!=EOF) {
        int ans=1;
        if (n%2==0) {
            ans=(1+n)/(n/2);
        } else if (n!=1) {
            ans=(1+n)/(n/2)+(n+1)/2;
        }
        printf("%d\n",ans+1);
    }
    return 0;
}

C++: #include <stdio.h>

int main(void) {
	int a, b, i, j;
	scanf("%d",&j);
	for(i = 1; i <= j; i++){
		scanf("%d", &a);
		b = (1 + a) * a / 2;
		printf ("%d\n", b);
	}
	return 0;
}