编辑代码

class Main {
 public static void main(String[] args) {
        //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
  System.out.println(f(10));
 }
    public static int f(int n){
        if(n == 1){
            return 1;
        }
        else{
            return (f(n-1)+1)*2;
        }
    }
}