Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A084894
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A084894 Number of permutations of length n such that at least one absolute difference between consecutive elements has a distinct partner. +0
2
0, 0, 2, 20, 112, 696, 5008, 40280, 362760, 3628504, 39916152, 479000272, 6227017600, 87178281288, 1307674342408, 20922789832080, 355687427952808, 6402373705217304, 121645100407380704, 2432902008173142656 (list; graph; listen)
OFFSET

1,3

COMMENT

a(n)=n!-A006967(n)

EXAMPLE

a(3)=2 as only 123 and 321 have the required property, with differences of 1,1. The rest all have differences of 1,2.

PROGRAM

(PARI) { for (n=3, 10, x=vector(n-1); s=0; for (i=1, n!, v=numtoperm(n, i); for (j=1, n-1, x[j]=abs(v[j+1]-v[j])); x=vecsort(x); fl=0; for (k=1, n-2, if (x[k]==x[k+1], fl=1; break)); if (fl==1, s++)); print(n"; "s)) }

CROSSREFS

Cf. A006967.

Sequence in context: A073077 A069537 A001797 this_sequence A061004 A062189 A094254

Adjacent sequences: A084891 A084892 A084893 this_sequence A084895 A084896 A084897

KEYWORD

nonn

AUTHOR

Jon Perry (perry(AT)globalnet.co.uk), Jun 10 2003

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 August 19 23:53 EDT 2008. Contains 142930 sequences.


AT&T Labs Research