#include <bits/stdc++.h> using namespace std; int n(int x){ // 自創一個函式n if(x==1) return 1; // 如果x=1 就回傳1 else return n(x-1)+x*x-x+1; // 如果x不等於1 就回傳n(x-1)+x*x-x+1 } int main() { int x; cin>>x; cout<<n(x); // 輸出n(x) return 0; }