转移方程我也不知道怎么推出来的
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mo = (int)1e9 + 7;
const int N = (int)1e7 + 5;
int dp[N];
int n;
signed main() {
cin >> n;
dp[1] = 1; dp[2] = 2;
dp[3] = 5;
for (int i = 4; i <= n; i++) {
dp[i] = (dp[i - 1]*2%mo + dp[i - 3]%mo )%mo;
}
cout << dp[n];
}