login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A084894 Number of permutations of length n such that at least one absolute difference between consecutive elements has a distinct partner. 1
0, 0, 2, 20, 112, 696, 5008, 40280, 362760, 3628504, 39916152, 479000272, 6227017600, 87178281288, 1307674342408, 20922789832080, 355687427952808, 6402373705217304, 121645100407380704, 2432902008173142656 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

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

LINKS

Table of n, a(n) for n=1..20.

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.

PROG

(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: A069537 A282818 A001797 * A203238 A061004 A278772

Adjacent sequences:  A084891 A084892 A084893 * A084895 A084896 A084897

KEYWORD

nonn

AUTHOR

Jon Perry, Jun 10 2003

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 18 13:25 EDT 2019. Contains 326100 sequences. (Running on oeis4.)