Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A129534
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A129534 Triangle read by rows: T(n,k) = number of permutations p of 1,...,n, with min(|p(i)-p(i-1)|, i=2..n) = k (n>=2, k>=1). +0
2
2, 6, 22, 2, 106, 14, 630, 88, 2, 4394, 614, 32, 35078, 4874, 366, 2, 315258, 43638, 3912, 72, 3149494, 435002, 42808, 1494, 2, 34620010, 4775184, 496222, 25224, 160, 415222566, 57214716, 6164470, 393792, 6054, 2, 5395737242, 742861262, 82190752 (list; graph; listen)
OFFSET

2,1

COMMENT

Row n has floor(n/2) terms. Row sums are the factorial numbers (A000142). T(n,1)=A129535(n). Sum(T(n,k), k>=2)=A002464(n). If, in the definition, min is replaced by max, then one obtains A064482.

REFERENCES

R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 6.40.

EXAMPLE

T(4,2)=2 because we have 3142 and 2413.

Triangle starts:

2;

6;

22,2;

106,14;

630,88,2;

4394,614,32;

MAPLE

k:=3: with(combinat): a:=proc(n) local P, ct, i: P:=permute(n): ct:=0: for i from 1 to n! do if min(seq(abs(P[i][j]-P[i][j-1]), j=2..n))=k then ct:=ct+1 else ct:=ct: fi: od: ct: end: seq(a(n), n=2..8); # yields the first 7 entries in any specified column k

PROGRAM

(C++) #include <iostream> #include <vector> #include <algorithm> using namespace std; inline int k(const vector<int> & s) { const int n = s.size() ; int kmin = n+1 ; for(int i=1; i<n; i++) { const int thisdiff = abs(s[i]-s[i-1]) ; if ( thisdiff < kmin) kmin = thisdiff ; } return kmin ; } 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/2; i++) cout << resul[i] << ", " ; cout << endl ; } return 0 ; } - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Oct 11 2007

CROSSREFS

Cf. A000142, A129535, A002464, A064482.

Sequence in context: A066932 A084392 A156155 this_sequence A085286 A062085 A147800

Adjacent sequences: A129531 A129532 A129533 this_sequence A129535 A129536 A129537

KEYWORD

nonn,tabf

AUTHOR

Emeric Deutsch (deutsch(AT)duke.poly.edu), May 05 2007

EXTENSIONS

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

page 1

Search completed in 0.003 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 27 22:38 EST 2009. Contains 167602 sequences.


AT&T Labs Research