You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
237 B

#include <bits/stdc++.h>
using namespace std;
const int N = 30;
int a[N] = {2};
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) a[i] = a[i - 1] + pow(2, i - 1);
printf("%d", a[n]);
return 0;
}