1147: Pell数列

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:12 Solved:6

Description

 Pell数列a1,a2,a3,…的定义是这样的:a1=1,a2=2,…,an = 2an-1 + an-2(n>2)。给出一个整数k,求Pell数列的第k项是多少。

Input

输入一个整数n(n<20)

Output

输出一个整数

Sample Input Copy

8

Sample Output Copy

408

Source/Category