login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A285850 Number of ways n couples can sit in a row such that exactly one couple sits next to each other. 1
0, 2, 8, 288, 15744, 1401600, 183582720, 33223034880, 7939197665280, 2421184409763840, 917547530747904000, 422959572499916390400, 233037523912020826521600, 151234400024881955183001600, 114177664785555609793383628800, 99217287255932372662490234880000 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
T. Amdeberhan et al., n-distant permutations more than not, MathOverflow, 2017.
FORMULA
For n>0, a(n) = A007060(n) + 2*n*A007060(n-1).
For n>1, a(n) = ( (4*n^2 - 8*n + 1)*a(n-1) + (2*n-2)*(2*n-1)*a(n-2) ) * 2*n/(2*n-3).
(12*n^3+84*n^2+192*n+144)*a(n+1)+(8*n^3+34*n^2-6*n-108)*a(n+2)+(-4*n^3-42*n^2-147*n-162)*a(n+3)+(n+3)*a(n+4) = 0. - Robert Israel, Apr 28 2017
EXAMPLE
For n=2, if the two couples are (1,2) and (a,b), the a(2) = 8 solutions are a12b, a21b, b12a, b21a, 1ab2, 1ba2, 2ab1, 2ba1. - N. J. A. Sloane, Apr 28 2017
MAPLE
f:= rectoproc({(12*x^3+84*x^2+192*x+144)*a(x+1)+(8*x^3+34*x^2-6*x-108)*a(x+2)+(-4*x^3-42*x^2-147*x-162)*a(x+3)+(x+3)*a(x+4), a(0) = 0, a(1) = 2, a(2) = 8, a(3) = 288}, a(x), remember):
map(f, [$0..50]); # Robert Israel, Apr 28 2017
MATHEMATICA
a007060[n_]:=Sum[(-1)^(n - k) Binomial[n, k] Subfactorial[2k], {k, 0, n}]; a[n_]:=If[n<1, 0, a007060[n] + 2n*a007060[n - 1]]; Table[a[n], {n, 0, 50}] (* Indranil Ghosh, Apr 28 2017 *)
PROG
(Python)
from sympy import binomial, subfactorial
def a007060(n): return sum([(-1)**(n - k)*binomial(n, k)*subfactorial(2*k) for k in range(n + 1)])
def a(n): return 0 if n<1 else a007060(n) + 2*n*a007060(n - 1) # Indranil Ghosh, Apr 28 2017
CROSSREFS
Cf. A007060.
Sequence in context: A296406 A215651 A363180 * A009501 A013027 A012918
KEYWORD
nonn,easy
AUTHOR
Max Alekseyev, Apr 28 2017
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 13:38 EDT 2024. Contains 371914 sequences. (Running on oeis4.)