Rosetta Problems

とても長い数列

https://atcoder.jp/contests/code-festival-2015-quala/tasks/codefestival_2015_qualA_b