#include <stdio.h>
/* a_n を求める関数(再帰なし) */
int a(int n)
{
int result = 0;
int i;
for(i = 1; i <= n; i++) {
result = result * result + 1;
}
return result;
}
int main(void)
{
int i;
for(i = 1; i <= 6; i++) {
printf("a_%d = %lld\n", i
, a
(i
)); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgovKiBhX24g44KS5rGC44KB44KL6Zai5pWw77yI5YaN5biw44Gq44GX77yJICovCmludCBhKGludCBuKQp7CiAgICBpbnQgcmVzdWx0ID0gMDsKICAgIGludCBpOwoKICAgIGZvcihpID0gMTsgaSA8PSBuOyBpKyspIHsKICAgICAgICByZXN1bHQgPSByZXN1bHQgKiByZXN1bHQgKyAxOwogICAgfQoKICAgIHJldHVybiByZXN1bHQ7Cn0KCmludCBtYWluKHZvaWQpCnsKICAgIGludCBpOwoKICAgIGZvcihpID0gMTsgaSA8PSA2OyBpKyspIHsKICAgICAgICBwcmludGYoImFfJWQgPSAlbGxkXG4iLCBpLCBhKGkpKTsKICAgIH0KCiAgICByZXR1cm4gMDsKfQ==