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