#include<stdio.h>
#include<math.h>
long long int power(long long int x) //complete this function so it returns 2^x
{
return pow(2,x);
}
long long int sum_of_series(long long int N)//complete this function so it returns S.
{
long long int s1=0;
for(int i=0;i<=N;i++)
s1=s1+power(i);
return s1;
}
int main()
{
long long int N, S;
scanf("%lld", &N);
S = sum_of_series(N);
printf("%lld", S);
return 0;
}
Comments
Post a Comment