#include<stdio.h>
int main()
{
// (18*i)+(2*i)
int a=18,i,n;
scanf("%d",&n);
printf("%d ",a);
for(i=1;i<n;i++)
{
a=(a*i)+(2*i);
printf("%d ",a);
}
return(0);
}
Sample Input :
7
Sample Output :
18 20 44 138 560 2810 16872
7
Sample Output :
18 20 44 138 560 2810 16872
No comments:
Post a Comment