http://acm.hust.edu.cn/vjudge/contest/view.action?cid=31329#problem/A
找规律,f[ i ] = f[ i - 1 ] + 2 * f[ i - 2 ] ;
import java.math.BigInteger;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
BigInteger[] f = new BigInteger[ 260 ];
f[ 0 ] = new BigInteger("1");
f[ 1 ] = new BigInteger( "1" ) ;
for( int i = 2 ; i <= 250 ; ++i )
{
f[ i ] = f[ i - 2 ].multiply( BigInteger.valueOf( 2 ) ).add( f[ i - 1 ] ) ;
}
while( cin.hasNext())
{
int n = cin.nextInt() ;
System.out.println(f[n]);
}
}
}