Hi,
I found this solution to tri-tiling problem, but I am not able to prove it.
#include<bits/stdc++.h>
#define int long long
using namespace std;
int ways(int tile)
{
if (tile < 0) return 0;
if (tile == 0) return 1;
if (tile == 2) return 3;
return ways(tile - 2) * 4 - ways(tile - 4);
}
signed main()
{
int n;
while(true){
cin >> n;
if(n == -1) break;
if(n == 1){
cout << 0 << '\n';
continue;
}
cout << ways(n) << '\n';
}
return 0;
}