/* C++ program to calculate A118988 Author: M. Wang Email Address: atvv@foxmail.com Compiler: MinGW compiler Compiler Version: v4.9.2 (tdm64-1) Compiler Options: -O2 -Wall -Wextra OEIS URL: https://oeis.org/A118988 Output: 2 2 4 7 15 20 62 190 771 ... */ #include #include #include #include #include #include #include #include using namespace std; set st; int row[333][333]; int n; int str[333]; int invcnt=1; int perval; void per_dfs(int k){ if(k!=n){ int i; invcnt*=row[k][str[k]]; per_dfs(k+1); invcnt*=row[k][str[k]]; for(i=k+1;i