cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A064482 Triangle read by rows: T(n,k) (n >= 2, 1<=k<=n-1) is the number of permutations p of 1,...,n with max(|p(i)-p(i-1)|, i=2..n) = k.

This page as a plain text file.
%I A064482 #14 Apr 10 2019 13:12:41
%S A064482 2,2,4,2,10,12,2,18,52,48,2,32,146,300,240,2,54,372,1204,1968,1440,2,
%T A064482 86,954,4082,10476,14640,10080,2,134,2376,13348,46012,97968,122400,
%U A064482 80640,2,206,5704,44274,186202,536652,990960,1139040,725760,2,312,13278,145216,742940,2655004,6562128,10847520,11692800,7257600
%N A064482 Triangle read by rows: T(n,k) (n >= 2, 1<=k<=n-1) is the number of permutations p of 1,...,n with max(|p(i)-p(i-1)|, i=2..n) = k.
%C A064482 T(n,n-1) = A052849; sum(T(n,k),k=1..n-1) = A000142.
%H A064482 Alois P. Heinz, <a href="/A064482/b064482.txt">Rows n = 2..18, flattened</a>
%e A064482 Triangle T(n,k) begins:
%e A064482   2;
%e A064482   2,   4;
%e A064482   2,  10,   12;
%e A064482   2,  18,   52,    48;
%e A064482   2,  32,  146,   300,   240;
%e A064482   2,  54,  372,  1204,  1968,  1440;
%e A064482   2,  86,  954,  4082, 10476, 14640,  10080;
%e A064482   2, 134, 2376, 13348, 46012, 97968, 122400, 80640;
%o A064482 (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
%Y A064482 Cf. A052849, A000142, A129534.
%K A064482 nonn,tabl
%O A064482 2,1
%A A064482 Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 05 2001
%E A064482 More terms from _Naohiro Nomoto_, Dec 04 2001
%E A064482 More terms from _R. J. Mathar_, Oct 11 2007