OFFSET
2,1
LINKS
Alois P. Heinz, Rows n = 2..18, flattened
EXAMPLE
Triangle T(n,k) begins:
2;
2, 4;
2, 10, 12;
2, 18, 52, 48;
2, 32, 146, 300, 240;
2, 54, 372, 1204, 1968, 1440;
2, 86, 954, 4082, 10476, 14640, 10080;
2, 134, 2376, 13348, 46012, 97968, 122400, 80640;
PROG
(C++) #include <iostream> #include <vector> #include <algorithm> using namespace std; inline int k(const vector<int> & s) { const int n = s.size() ; int kmax = 0 ; for(int i=1; i<n; i++) { const int thisdiff = abs(s[i]-s[i-1]) ; if ( thisdiff > kmax) kmax = thisdiff ; } return kmax ; } int main(int argc, char *argv[]) { for(int n=2 ;; n++) { vector<int> s; for(int i=1; i<=n; i++) s.push_back(i) ; vector<unsigned long long> resul(n); do { resul[k(s)]++ ; } while( next_permutation(s.begin(), s.end()) ) ; for(int i=1; i<n; i++) cout << resul[i] << ", " ; cout << endl ; } return 0 ; } - R. J. Mathar, Oct 11 2007
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 05 2001
EXTENSIONS
More terms from Naohiro Nomoto, Dec 04 2001
More terms from R. J. Mathar, Oct 11 2007
STATUS
approved