#include <stdio.h>
//a{n}=2a_{n-1}+3, a{0}=-2(再帰無し版)
int main(void) {
int n,an;
n = 4;
an=-2;
for(int i=0; i<n; i++){
an=2*an+3;
}
printf("数列anの%d番目の値は%d\n", n
, an
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8vYXtufT0yYV97bi0xfSszLCBhezB9PS0yKOWGjeW4sOeEoeOBl+eJiCkKaW50IG1haW4odm9pZCkgewogICAgaW50IG4sYW47CiAgICBuID0gNDsKCWFuPS0yOwoJZm9yKGludCBpPTA7IGk8bjsgaSsrKXsKCQlhbj0yKmFuKzM7Cn0KCiAgICBwcmludGYoIuaVsOWIl2Fu44GuJWTnlarnm67jga7lgKTjga8lZFxuIiwgbiwgYW4pOwoJcmV0dXJuIDA7Cn0K