Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A064482
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
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. +0
2
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, 2, 206, 5704, 44274, 186202, 536652, 990960, 1139040, 725760, 2, 312, 13278, 145216 (list; table; graph; listen)
OFFSET

2,1

COMMENT

T(n,n-1)=A052849; sum(T(n,k),k=1..n-1)=A000142.

PROGRAM

(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 (mathar(AT)strw.leidenuniv.nl), Oct 11 2007

CROSSREFS

Cf. A052849, A000142.

Sequence in context: A103314 A111741 A111793 this_sequence A067228 A010026 A059427

Adjacent sequences: A064479 A064480 A064481 this_sequence A064483 A064484 A064485

KEYWORD

nonn,tabl

AUTHOR

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 05 2001

EXTENSIONS

More terms from Naohiro Nomoto (n_nomoto(AT)yabumi.com), Dec 04 2001

More terms from R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Oct 11 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research