#C30612. 递推:Pell数列
递推:Pell数列
Background背景
有一种数列,它的前10项的值分别为:1 2 5 12 29 70 169 408 985 2378,这个数列被称为Pell数列,请问该数列的第n项的值是多少?(n<=1000)
Input输入
一个整数n。
Output输出
第n项的值。
Samples样例
10
2378
Limitation限制
1s, 1024KiB for each test case.
有一种数列,它的前10项的值分别为:1 2 5 12 29 70 169 408 985 2378,这个数列被称为Pell数列,请问该数列的第n项的值是多少?(n<=1000)
一个整数n。
第n项的值。
10
2378
1s, 1024KiB for each test case.
By signing up a 霖家编程 universal account, you can submit code and join discussions in all online judging services provided by us.