#include <stdio.h>
int func(int n){
int a[30],i;
a[0]=-1;
for(i=1;i<=n;i++){
a[i]=3*a[i-1]+5;
}
return a[n];
}
int main(void) {
// your code goes here
int n=3;
printf("数列anについて、n=%dの時の値は%d",n
,func
(n
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBmdW5jKGludCBuKXsKCWludCBhWzMwXSxpOwoJYVswXT0tMTsKCWZvcihpPTE7aTw9bjtpKyspewoJYVtpXT0zKmFbaS0xXSs1OwoJfQoJcmV0dXJuIGFbbl07Cn0KaW50IG1haW4odm9pZCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJaW50IG49MzsKCXByaW50Zigi5pWw5YiXYW7jgavjgaTjgYTjgabjgIFuPSVk44Gu5pmC44Gu5YCk44GvJWQiLG4sZnVuYyhuKSk7CglyZXR1cm4gMDsKfQo=